CLI Mode¶
Run a one-off code review on any pull request without deploying a webhook server. All you need is a platform token and the Claude Code CLI installed.
Billing
CLI mode uses the Claude Code CLI as its agent runner. It uses the authentication method configured on your Claude Code CLI, which means it can leverage Claude Pro and Claude Max subscriptions instead of paying per-token via the Anthropic API. For a lighter setup that only needs an API key (no CLI installation), see CI Mode.
Usage¶
The CLI resolves the PR branch, clones the repository, fetches the diff, runs the AI agent, and prints a structured review to stdout. By default it also posts the review to the PR.
Options¶
| Flag | Short | Default | Description |
|---|---|---|---|
pr_ref |
— | (required) | PR reference in owner/repo#number format |
--prompt |
-p |
— | Custom review instructions |
--platform |
— | github |
Platform type (github or gitlab) |
--model |
— | SDK default | Agent model override (e.g. claude-sonnet-4-6) |
--max-turns |
— | 0 (unlimited) |
Maximum agentic turns |
--dry-run |
— | false |
Print results to stdout without posting to the PR |
Examples¶
Dry Run with Custom Prompt¶
Model Override¶
Output¶
The CLI prints a structured review to stdout:
Summary: Found 2 issues in the authentication module.
Findings (2):
src/auth.py:42
The password hash comparison is not constant-time. Use hmac.compare_digest().
src/auth.py:58
Missing rate limiting on the login endpoint.
When --dry-run is not set, the review is also posted to the PR as native inline comments (on GitHub) or discussion notes (on GitLab).
What's Different¶
CLI mode is a one-shot command — no server, no conversation continuity. It does not require bot usernames or ALLOWED_USERS. See the mode comparison for a full breakdown.
For the complete list of environment variables, see Environment Variables.