Skip to content

Exit codes (Tier-1)

ShipGate uses numeric exit codes so CI can branch on success vs failure. This page describes implemented behavior for Tier-1 commands, not every subcommand in the CLI.

Global constants

Defined in the CLI source as ExitCode:

CodeNameTypical meaning
0SUCCESSSuccess; SHIP where applicable
1ISL_ERRORNO_SHIP, verification/gate failure, or Tier-1 “failure” path
2USAGE_ERRORBad flags, missing required arguments (often via Commander exitOverride)
3INTERNAL_ERRORUnexpected internal failure
4WARNReserved for --fail-on warning style behavior where implemented

Tier-1 commands

CommandSuccessFailureUsage / CLI errors
shipgate check01 (parse/type errors)2 when Commander rejects argv
shipgate verify0 (getVerifyExitCode → success)12 for usage
shipgate gate0 (getGateExitCoderesult.exitCode, normally SHIP)1 (NO_SHIP or gate failure)2 if required options missing (e.g. no --impl)
shipgate next0 (getNextGateExitCode when result.success)1 when not successful2 for usage
shipgate go0 for SHIP or WARN (getGoExitCode)1 for other verdicts2 for usage

Important: For gate, the verdict path is almost always 0 or 1. Codes 2 and 3 apply to CLI invocation (bad args) or rare internal errors, not to a normal NO_SHIP verdict.

CI recommendations

  • Treat non-zero as “block merge” unless you explicitly allow 2 for “misconfigured workflow” only.
  • Prefer --format json or --ci on supported commands for stable logs.
  • For Next.js golden path, use --format quiet plus --evidence-out / --summary-out so PRs always get a file-backed reason.