Skip to main content

Module output

Module output 

Source

Modules§

exit_codes
Exit codes for agent-friendly error handling. Agents can branch on specific failure modes without parsing error text.

Structs§

ErrorContract
One failure mode of the CLI, in the form an agent consumes it.
OutputConfig
Output configuration for agent-friendly CLI design.

Statics§

ALL_ERRORS
Every failure mode the CLI can report, in schema declaration order.
API_ERROR
AUTH
CONFIRMATION_REQUIRED
CONFLICT
INVALID_INPUT
NOT_FOUND
RATE_LIMIT
UNEXPECTED_ERROR

Functions§

contract_for
The contract row describing how this error is reported.
contract_for_dyn
The contract row for any error, falling back to unexpected_error for errors that did not originate as an ApiError.
exit_code_for_error
Map an error to a specific exit code by downcasting to ApiError.
hyperlink
Format a URL as a clickable OSC 8 hyperlink in terminals that support it.
machine_readable_errors
Whether errors should be machine-readable, decided from the raw command line.
print_error_envelope
Write a structured error envelope as the last line of stderr.
use_color
Whether to use colored output (only when stdout is a terminal).