Reference · Exit codes
Exit codes
The CLI uses two exit code spaces: clap's defaults for argument parsing, and one NCI-specific code for “the symbol id you asked about does not exist”. Anything else surfaces as a generic failure.
Codes
| Code | When it fires |
|---|---|
0 | Command succeeded. |
2 | Two unrelated cases share this code:
|
3 | nci upgrade --check found a newer release. |
1 | Generic runtime failure — anything not covered above. The error message lives on stderr; on JSON-format commands it is also echoed inside the {"ok":false,"error":…} envelope. |
130 | SIGINT (Ctrl-C). Platform default — NCI does not set it explicitly. |
Reading the JSON envelope
For commands that support --format json, failures print { "ok": false, "error": "<string>" } to stdout — error is a single human-readable string, not an object (see json_err in packages/nci-engine/src/cli.rs). There is no separate kind / message split in the binary today.
For the success envelopes and data shapes used by nci query, see JSON output schemas.