Output and exit codes
In a terminal, adacli prints readable tables. An AI assistant adds --json after the command name to get JSON, and reads the typed exit code to check the result. This page lists the global options, the output modes, and the exit codes.
Do not build an integration or a script on adacli. adacli is for a person or an AI assistant that works in a terminal. A release that removes or changes a command name, an option name, or an exit code increases the major version. Most output comes from the Ada service, so it can change without a new adacli release. Only the latest release of adacli is supported. For details, see Versioning and Supported releases. To build an integration, use the Ada API. The Ada API is the only stable interface.
Global options
Put a global option after the instance and before the command name:
An option after the command name fails with unknown option, unless the command has its own option with that name. --session works in any place.
When a command has its own option with the same name as a global option, the command reads only its own option. For example, mcp-tools delete has its own --yes. adacli acme --yes mcp-tools delete <id> does not confirm the delete: the command prints that it needs a confirmation, exits with code 0, and deletes nothing. Put --yes after the command name: adacli acme mcp-tools delete <id> --yes.
Not every command reads the global output options yet. A command that does not read them prints tables. To get JSON, put --json after the command name. Most commands have their own --json option:
Output modes
A command that reads the global output options selects the output mode in this order:
- The
--json,--output, or--quietoption. - The
ADACLI_OUTPUTenvironment variable, set totable,json, orquiet. - JSON when stdout is not a terminal, for example when you pipe the output to another command. Otherwise, tables.
A command that has its own --json option prints JSON when you put --json after the command name, whatever the output mode.
To read one value from the output in a terminal, use --json with a tool such as jq:
Errors
When a command fails in JSON mode, adacli writes the error to stderr as JSON. Stdout stays empty, so an AI assistant does not read the error as data.
status is an exception. When there is no working session, status --json writes not_logged_in or session_invalid to stdout and nothing to stderr. See Sessions.
hint tells you what to do next. For a usage error, allowed lists the values that the option accepts.
Exit codes
An AI assistant reads the exit code to check the result of a command. The text of a message can change, so the exit code is the result to check.
Codes 20 to 23 are not failures. Do not use the output as a complete result:
- With
20, the command printed the rows that it read to stdout.conversations export -o <file>writes them to<file>.partialinstead, and does not change<file>. - With
21,conversations exportwrites nothing to stdout and no file. - With
22and23, the command printed its output to stdout.
To read the exit codes as JSON, run adacli agent-context. For details, see agent-context.