CLI
The CLI entry point is bin/aicr and exposes a single command: review.
review
php bin/aicr review [--diff-file FILE | --id ID] [--output json|summary|markdown] [--provider PROVIDER] [--comment] [--config FILE]
Options
--diff-file FILE– analyze a unified diff from file--id ID– analyze a PR/MR by ID using the configured VCS adapter--output–json(default),summary, ormarkdown--provider PROVIDER– override the default AI provider (e.g., openai, gemini, anthropic, ollama, mock)--comment– post the summary to the PR/MR using the adapter--config FILE– use a specific config file instead of.aicodereview.yml
Examples
# Analyze an existing diff and print a human summary
php bin/aicr review --diff-file examples/sample.diff --output summary
# Analyze a PR by number (GitHub) or MR IID (GitLab) and print JSON
php bin/aicr review --id 123 --output json
# Analyze an MR and post a comment using OpenAI provider
php bin/aicr review --id 456 --output summary --comment --provider openai
# Use a custom config file with Gemini provider
php bin/aicr review --id 123 --config examples/config.github.yml --output summary --provider gemini
# Analyze diff with Anthropic provider and markdown output
php bin/aicr review --diff-file examples/sample.diff --output markdown --provider anthropic
