Quick Start
Follow these steps to quickly run a code review with the bot.
Installation
composer install
Analyze an existing diff
- Create or use a unified diff (e.g.,
examples/sample.diff
). - 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
- Set
vcs.platform
in.aicodereview.yml
(github, gitlab, or bitbucket) and provide the required identifiers/tokens. - 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.