Universal AI gatekeeper for your codebase
A unified TypeScript CLI for building AI-assisted code review hooks with smart caching, multi-provider fallbacks, and AGENTS.md support.
$ npm install -g @ajosecortes/guardian-cliPROVIDER="claude"
FILE_PATTERNS="*.ts,*.tsx,*.js,*.jsx"
RULES_FILE="AGENTS.md"
STRICT_MODE="true"
CACHE="true"
$ git commit -m "add payment gateway"
[Guardian] Analyzing 3 staged files...
[Guardian] Cache hit for utils.ts
[Guardian] Reviewing api.ts with Claude...
STATUS: FAILED
Violation: Payment processing code lacks required try/catch error handling as specified in AGENTS.md rules.
Commit aborted due to strict mode.
5+
Providers
0ms
Cache Hits
100%
Local Hooks
The Git-native Review Toolkit
The open-source CLI designed to help teams enforce formatting, security, and logic rules on every commit using Claude, Gemini, OpenCode, Codex, or Antigravity.
Configurable providers.
Switch between Claude, Gemini, OpenCode, Codex, or Antigravity via a simple environment variable or dotfile configuration.
Content-based caching.
Fast execution. Guardian caches successful reviews via content hashes, entirely skipping unchanged files.
AGENTS.md driven.
Write instructions naturally in Markdown. Guardian extracts instructions and embeds them as system prompts.
- Ensure all APIs are documented
- Reject SQL injection vectors
CLI Core
Commands to initialize, install, run, uninstall, and manage cache — all with zero external dependencies.
Available Scripts
guardian run || exit 1
Loading config from .guardian...
Found 2 staged files matching *.ts
Requesting analysis from Claude...
Integrate quickly
Get Guardian running in your repository with a single guided command.
$ npm i -g @ajosecortes/guardian-cliQuick setup
One command, guided onboarding
guardian setup replaces running init + install separately. It walks you through provider selection, hook installation, and a final preview run so you can confirm everything works before your first commit.
guardian setupChoose the rules file name and provider: Claude, Gemini, OpenCode, Codex, or Antigravity.
Generate .guardian and AGENTS.md, then pick whether to install the hook in pre-commit or commit-msg.
Run a guardian run preview at the end. If .guardian already exists, Guardian detects it and asks whether you want to reconfigure.