# Warden CLI The Warden CLI is the command-line interface for [[Warden]], [[Sentry]]'s AI-powered code review tool. It runs skills against code changes locally and is the same binary used inside Warden's GitHub Action. Distributed as `@sentry/warden` on npm. ## Core Commands | Command | Purpose | |---|---| | `warden` | Review current branch changes against the default branch | | `warden init` | Scaffold `warden.toml` and the GitHub Actions workflow | | `warden add` | Install a skill — local path or remote (`--remote owner/repo --skill name`) | | `warden sync` | Update cached remote skills to their latest versions | | `warden setup-app` | Create a custom GitHub App for the Warden bot identity | ## Useful Flags - `--staged` — only review uncommitted/staged changes (handy pre-commit) - `--skill <name-or-path>` — target a specific skill rather than the configured set - `--fix` — interactively apply suggested corrections - `--json` — machine-readable output for piping or hooks - `--fail-on <level>` — set exit code based on severity (`critical`, `high`, `medium`, `low`, `info`, `off`) - `--parallel <n>` — concurrent skill executions (default: 4) - `--offline` — use only cached skills, skip remote fetches - `--verbose` / `--debug` — extra diagnostics ## Skill Resolution Order 1. Remote repositories (cached, with TTL — default 24h for unpinned refs) 2. Direct paths passed via `--skill` 3. Conventional local directories: `.agents/skills/` then `.claude/skills/` The conventional directories are the same ones [[Claude Code Skills]] and other [[AI Agent Skills]]-spec runners use, so a skill written for one runner is reusable elsewhere. ## Authentication - **Local development**: `claude login` (uses [[Claude Code]] subscription) — no separate key needed - **API key fallback**: `WARDEN_ANTHROPIC_API_KEY` (preferred) or `ANTHROPIC_API_KEY` - **CI/CD**: must use `WARDEN_ANTHROPIC_API_KEY` set as a repository or organization secret ## Typical Pre-Commit Loop ```bash # work on a branch, stage your changes git add -p warden --staged --fix # review and auto-apply suggested fixes git add -p && git commit # commit clean code ``` This collapses what would otherwise be commit → push → CI feedback → fix → recommit into a single local pass. ## References - https://warden.sentry.dev/cli - https://warden.sentry.dev/guide - https://github.com/getsentry/warden ## Related - [[Warden]] - [[Sentry]] - [[Claude Code]] - [[Claude Code Skills]] - [[AI Agent Skills]] - [[AI Skill Portability]]