Commands
Warden provides several commands for different workflows:warden
Main command - analyze code for issues
warden init
Initialize Warden in your repository
warden --fix
Apply suggested fixes automatically
warden logs
Manage analysis logs and history
warden add
Add skills to your configuration
warden sync
Update remote skill definitions
warden setup-app
Configure GitHub App integration
Common Patterns
Analyze uncommitted changes
The most common workflow - analyze files you’ve modified:- Unstaged changes (modified files not added to git)
- Staged changes (files added but not committed)
Analyze specific files
Target specific files or directories:Analyze git diffs
Compare branches or commits:Apply fixes automatically
Review and apply suggested fixes:Control output verbosity
Adjust how much Warden prints:Output formats
Export findings in different formats:Global Options
These options work with all commands:—help, -h
Show help for any command:—version, -v
Show the installed version:—config
Use a custom config file:warden.toml in the repo root.
—no-color
Disable colored output:Exit Codes
Warden uses these exit codes:| Code | Meaning |
|---|---|
0 | Success - no failures above threshold |
1 | Failure - findings exceed failOn threshold |
130 | User aborted (Ctrl+C) |
Environment Variables
ANTHROPIC_API_KEY
Anthropic API key for authentication:WARDEN_ANTHROPIC_API_KEY
Warden-specific API key (takes precedence):GITHUB_TOKEN
GitHub token for API access:NO_COLOR
Disable colored output:WARDEN_LOG_LEVEL
Set the log level:quiet, normal, verbose, debug
Configuration File
The CLI reads configuration fromwarden.toml in your repository root. You can specify a different path with --config:
Shell Completion
Warden doesn’t currently provide built-in shell completion, but you can create aliases for common workflows:.bashrc
CI/CD Integration
GitHub Actions
Use the official action:GitLab CI
Run as a regular CLI command:Jenkins
Run in a shell step:CircleCI
Add to your config:Best Practices
Run Warden before committing
Run Warden before committing
Add Warden to your pre-commit hook to catch issues early:
.husky/pre-commit
Use different configs for local vs CI
Use different configs for local vs CI
Local development can be lenient, CI can be strict:
Cache analysis logs
Cache analysis logs
Save logs for later review:Then review with
warden logs show.Use targets to focus analysis
Use targets to focus analysis
Don’t analyze everything - focus on changed files:
Next Steps
Main command
Learn all options for the main warden command
Initialize
Set up Warden in your repository
Auto-fix
Apply suggested fixes automatically
Configuration
Configure Warden’s behavior