--json, --format, or --verbose.
Overview
By default, all command output is displayed to everyone ('all'). Set outputPolicy: 'agent-only' to suppress data output in human/TTY mode while still returning structured data to agents.
Use Cases
Internal Commands
Commands designed for agent-only use that produce verbose machine-readable output:Commands with Side Effects
Commands that perform actions but don’t need to display data:Inheritance
SetoutputPolicy on a group or root CLI to inherit across all children:
CLI-Level Policy
SetoutputPolicy at the CLI level to apply to all commands by default:
Behavior Details
Human Mode (TTY)
WhenoutputPolicy: 'agent-only' and stdout is a TTY:
- Data output is suppressed — return value is not displayed
- Errors are still shown —
error()calls display normally - CTAs are still shown —
ok()anderror()CTAs display normally --jsonoverrides — explicit format flags show data--verboseoverrides — full envelope is shown
Agent Mode (Non-TTY)
When stdout is not a TTY (piped, redirected, or consumed by an agent):- Data is always included — regardless of
outputPolicy - Full envelope format — agents always see structured output
Forcing Data Display
Humans can overrideagent-only with explicit format flags:
Policy Values
| Value | Description |
|---|---|
'all' | Displays to both humans and agents (default) |
'agent-only' | Suppresses data output in human/TTY mode while still returning it to agents |
When to Use
Use'agent-only' for:
- Commands designed for agent orchestration
- Internal commands that produce verbose machine-readable output
- Commands where the side effect matters more than the return value
- Commands that use CTAs to guide users instead of showing raw data
'all' (default) for:
- Commands where the output is the primary value (queries, reports)
- Commands humans invoke directly
- Commands with concise, human-readable output

