Skip to main content
CLI scripts should inspect returned state, preserve secrets and recover without repeating unintended writes.
Your agent should relay approval links while a command waits, inspect service errors and verify writes before retrying.

Agents and scripts

  • Add --json for machine-readable output. Stdout is JSON Lines: the final line is the result or {"error":{"code","message"}}. Progress goes to stderr.
  • Commands waiting for a person (init, login, a workspace switch that starts login, and OAuth connections) emit a waiting_for_human line before waiting. Read the stream and relay the link immediately. Other commands emit one result line.
  • A zero exit code is not always a successful service check. Inspect ok/health for connection tests, query.error for monitor previews and queryError for monitor charts. Keep configuration, data arrival, evaluation and delivery as separate checks.
  • Never include credentials or private telemetry in logs, source control or an agent’s final report. Commands that create ingest/deployment keys print the key once; capture it directly into approved secret storage.
Before retrying a write after a lost response, read back its state. For example, list monitors before retrying create; update a matching monitor rather than making a duplicate.

Environment

The CLI does not load repository .env files. Supply variables through your shell or secret manager. Without a terminal, missing input is an error rather than a prompt. Use explicit arguments and documented stdin/environment inputs. See Authentication for profile storage and recovery.