NCI
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

CodeWhen it fires
0Command succeeded.
2

Two unrelated cases share this code:

  • Argument / usage error from clap — e.g. an unknown flag.
  • NCI’s EXIT_QUERY_NOT_FOUND: nci query show, snippet, or overloads received a stable id that does not match any indexed row. Stderr carries the “recover the right id with query find / query symbol” hint.
3nci upgrade --check found a newer release.
1Generic 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.
130SIGINT (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.