Skip to main content
Version: v0.0.3

Variable: EXIT

const EXIT: object

The stable exit-code map. Adding a code is a documented, tested change to the CLI's contract; renaming or repurposing one is a breaking change.

Type Declaration

DATAERR

readonly DATAERR: 65 = 65

Data error: input could not be parsed or its format could not be detected (EX_DATAERR).

INVALID

readonly INVALID: 1 = 1

Operation-level failure: validate found the input invalid (parseable but non-conformant): a real, expected CI signal that the message is bad and the tool worked. Never emitted for unparseable input (that is DATAERR).

NOINPUT

readonly NOINPUT: 66 = 66

No input: the named file does not exist or is unreadable (EX_NOINPUT).

OK

readonly OK: 0 = 0

Success: the operation completed; validate found the input valid.

SOFTWARE

readonly SOFTWARE: 70 = 70

Internal error: an unexpected exception (a bug), distinct from a handled bad input (EX_SOFTWARE).

UNAVAILABLE

readonly UNAVAILABLE: 69 = 69

Unavailable: a required capability is not yet wired (e.g. redact before @cosyte/deid), a distinct non-zero signal that is never a fake success (EX_UNAVAILABLE).

USAGE

readonly USAGE: 2 = 2

Usage error: unknown command, bad flag, missing argument (EX_USAGE).

Example

import { EXIT } from "@cosyte/cli";

process.exitCode = EXIT.OK; // => 0