AI Code Review Bot

Quick Start

Follow these steps to quickly run a code review with the bot.

Installation

composer install

Analyze an existing diff

  1. Create or use a unified diff (e.g., examples/sample.diff).
  2. Run:
php bin/aicr review --diff-file examples/sample.diff --output summary
php bin/aicr review --diff-file examples/sample.diff --output json
php bin/aicr review --diff-file examples/sample.diff --output summary --provider openai

Analyze a PR/MR using git

  1. Set vcs.platform in .aicodereview.yml (github, gitlab, or bitbucket) and provide the required identifiers/tokens.
  2. Then run:
php bin/aicr review --id 123 --output summary
php bin/aicr review --id 123 --output summary --provider gemini

Without --diff-file, the command resolves base/head branches from the ID, runs git fetch, computes git diff base...head, and analyzes the result.

Automatic comments on PR/MR

php bin/aicr review --id 123 --output summary --comment
php bin/aicr review --id 123 --output summary --comment --provider anthropic

This will post a summary directly to the PR/MR via the configured adapter.

Safe default: the default AI provider is mock, so no network calls will be made until you configure a real provider.