Modules§
- exit_
codes - Exit codes for agent-friendly error handling. Agents can branch on specific failure modes without parsing error text.
Structs§
- Error
Contract - One failure mode of the CLI, in the form an agent consumes it.
- Output
Config - 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_errorfor errors that did not originate as anApiError. - 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).