Installation
Install guardian-cli globally to enable AI-assisted code reviews on any Git repository on your machine.
Requirements
Before installing Guardian, make sure your environment meets these prerequisites.
- Node.js >= 22
- A Git repository to protect
- At least one supported provider CLI installed and authenticated
Global Installation
The recommended way to install Guardian is globally via npm. This makes the guardian command available system-wide.
$ npm install -g @ajosecortes/guardian-cli
Verify the installation
Confirm the CLI is available by running:
$ guardian --help
Provider CLIs
Guardian does not call AI APIs directly — it shells out to an installed provider CLI. You must have at least one of the following installed and authenticated before using Guardian.
| Provider | CLI name | Install |
|---|---|---|
| Claude | claude | See anthropic.com/claude-code |
| Gemini | gemini | See ai.google.dev/gemini-api/docs |
| OpenCode | opencode | See opencode.ai |
| Codex | codex | See developers.openai.com/codex/quickstart |
| Antigravity | antigravity | See npmjs.com/package/antigravity-cli |
Guardian will fail at runtime if the configured provider CLI is not found in PATH.
Local Development
To build from source or contribute to Guardian, clone the repository and install dependencies.
$ git clone https://github.com/JoseCortezz25/guardian.git
$ cd guardian
$ npm install
$ npm run build
Available scripts
| Script | Description |
|---|---|
| npm run build | Compile TypeScript to dist/ |
| npm test | Run the test suite |
| npm run test:watch | Run tests in watch mode |
| npm run lint | Run ESLint |
| npm run format | Format with Prettier |