The JSON contract
--output json is the stable, machine-readable contract — the shape an agent or script can depend on across releases. Changes are additive: new fields may appear, but existing fields and exit codes won’t change within a major version. --output text is human-friendly and may change freely. When in doubt, script against JSON.
--dry-run, which emits canned data whose shape matches the live response — perfect for writing and testing a script before you wire up auth.
Piping into jq
JSON output pipes straight intojq or an LLM:
Branching on exit codes
The CLI’s exit codes are stable and meaningful, so scripts can branch without parsing output at all:A minimal CI gate
CI/CD
A full GitHub Actions workflow — including failure-artifact upload and rate-limit handling
Debugging a script
--verbose— human-readable retry / backoff / polling messages to stderr.--debug— HTTP method, path, request id, latency, and retry decisions to stderr. The API key is never included.
jq.
Where to Go Next
Exit Codes & Errors
The full branching contract for scripts and agents
Configuration
Profiles, environment variables, and global flags
CI/CD
A complete GitHub Actions pipeline
Command Reference
Every command, flag, and output shape