Description
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
- Inspect the bundled binary's result/error paths.
- 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
- Parent: Complete CLI and local developer workflows #124.
- Machine-readable CLI output: Add --format json to operator CLI commands #383.
- Bundled CLI exit handling
- Generated CLI exit handling
- Related PR Add --format json to CLI commands #388; this PR alone does not establish completion of this issue.
Activity
[-]Standardize exit codes[/-][+]Standardize CLI exit-code contracts[/+]