Skip to main content
This guide walks you through installing GGA, configuring it for your project, and making your first reviewed commit.

Prerequisites

  • Bash 5.0 or later (macOS, Linux, Windows Git Bash, or WSL)
  • Git repository
  • At least one supported AI provider installed (see step 3)
1

Install GGA

Verify the installation:
gga version
2

Initialize your project config

Navigate to your project root and run:
cd ~/your-project
gga init
This creates a .gga config file with all available options and their defaults:
# Gentleman Guardian Angel Configuration

# AI Provider (required)
# Options: claude, gemini, codex, opencode, ollama:<model>, lmstudio[:model], github:<model>
PROVIDER="claude"

# File patterns to include in review (comma-separated)
FILE_PATTERNS="*.ts,*.tsx,*.js,*.jsx"

# File patterns to exclude from review (comma-separated)
EXCLUDE_PATTERNS="*.test.ts,*.spec.ts,*.test.tsx,*.spec.tsx,*.d.ts"

# File containing code review rules
RULES_FILE="AGENTS.md"

# Strict mode: fail if AI response is ambiguous
STRICT_MODE="true"

# Timeout in seconds for AI provider response
TIMEOUT="300"
3

Set your AI provider

Open .gga and set PROVIDER to the AI tool you have installed:
ProviderConfig valueNotes
ClaudeclaudeRequires claude CLI
GeminigeminiRequires gemini CLI
Codexcodexnpm i -g @openai/codex
OpenCodeopencodeRequires opencode CLI
Ollamaollama:llama3.2Replace with your model name
LM StudiolmstudioOr lmstudio:model-name
GitHub Modelsgithub:gpt-4oReplace with your model name
For example, to use a local Ollama model:
PROVIDER="ollama:llama3.2"
See the Providers page for detailed setup instructions for each provider.
4

Create your AGENTS.md

Create an AGENTS.md file in your project root with the coding standards you want enforced. This file is the only input to the AI reviewer — write it clearly.Here is a minimal example:
# Code Review Rules

## TypeScript
- Use `const` or `let`. Never use `var`.
- Prefer interfaces over type aliases for object shapes.
- No `any` types. Use `unknown` and narrow with type guards.
- All functions must have explicit return type annotations.

## React
- Use functional components only. No class components.
- Use named exports. No default exports.
- Keep components under 150 lines. Extract logic into custom hooks.

## General
- No `console.log` in committed code. Use a logger.
- No commented-out code blocks.
- Every new function needs a JSDoc comment.
The more specific your rules, the more accurate the review. Vague rules like “write clean code” produce inconsistent results. See Writing your rules file for best practices.
5

Install the pre-commit hook

gga install
This adds GGA to your repo’s .git/hooks/pre-commit file. If a pre-commit hook already exists, GGA is appended to it safely — existing hooks are not overwritten.To install the commit-msg hook variant instead (which also validates the commit message):
gga install --commit-msg
6

Make a commit

Stage your files and commit as normal:
git add src/component.tsx
git commit -m "add user profile component"
GGA runs automatically. You will see output like this on a passing review:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Gentleman Guardian Angel v2.8.0
  Provider-agnostic code review using AI
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ️  Provider: claude
ℹ️  Rules file: AGENTS.md
ℹ️  File patterns: *.ts,*.tsx,*.js,*.jsx
ℹ️  Cache: enabled

Files to review:
  - src/component.tsx

ℹ️  Sending to claude for review (timeout: 300s)...

STATUS: PASSED

All files comply with the coding standards.

✅ CODE REVIEW PASSED
On a failing review, the commit is blocked:
STATUS: FAILED

Violations found:

- src/component.tsx, line 12
  Rule: No `any` types
  Issue: Parameter `data` is typed as `any`. Use a specific interface or `unknown`.

- src/component.tsx, line 34
  Rule: Named exports only
  Issue: Component uses a default export. Change to a named export.

❌ CODE REVIEW FAILED

Fix the violations listed above before committing.

Bypassing the review

When you need to commit without a review — for example, a work-in-progress checkpoint or a documentation-only change — use Git’s built-in bypass flag:
git commit --no-verify -m "wip: rough draft"
Use --no-verify sparingly. It bypasses all Git hooks, not just GGA. Reserve it for situations where you intentionally want to skip automated checks.

Next steps

Configuration

Explore all .gga config options: file patterns, timeouts, strict mode, and global config.

Providers

Detailed setup instructions for Claude, Gemini, Ollama, GitHub Models, and more.

How it works

Understand the full commit flow, prompt structure, caching, and pass/fail logic.

Command reference

Every GGA command and flag, with examples.

Build docs developers (and LLMs) love