aitododocs Coming soonAutonomous delivery

Output, --json and exit codes

Markdown

The output contract: human text, --json, the status line and the exit codes.

Guideabout 2 min1 commands
On this page

Output, --json and exit codes#

Every command takes --json (also tkt --json <cmd>); use it as an agent. A status line on stderr may show a slow call (AITODO_NO_PROGRESS=1 turns it off); Ctrl-C exits 130. Exit codes.

Details6 items
  • Status line. When tkt waits more than about 0.75 s on an LLM (tkt ticket get --summary, tkt suggest refs|value, tkt plan from-docs) or the server (a command forwarded to a server store, the tkt store move phases, tkt feedback, the coordinator), it shows one line on stderr: what it waits for and the seconds (e.g. Asking the server LLM at tickets.example.com for a summary of PAY-001 … 12s (Ctrl-C to cancel, --no-llm to skip)), and erases it when the call ends. Only on an interactive terminal: never when stderr is a pipe or a file (an agent's capture), in CI (CI set) or with TERM=dumb. It is not an error; stdout (--json included) is byte-identical with or without it.

  • Ctrl-C cancels the wait: exit 130, no traceback, no tkt feedback hint.

  • tkt meta prints what this tkt knows, with no server and no store: versions, enums, the hint and action vocabularies, error codes, environment variables and the commands. tkt meta --json is the same object as GET /v1/meta.

  • A few commands have no JSON output (tkt tree, tkt ticket tree, the deletes): tkt --json <cmd> then runs normally and prints Note: … has no JSON output; --json is ignored. on stderr.

  • Help: every --help ends with examples. A command run with no arguments (or a group with no subcommand, e.g. tkt ticket) prints its help with examples and exits 2: help is never success. A partial call keeps its precise error, followed by the examples.

  • tkt meta --section versions|enums|hints|actions|refs|errors|env|commands prints one part (repeatable).

Exit codes#

0
success; for tkt ticket lint, tkt lint and tkt doctor: no hints.
1
an ERR_* error; for lint and doctor: the worst is info; for tkt next: nothing is startable.
2
a Typer usage error (unknown flag, missing argument); for lint and doctor: warning.
3
lint block or an integrity hint ("integrity": true), doctor error.
4
lint or doctor could not run (unknown ticket, unreadable file, no store); stdout stays empty even with --json.
130
Ctrl-C cancelled the wait; no traceback.

Commands on this page#

Generated from the registry: src/aitodo/api/selfdoc_entries/start.py, src/aitodo/api/selfdoc_entries/ref.py · start.output, ref.exit-codesv0.1.298