Exit Codes¶
janito returns standard exit codes for scripting and automation.
Exit Code Reference¶
| Code | Name | Description |
|---|---|---|
0 |
Success | The command completed successfully |
1 |
General Error | Configuration or runtime error |
130 |
Interrupted | User cancelled with Ctrl+C |
Detailed Explanations¶
0 - Success¶
The command completed successfully with no errors.
1 - General Error¶
An error occurred during execution. Common causes:
- Invalid configuration
- Missing API key
- API authentication failure
- Network connectivity issues
- Invalid arguments
- File operation errors
- Tool execution errors
130 - Interrupted (Ctrl+C)¶
The user cancelled the operation by pressing Ctrl+C. This is a standard Unix-style interrupt code.
Checking Exit Codes¶
Bash¶
PowerShell¶
Scripting Example¶
#!/bin/bash
janito "Your prompt"
if [ $? -eq 0 ]; then
echo "Success!"
else
echo "Failed with exit code: $?"
fi
Error Handling Tips¶
- Always check exit codes in scripts
- Enable logging with
--log=debugto diagnose errors - Verify configuration with
--show-configbefore running - Test connectivity to API endpoints separately