Overview
The mainwarden command analyzes your code for issues using skills defined in warden.toml.
Usage
Targets
Specify what code to analyze. Defaults to uncommitted changes if no targets provided.Uncommitted changes (default)
- Unstaged changes (modified files)
- Staged changes (files added to git)
Specific files
Directories
Git diffs
Glob patterns
Quote glob patterns to prevent shell expansion.
Options
Analysis Control
—config, -c
Use a custom configuration file:warden.toml in repo root.
—skill
Run a specific skill only:—fail-on
Minimum severity to exit with failure code:off, high, medium, low
—report-on
Minimum severity to show in output:off, high, medium, low
—min-confidence
Minimum confidence level to show in output:off, high, medium, low
Default: medium
—max-findings
Limit number of findings reported:Output Control
—quiet, -q
Minimal output - only errors:—verbose
Show detailed progress:—debug
Show debug information:—json
Output findings as JSON:—output, -o
Write findings to JSONL file:—no-color
Disable colored output:Performance
—parallel, -p
Number of concurrent skill executions:—fail-fast, -x
Stop after first finding:—staged
Analyze only staged changes (git diff —cached):—git
Force ambiguous targets to be treated as git refs:—offline
Use cached remote skills without network access:—model, -m
Override model for all skills:Other
—help, -h
Show help:—version, -v
Show version:Exit Codes
| Code | Meaning |
|---|---|
0 | Success - no failures above threshold |
1 | Failure - findings exceed failOn threshold |
130 | User aborted (Ctrl+C) |
Examples
Analyze uncommitted changes
Analyze specific directory
Compare with main branch
Quiet mode for CI
JSON output
Verbose output
Environment Variables
ANTHROPIC_API_KEY
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:Tips
Analyze only changed files
Analyze only changed files
Use git diff syntax:
Run specific skill
Run specific skill
Use
--skill flag:Save findings for later
Save findings for later
Use
--output flag:Control failure threshold
Control failure threshold
Use
--fail-on flag:Related
Auto-fix
Apply suggested fixes automatically
Configuration
Configure skill behavior
Output formats
JSON, JSONL, and GitHub outputs
Troubleshooting
Common issues and solutions