Output, --json and exit codes
The output contract: human text, --json, the status line and the exit codes.
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
tktwaits 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, thetkt store movephases,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 (CIset) or withTERM=dumb. It is not an error; stdout (--jsonincluded) is byte-identical with or without it. -
Ctrl-C cancels the wait: exit 130, no traceback, no
tkt feedbackhint. -
tkt metaprints what thistktknows, with no server and no store: versions, enums, the hint and action vocabularies, error codes, environment variables and the commands.tkt meta --jsonis the same object asGET /v1/meta. -
A few commands have no JSON output (
tkt tree,tkt ticket tree, thedeletes):tkt --json <cmd>then runs normally and printsNote: … has no JSON output; --json is ignored.on stderr. -
Help: every
--helpends 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|commandsprints one part (repeatable).
Exit codes#
0- success; for
tkt ticket lint,tkt lintandtkt doctor: no hints. 1- an
ERR_*error; for lint and doctor: the worst isinfo; fortkt next: nothing is startable. 2- a Typer usage error (unknown flag, missing argument); for lint and doctor:
warning. 3- lint
blockor an integrity hint ("integrity": true), doctorerror. 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.