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. 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 automatically syncs with your custom agents, past feedback, and repository settings from cubic cloud to ensure consistent reviews. 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 -fsSL https://cubic.dev/install | bash

npm / pnpm

npm install -g @cubic-dev-ai/cli
# or
pnpm add -g @cubic-dev-ai/cli
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.