Synced package doc
Docs/prompts-gpt Package/Exit Codes Reference

Exit Codes Reference

Exit codes returned by prompts-gpt CLI commands.

Standard Exit Codes

CodeMeaningDescription
0SuccessCommand completed successfully
1Execution failurePrompt execution or sweep failed
2Configuration errorMissing or invalid config, missing provider
3Authentication errorInvalid or missing token
4Validation errorInvalid prompt file or frontmatter
5Lock conflictSweep lock already held

Per-Command Exit Codes

run

CodeWhen
0Prompt executed successfully
1Provider CLI returned non-zero exit code
2Provider not found or config invalid

run-batch

CodeWhen
0All prompts succeeded
1One or more prompts failed
2Configuration error

sweep

CodeWhen
0All iterations completed
1One or more iterations failed
2Configuration error
5Lock conflict (another sweep running)

orchestrate

CodeWhen
0Orchestration completed
1One or more steps/providers failed
2Configuration error

sync

CodeWhen
0Sync completed
1Sync failed (API error, write error)
3Authentication error

doctor

CodeWhen
0All checks passed
1One or more checks failed

validate

CodeWhen
0All files valid
4Validation errors found

Using Exit Codes in Scripts

prompts-gpt run review.md --provider codex
status=$?

case $status in
  0) echo "Success" ;;
  1) echo "Execution failed" ;;
  2) echo "Config error" ;;
  *) echo "Unknown error: $status" ;;
esac

See Also