Hoko CLI

Use Hoko from your terminal when you need repeatable link and workspace operations.

Install

Open cli.hoko.to. The installer detects macOS, Linux, or Windows and selects the matching CPU architecture.

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

For PowerShell:

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

The installer detects your platform, downloads a release archive, verifies its SHA-256 checksum, installs a bundled binary, and adds the user install directory to your shell profile. Bun is not required. Open a new terminal after installation.

Upgrade to CLI 0.1.0

CLI 0.1.0 retires the old operations transport. Re-run the installer above for your device, then verify the upgrade:

hoko --version

The CLI does not update itself automatically. If a custom script uses the old operations transport, follow the transport migration reference.

Sign in or use an API key

Run hoko auth login for a human account, then choose a workspace in the browser. The browser opens the Hoko OAuth consent page, then the CLI stores the credential in your operating system credential store.

Use HOKO_API_KEY for CI and server jobs:

HOKO_API_KEY=hk_... hoko links list

Run hoko auth status to see which credential is available. Run hoko workspace select <workspace_id> to switch workspace after login.

Common commands

hoko links list
hoko links create --url https://example.com --collection-id <collection_id>
hoko analytics list --take 50
hoko webhooks list

Commands return JSON by default. Use --output table for terminal inspection. Errors go to stderr.

Exit codes

Code Meaning
0 Success.
1 Unexpected local failure.
2 Invalid command, input, or request.
3 Missing or invalid credentials, HTTP 401, or credential-store failure.
4 Authorization denied (HTTP 403).
5 Rate limit reached (HTTP 429).
6 Network or connection failure.
7 Server failure (HTTP 5xx) or invalid discovery response.

Fix common errors

No credential

Run hoko auth login or set HOKO_API_KEY in the process environment. Do not paste a key into a shell history that another user can read.

Wrong workspace

Run hoko workspace select <workspace_id>, then run the command again.

Staging or local development

Pass the API and OAuth origins together:

hoko --api https://api.staging.hoko.to --issuer https://auth.staging.hoko.to auth login

For local Portless development, use HTTP loopback origins:

hoko --api http://api.hoko.localhost:1355 --issuer http://auth.hoko.localhost:1355 auth login

Rate limit

Wait for the Retry-After value, then retry a read. Check whether a write completed before retrying it so you do not create duplicate records.

Read the full reference

See the CLI documentation for install and command reference. The CLI host also provides README.md, a short machine-readable guide, and the full machine-readable guide.