Hoko CLI

Command syntax, authentication inputs, output, and exit codes for the Hoko CLI.

Install

Use the CLI Help guide for installation and first-run steps. This reference keeps the command and machine-readable contract.

Authenticate

Use the CLI Help guide for browser sign-in and workspace selection. API-key and human-token environment usage is documented below for automation.

Transport migration

CLI 0.1.0 retires the old /operations/<name> HTTP transport. hoko operations list and hoko operations describe <name> are local discovery commands; resource commands use the direct REST binding documented for each resource. Update scripts that post to /operations/... before upgrading. The CLI does not auto-update.

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 --url https://example.com --collection-id <collection_id>
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 operations describe measurement.events.list

Commands accept JSON with --body JSON, --body @file.json, or --body - for stdin. JSON is written to stdout by default; --output table selects a human-readable table and --json forces JSON. Structured errors are written to stderr.

Global deployment flags are --api <origin> and --issuer <origin>. HOKO_API_KEY authenticates automation, HOKO_AUTH_TOKEN supplies a human token, HOKO_API_URL and HOKO_AUTH_URL select origins, and HOKO_API_RESOURCE selects the resource. Do not combine HOKO_AUTH_TOKEN with HOKO_API_KEY or stored OAuth credentials.

Exit codes

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

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

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

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