ota Exit Codes
May 9, 2026 ยท View on GitHub
This document records the current command exit-code contract for the shipped ota surface.
Global registry
0: success, ready state, or warning-only diagnosis1: invalid contract, blocking readiness issue, protected write failure, or general command failure2: CLI usage or argument parsing error126: command was found but could not be executed127: command could not be started, usually because the executable was not found onPATH
Command-specific rules
ota validate
0on valid contract1on load or validation failure
ota tasks
0on valid contract and successful task listing1on load or validation failure
ota run
0on successful task execution- child task exit code on task failure
- child task exit code is preserved for native, container, and current remote execution paths
126when the child command was found but could not be executed127when the task command could not be started because the executable was not found128+nwhen the child process terminated from signaln1when backend configuration is invalid or the requested backend/provider is unsupported1on load/validation failure or runner failure before the child exit code is available
ota doctor
0when findings are empty or warning-only1when any blocking readiness finding exists1on load or validation failure
ota check
0when configured checks are empty or warning/info-only1when any configured check produces an error-severity finding1on load or validation failure
ota init
0on successful review output or write1when an existingota.yamlblocks init1on detection failure1on write failure
ota up
ota up has two layers of exit codes:
- Ota-level readiness failures return
1 - child-process failures are preserved when Ota actually runs a service
startcommand or thesetuptask
That means 0 is reserved for the overall command succeeding and the repo reaching READY. A child command can succeed and Ota can still return 1 later if the repo does not become ready.
ota up --dry-run:0when the preview is actionable and unblockedota up --dry-run:1when the preview identifies a blocking condition0when the repo reachesREADY- service-start child exit code when a required service
startcommand fails - setup task child exit code when
setupfails - setup task child exit code is preserved when
setupruns through native, container, or current remote backend paths 126when a servicestartcommand or setup task was found but could not be executed127when a servicestartcommand or setup task could not be started because the executable was not found128+nwhen a service or setup child process terminated from signaln1when preconditions fail1when required-service readiness fails in theservicesphase1when post-up diagnosis is still not ready1on load or validation failure
ota detect
0on successful dry-run output0on successful write1when an existingota.yamlblocks write1when the high-confidence projection is insufficient to produce a valid contract1on detection failure1on write failure
ota workspace validate
0on valid workspace contract1on load or validation failure
ota workspace tasks
0on successful workspace task listing1on load or validation failure
ota workspace list
0on successful workspace repo inventory output1on load or validation failure
ota workspace run
0when all required repos complete the requested task1when any required repo task fails, acquisition fails, or is blocked by dependency failure1on load or validation failure
ota workspace check
0when all required repos are check-ready or warning-only1when any required repo has a blocking check finding1on load or validation failure
ota clean
0when persistent execution state is removed0when there is no cleanup action to perform1on load or validation failure1when persistent cleanup fails before ota can report success
ota clean --stale
0when exited ota-managed containers are removed0whenota clean --stale --dry-runpreviews exited ota-managed containers1when no local container engine can be queried or stale container removal fails2whenota clean --staleis combined with PATH,--file, or--member
ota workspace doctor
0when all required repos are ready or warning-only1when any required repo has a blocking finding1on load or validation failure
ota workspace up
0when all required repos reachREADY1when any required repo fails acquisition or does not become ready1on load or validation failure
ota workspace refresh
0when existing repos refresh successfully or are skipped intentionally1when refresh fails or the workspace cannot be loaded or validated
Notes
- JSON mode does not change exit-code behavior
ok: truein JSON output is intentionally aligned with exit code0- warning-only diagnosis is still success