The Mizu CLI uses specific exit codes to indicate different outcomes. Exit codes are numbers returned when a command finishes - 0 means success, anything else means something went wrong. These codes are essential for shell scripts and CI/CD pipelines that need to know if a command succeeded.
Exit Code Reference
Detailed Descriptions
Exit Code 0: Success
The operation completed successfully.
Exit Code 1: General Error
An error occurred during execution. Examples:
- File write failed
- Template rendering error
- Process failed to start
- Network error
Exit Code 2: Usage Error
Invalid command usage. Examples:
- Unknown command
- Missing required flag
- Invalid flag value
- Invalid arguments
Exit Code 3: No Project Found
Specific to mizu dev - couldn’t find a runnable main package.
Command-Specific Exit Codes
mizu new
mizu dev
mizu dev propagates exit codes from your application. If your app exits with code 5, mizu dev also exits with code 5.
mizu version
Using Exit Codes in Scripts
Check for Success
CI/CD Pipeline
Makefile
Error Messages
Exit codes are accompanied by error messages:
JSON Error Output
With --json, errors include structured information:
Best Practices
Always Check Exit Codes
Use set -e in Scripts
Handle Specific Codes
See Also