Output & automation
ayx is built to be driven by scripts and agents, not just typed at a prompt. Two things make that work: a uniform JSON envelope and a dry-run-by-default safety gate.
JSON output
Section titled “JSON output”Add --output json for machine-readable output. It’s a global flag, so it can appear before or after the subcommand:
ayx --output json one flows listEvery JSON response uses the same envelope:
{ "ok": true, "message": "…", "timestamp_utc": "…", "data": {}}Branch on ok, read data for the result. Failures use the same shape with ok: false, add an error_code, and are written to stderr instead of stdout.
Dry-run by default
Section titled “Dry-run by default”Mutating commands print what they would do and exit 0 unless you pass --apply. A pipeline can safely run the dry-run form against production:
# Preview — no changes; capture the planned requestayx --output json one flows delete <id>
# Commit, non-interactivelyayx one flows delete <id> --apply --yes--yes skips the confirmation prompt that destructive commands show in a terminal — required for CI and pipes.
Exit codes
Section titled “Exit codes”0— success, or a dry-run that completed- non-zero — the command failed; read
message(anddata) in the envelope for why
Agent-friendly by design
Section titled “Agent-friendly by design”Because every command speaks the same JSON envelope and gates destructive actions behind an explicit flag, ayx makes a clean tool surface for AI agents: predictable output to parse, and a safety rail so an agent can’t change remote state without an explicit --apply.