Skip to content

CLI: Document exit codes in --help output #164

@titouanmathis

Description

@titouanmathis

Context

The CLI has a well-defined exit code hierarchy in packages/cli/src/error-handler.ts:

Code Meaning
0 Success
1 General error
2 Authentication error
3 Validation error
4 Configuration error
5 Not found

These are useful for agents and scripts to branch on failure type without parsing error messages. However, they're not documented anywhere user-facing.

Proposal

Add an EXIT CODES section to the main productive --help output:

EXIT CODES:
  0    Success
  1    General error (unexpected failure)
  2    Authentication error (invalid/expired token)
  3    Validation error (missing or invalid arguments)
  4    Configuration error (missing apiToken, orgId, etc.)
  5    Resource not found

Also mention in the README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions