Skip to content

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.

Add -o json for machine-readable output. It’s a global flag, so it can appear before or after the subcommand:

Terminal window
ayx -o json one workflows list

Every JSON response uses the same envelope:

{
"ok": true,
"command": "one.workflows.list",
"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. command names the leaf that ran on both, so a log line can be traced back to the invocation that produced it.

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:

Terminal window
# Preview — no changes; capture the planned request
ayx -o json one workflows delete <id>
# Commit, non-interactively
ayx one workflows delete <id> --apply --yes

--yes skips the confirmation prompt that destructive commands show in a terminal — required for CI and pipes.

  • 0 — success, or a dry-run that completed
  • non-zero — the command failed; read message (and data) in the envelope for why

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.