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.
hoko links list
hoko links create --url https://example.com --collection-id <collection_id>
hoko analytics list --take 50
hoko webhooks listResources 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:
hoko operations list
hoko operations describe measurement.events.listCommands 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
Use another deployment
Pass both origins when you work against staging or local development:
hoko --api https://api.staging.hoko.to --issuer https://auth.staging.hoko.to auth loginFor local Portless development, use HTTP loopback origins:
hoko --api http://api.hoko.localhost:1355 --issuer http://auth.hoko.localhost:1355 auth loginThe values must be origins. Do not include a path, query string, fragment, username, or password.