The cubic CLI runs a lightweight version of cubic’s AI code review directly into your terminal. It’s designed as a fast pre-flight check before you push, not a replacement for cubic’s cloud PR review.
The CLI detects bugs in your local changes and generates a prompt for you to paste into your AI IDE (like Cursor) to automatically fix them. It syncs with supported cubic cloud context such as your custom agents, past feedback, and repository settings, but it does not use the same models or review pipeline as cubic’s cloud PR review.
Do not expect identical results between cubic review and cubic’s cloud PR reviews. The CLI is
intentionally faster and less thorough for local iteration, while cloud PR reviews are more thorough
and may find issues that the CLI did not flag.
CLI usage shows up in your analytics dashboard as CLI sessions so you can track adoption across your team.
Getting started
Install the cubic CLI using one of the following methods:
curl (recommended)
curl -fsSL https://cubic.dev/install | bash
npx
npx @cubic-dev-ai/cli install -g
After installation, type cubic to open the CLI and start a review.
Authentication
The first time you run cubic, it will automatically open your browser to sign in with your cubic.dev account. Once authenticated, you’re all set — no extra steps needed.
If you run into any authentication issues, press Ctrl+L to log out and re-authenticate.
Using with AI coding assistants
Add the following to your CLAUDE.md, AGENTS.md, or .cursorrules to have your AI coding assistant run cubic as a pre-flight check:
## Code Review
Before committing, run `cubic review` as a fast local pre-flight check.
Treat it as a less thorough pass than cubic's cloud PR review: a PR review may still find additional issues.
Wait 2-3 minutes for the review to complete, then validate the issues found and fix them.
This integrates cubic into your AI assistant’s workflow as a local quality gate. Issues caught here save tokens and iteration time, but the CLI is still only the fast first pass. Your PR should still go through cubic’s cloud review, which uses the more thorough review path.
Common Workflows
The CLI adapts to different stages of your development process.
1. Review Uncommitted Changes (Default)
Review code you are currently working on, before you commit.
2. Review a Pull Request (Branch Review)
Compare your current branch against a base branch (e.g., main) to catch issues before opening a PR.
# Auto-detect base branch
cubic review --base
# Explicit base branch
cubic review --base main
3. Review a Specific Commit
Analyze changes introduced by a specific commit hash or reference.
cubic review --commit HEAD~1
4. Custom Instructions
Focus the review on specific concerns like security or performance.
cubic review --prompt "check for XSS vulnerabilities"
Command Reference
The primary command is cubic review.
Options
| Option | Alias | Description |
|---|
--json | -j | Output results as JSON (for CI/automation) |
--base [branch] | -b | Review against a base branch (PR-style). Auto-detects base if no branch specified |
--commit <ref> | -c | Review a specific commit |
--prompt <instructions> | -p | Custom review instructions |
Note: --base, --commit, and --prompt are mutually exclusive.
Text Output (Default)
Human-readable output with colored priority labels, designed for interactive use.
[P0] src/api/auth.ts:45
SQL injection vulnerability in user lookup
User input is concatenated directly into SQL query without parameterization.
JSON Output
Structured output for tools and automation.
{
"issues": [
{
"priority": "P0",
"file": "src/api/auth.ts",
"line": 45,
"title": "SQL injection vulnerability in user lookup",
"description": "User input is concatenated directly into SQL query without parameterization."
}
]
}
AI attribution tracking
The cubic CLI installs git-ai during setup to tag AI-assisted commits with git notes. These notes power the AI coding analytics dashboard for tool usage and authorship trends.
Attribution tracking is enabled by default. git-ai shows a brief AI vs human authorship summary after each commit.
Opting out at install time
Set the CUBIC_DISABLE_GIT_AI environment variable to skip git-ai during installation:
# curl
CUBIC_DISABLE_GIT_AI=true curl -fsSL https://cubic.dev/install | bash
# npx
CUBIC_DISABLE_GIT_AI=true npx @cubic-dev-ai/cli install -g
Managing tracking after installation
Use cubic stats to enable, disable, or check the status of AI attribution tracking at any time:
# Check current status
cubic stats status
# Disable tracking
cubic stats disable
# Re-enable tracking
cubic stats enable
cubic stats disable removes git-ai hooks and persists your preference so future upgrades will not re-enable it. cubic stats enable re-installs git-ai and clears the opt-out flag.
Limitations
Usage is unlimited while the CLI is in alpha, subject to rate limits to ensure fair access for all users.
Because the CLI is optimized for speed and local iteration, it is less thorough than cubic’s cloud PR reviews. If you need the most complete review, open or update a PR and rely on the cloud review as the source of truth.