Skip to main content
Reference
What scripts and CI jobs can rely on: output streams, each command’s --json payload, exit codes, and what an unattended job can reach in Helix Cloud.

Output

  • stdout carries only the result; stderr carries progress, warnings, hints, and errors.
  • --json prints one compact JSON value and a newline on stdout, nothing else. It never prompts, skips the startup update checks, and conflicts with --quiet and --verbose.
  • Without a terminal on stdin or stderr, or with --json, commands never prompt: they use a default (dev, or the only candidate) or fail and list the candidates.
  • Destructive commands (delete, prune --all, project delete, database delete, database key revoke, service-credential revoke) that cannot prompt fail before acting unless you pass -y/--yes. prune <instance> never asks.
  • Output that is not a terminal is never colored; NO_COLOR=1 drops colors in a terminal.
  • Set HELIX_NO_UPDATE_CHECK=1 so the first command of the day does not wait up to 10 seconds on GitHub. See Environment variables.

Exit codes

The codes are the same with and without --json. Exceptions:
  • helix doctor prints its whole report, then exits 1 if any check fails; warnings alone exit 0.
  • helix shell prints a failed request’s error, keeps reading, and exits 0 at end of input. Use one helix query per request when each result must set the exit code.
  • helix stop exits 0 when the instance was not running, and helix prune <instance> when there was nothing to remove.
With --json, an error is one JSON object on stderr; without it, the same error prints as text. Only message is always present. candidates lists what you can pass when the CLI could not choose:
The other fields are context and caused_by.

JSON results

Cloud results are the API’s JSON field for field. Only database list and database get add "kind" ("dedicated" or "tenant"); owners the human view resolves, such as a project’s workspace, are not added. Cloud lists follow pagination up to 50 pages of 200 items, then fail with more than 50 pages; narrow the request. These commands have no JSON result:

Run in CI

Local instances

Local commands need only Docker or Podman, no login, so they run in CI as on your machine. Give each job its own CLI state with HELIX_HOME="$(mktemp -d)". In-memory data does not survive a restart; use --disk or S3 storage when it must.

Helix Cloud

The CLI has no unattended login: helix auth login needs an interactive terminal, and neither a service credential nor an application key can log the CLI in. Run Cloud commands such as helix query production, helix database, and helix api on a developer machine, and do not copy your session file into CI. From an unattended job, use:
helix database get <database> --json prints the gateway host as connectionEndpoint; the dashboard’s database page shows it too. Create the key once with helix database key create --access read-only and store it as a CI secret. A service credential:
  • can use only the MCP query and administration tools its project grants allow;
  • cannot list workspaces, projects, or databases, so give it a tenant:<id> or cluster:<id> target;
  • cannot call the Helix Cloud API the CLI uses, so it cannot run helix api, a Cloud helix query, or other Cloud commands;
  • cannot create, change, or revoke service credentials.