Skip to main content
The cubic CLI brings a lightweight version of cubic’s AI code review directly into your terminal. It’s designed as a fast pre-flight check to catch issues before you push — not as a replacement for cubic’s full Cloud reviews. cubic catches bugs in your local changes and generates a context-rich prompt for you to paste into your AI IDE (like Cursor) to automatically fix them. It automatically syncs with your custom agents, past feedback, and repository settings from cubic cloud to ensure consistent reviews.

CLI vs Cloud reviews

The CLI and Cloud reviews serve complementary roles in your workflow:
CLICloud
When it runsLocally, before you pushAutomatically on every PR
SpeedFast (seconds)Thorough (minutes)
DepthLightweight checksFull codebase analysis
Best forQuick pre-flight validationComprehensive final review
Recommended workflow:
  1. Develop locally — Write your code as usual
  2. Run cubic review — Catch obvious issues before pushing
  3. Push and open a PR — Cloud review performs a comprehensive analysis
  4. Address Cloud feedback — Fix any remaining issues the CLI didn’t catch
Key Features:
  • Local Analysis: Catch bugs and security issues before you commit.
  • Context-aware: Uses your repository’s custom agents, learnings, and settings.
  • One-key Fixes: Generate prompts to fix issues instantly in your IDE.
  • Flexible Modes: Review uncommitted changes, branches, or specific commits.

Getting started

Install and launch the cubic CLI:
pnpm add -g @cubic-dev-ai/cli && cubic
After installation, type cubic to open the CLI and start a review. cubic CLI home screen showing review preset options

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` to catch bugs and improvements.
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 — your PR will be cleaner when it reaches cubic’s Cloud review for the final, comprehensive analysis.

Common Workflows

The CLI adapts to different stages of your development process. cubic CLI review results showing prioritized issues

1. Review Uncommitted Changes (Default)

Review code you are currently working on, before you commit.
cubic review

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.
cubic review [options]

Options

OptionAliasDescription
--json-jOutput results as JSON (for CI/automation)
--base [branch]-bReview against a base branch (PR-style). Auto-detects base if no branch specified
--commit <ref>-cReview a specific commit
--prompt <instructions>-pCustom review instructions
Note: --base, --commit, and --prompt are mutually exclusive.

Output Formats

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.
cubic review --json
{
  "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."
    }
  ]
}

Limitations

Usage is unlimited while the CLI is in alpha, subject to rate limits to ensure fair access for all users.