Hoko CLI

Install and use the Hoko command-line client for links, analytics, conversions, and webhooks.

Install

The hosted installer detects your operating system and CPU architecture.

Code cURL
curl -fsSL https://cli.hoko.to/install.sh | bash

Windows PowerShell:

Code powershell
irm https://cli.hoko.to/install.ps1 | iex

The installer selects the operating system and CPU architecture, installs a bundled binary, and adds the user install directory to your shell profile. Bun is not required. Open a new terminal after installation. Use the CLI landing page for direct downloads. Use the full CLI reference for machine-readable command details.

Authenticate

Use OAuth for a human user. The CLI stores the credential in the operating system credential store.

Code cURL
hoko auth login --workspace-id <workspace_id>
hoko auth status

Use an API key for automation:

Code cURL
HOKO_API_KEY=hk_... hoko links list

Find the workspace ID in the dashboard, then sign in:

Code cURL
hoko auth login --workspace-id <workspace_id>

Switch the selected workspace later:

Code cURL
hoko workspace select <workspace_id>

Run commands

Resource commands print JSON to stdout. Errors print JSON to stderr and return a non-zero exit code.

Code cURL
hoko links list
hoko links create --body '{"destination":"https://example.com"}'
hoko analytics list --take 50
hoko webhooks list

Resources include links, collections, tags, partners, utm-templates, customers, analytics, events, journeys, webhooks, usage, keys, lead, and sale.

Use the generic operation command for named engine operations:

Code cURL
hoko operations list
hoko operation measurement.events.list --body '{}'

Use another deployment

Pass both origins when you work against staging or local development:

Code cURL
hoko --api https://api.staging.hoko.to --issuer https://auth.staging.hoko.to auth login --workspace-id <workspace_id>

For local Portless development, use HTTP loopback origins:

Code cURL
hoko --api http://api.hoko.localhost:1355 --issuer http://auth.hoko.localhost:1355 auth login --workspace-id <workspace_id>

The values must be origins. Do not include a path, query string, fragment, username, or password.