warden init
Initialize a new Warden setup by creating configuration files, GitHub Actions workflow, and installing bundled skills.Usage
What It Creates
Theinit command sets up everything needed to run Warden:
warden.toml- Configuration file with severity thresholds and skill settings.github/workflows/warden.yml- GitHub Actions workflow for PR analysis.agents/skills/- Directory with bundled skills for AI agents.gitignore- Adds.warden/to ignore cache and logs.claude/skills- Symlink to.agents/skills/(if.claude/exists)
Options
Overwrite existing files without prompting
Suppress non-error output
Force color output on or off
Interactive Behavior
When run in an interactive terminal (TTY),init prompts before installing skills:
Y or Enter to install, n to skip.
Non-Interactive Mode
When stdin is not a TTY (CI/CD, scripts), skills are skipped by default:Generated Files
warden.toml
The configuration file includes:.github/workflows/warden.yml
The GitHub Actions workflow:Bundled Skills
The following skills are copied to.agents/skills/:
- security-review - Detects security vulnerabilities and unsafe patterns
- bug-detection - Finds logic errors and potential bugs
- Additional skills included with your Warden version
Exit Codes
Initialization completed successfully
- Not in a git repository
- Permission errors writing files
- Invalid configuration
Examples
Standard Initialization
Force Overwrite
Overwrite existing files without prompting:CI/CD Initialization
For automated setups, redirect stdin to force non-interactive mode:Next Steps
After runninginit, the command displays:
1. Add a Skill
Configure which skills run on your code:2. Configure API Key Locally
Create.env.local in your repository root:
Add
.env.local to .gitignore to avoid committing secrets. The init command already ignores .warden/ where logs are stored.3. Configure GitHub Secrets
Add the API key to your repository or organization secrets:- Go to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
WARDEN_ANTHROPIC_API_KEY - Value: Your Anthropic API key
WARDEN_MODEL- Override default model (e.g.,claude-sonnet-4.5)WARDEN_SENTRY_DSN- Enable error tracking
4. Test with a Pull Request
Commit the generated files and open a PR:Existing Files
If configuration files already exist,init skips them:
--force to overwrite:
Requirements
- Must run from a git repository (checks for
.git/) - Write permissions in the repository root
- For GitHub Actions workflow:
.github/workflows/directory will be created if needed
Related Commands
- warden add - Add skills to warden.toml
- warden - Run analysis
- warden setup-app - Create GitHub App for custom bot identity