Quickstart

Run your first review in five minutes.

Five-minute setup

With a model key in your shell, ocra init writes the configuration for you:

npm install -g @open-cr-agent/cli
export GEMINI_API_KEY="your-key"     # or ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY
cd your-repository
ocra init                            # writes .ocra/config.json and says what it chose
ocra review                          # review your uncommitted changes

For GitHub pull requests, ocra init --github also writes .github/workflows/ocra.yml, safe for forks, and prints the gh commands for the secret and the ocra-review label. It never replaces an existing file. See ocra init.

The steps below do the same by hand, with any provider OpenCode supports.

Install

Requires Node.js 22.19+ and Git:

npm install -g @open-cr-agent/cli
ocra --version

See Installation for npx and building from source. Measured quality shows what reviews find and miss.

Add a model key

Any provider OpenCode supports works (Model providers). For Google Gemini:

export GEMINI_API_KEY="your-key"

Keep keys in your shell profile or a secret store, never in a repository.

Choose models

Create .ocra/config.json in the repository you want to review:

{
  "models": {
    "top": "google/gemini-3.1-pro-preview",
    "standard": ["google/gemini-3.5-flash", "google/gemini-flash-lite-latest"],
    "light": "google/gemini-flash-lite-latest"
  }
}

standard models review code, light ones do cheap helper work such as grouping files, and top judges the findings. A list is a failback chain.

Review

cd your-repository
ocra review                  # uncommitted changes, including untracked files
ocra review --from main      # this branch since it diverged from main
ocra review --commit HEAD    # a single commit

ocra prints progress, then the verdict and a report by file. Each finding says whether verification confirmed it and has an id for ocra memory:

Review: Working tree changes
Risk tier: lite · 2 reviewed · 0 failed · 0 excluded
Verdict: approved with comments
  1 finding(s): 0 critical, 1 warning, 0 suggestion.

src/list.ts
  warning    L4        lastItems returns n + 1 items [verified] #3f9a1c2e
    slice(list.length - n - 1) starts one element too early.
    Suggestion: return list.slice(-n);

1 finding(s) (0 critical, 1 warning, 0 suggestion) · tokens: 8023 in (0 cached), 285 out, 0 reasoning · $0.0031
Session: .ocra/sessions/20260924T225539Z-aa9790

The exit code is 1 when verification confirmed a critical finding. Treat it as advice, not a security gate: the models read the change and can be misled by it. See Exit codes.

Edit on GitHub

On this page