Exit Codes Reference
Exit codes returned by prompts-gpt CLI commands.
Standard Exit Codes
| Code | Meaning | Description |
|---|
0 | Success | Command completed successfully |
1 | Execution failure | Prompt execution or sweep failed |
2 | Configuration error | Missing or invalid config, missing provider |
3 | Authentication error | Invalid or missing token |
4 | Validation error | Invalid prompt file or frontmatter |
5 | Lock conflict | Sweep lock already held |
Per-Command Exit Codes
run
| Code | When |
|---|
0 | Prompt executed successfully |
1 | Provider CLI returned non-zero exit code |
2 | Provider not found or config invalid |
run-batch
| Code | When |
|---|
0 | All prompts succeeded |
1 | One or more prompts failed |
2 | Configuration error |
sweep
| Code | When |
|---|
0 | All iterations completed |
1 | One or more iterations failed |
2 | Configuration error |
5 | Lock conflict (another sweep running) |
orchestrate
| Code | When |
|---|
0 | Orchestration completed |
1 | One or more steps/providers failed |
2 | Configuration error |
sync
| Code | When |
|---|
0 | Sync completed |
1 | Sync failed (API error, write error) |
3 | Authentication error |
doctor
| Code | When |
|---|
0 | All checks passed |
1 | One or more checks failed |
validate
| Code | When |
|---|
0 | All files valid |
4 | Validation 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