Skip to content

Standardize CLI exit-code contracts #129

Open

Description

@aram356

Description

Define and apply consistent exit status meanings across the bundled CLI, generated application CLIs and command-specific outcomes.

The bundled binary maps command errors to exit 1 and typed-command stubs to 2. Generated application CLI templates map every command error to 2; their diff path also assigns 1 to detected changes. The no-CLI-feature binary logs a build error without setting a failing status.

Steps to reproduce

  1. Inspect the bundled binary's result/error paths.
  2. Compare generated CLI error handling, diff exits and the no-feature main function.

Expected behavior

Scripts can distinguish success, actionable command outcomes, usage/unsupported cases and runtime failures using a documented consistent contract.

Impact

Identical command failures can have different statuses depending on which CLI binary was generated or installed.

Proposed fix

Specify a small shared exit-code mapping, retain deliberate diff semantics, apply it to both entry points and document any compatibility change.

Done when

  • Bundled and generated CLI success/runtime/usage/unsupported statuses follow the same documented mapping.
  • Diff-with-changes remains distinguishable from failure.
  • A binary built without required CLI support returns failure.
  • Process-level tests cover representative commands, stubs and error paths.

Related

Activity

  1. changed the title [-]Standardize exit codes[/-] [+]Standardize CLI exit-code contracts[/+] on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions