-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Problem
CLI currently uses generic exit codes. Agents and scripts can't distinguish between different failure modes.
Pattern from Go CLI Books
Standard Unix exit code conventions:
const (
ExitSuccess = 0 // Operation succeeded
ExitGenericError = 1 // Generic error
ExitMisuse = 2 // Wrong arguments, invalid flags
ExitDataError = 64 // Invalid input data format
ExitTimeout = 65 // Operation timed out
ExitIOError = 66 // Can't write to socket/file
ExitProtocolError = 67 // Invalid RPC response
ExitDaemonUnavailable = 69 // Daemon not running
ExitInternalError = 70 // Panic, unexpected condition
)Action Items
- Create
internal/types/exitcodes.gowith constants - Update all command handlers to use specific exit codes
- Document exit codes in README and --help output
- Add exit code to JSON error output
Book References
- Search:
pdf-brain search "exit code convention" --fts --expand 2000 - Search:
pdf-brain search "os.Exit error handling" --fts --expand 2000
Priority
P1 - Important for agentic workflows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels