2-Minute Setup Guide

Getting Started

From install to CI/CD integration in 5 steps. Set up your AI code quality gate today.

Prerequisites

  • Node.js 18+ Node 20 LTS recommended
  • npm / pnpm / yarn Any package manager
  • LLM API Key (for L3 scan) GLM is completely free; Ollama runs locally at zero cost
1

Install the CLI

One command to install the Open Code Review CLI globally.

shell
npm install -g @opencodereview/cli

Or run without installing: npx @opencodereview/cli@latest scan ./src

2

Choose Your LLM Provider

Set your API key as an environment variable. L1 scan needs no config; L3 deep scan requires an LLM.

GLM (Zhipu)Free
shell
export GLM_API_KEY=your-key-here
Ollama (Local)Free · Local
shell
export OLLAMA_BASE_URL=http://localhost:11434
OpenAIPaid
shell
export OPENAI_API_KEY=sk-...
DeepSeekLow Cost
shell
export DEEPSEEK_API_KEY=sk-...

8+ providers supported: GLM, OpenAI, Anthropic, DeepSeek, Ollama, Groq, Mistral, Google Gemini

3

Run Your First Scan

Scan your source code and get an AI code quality score.

shell
ocr scan ./src

Example output

┌─────────────────────────────────────┐
│  Open Code Review — Scan Results    │
├─────────────────────────────────────┤
│  Files scanned:    42               │
│  Issues found:     3                │
│  Quality score:    87/100  (B+)     │
│                                     │
│  ⚠ hallucinated-package  (2 files) │
│  ⚠ stale-api             (1 file)  │
└─────────────────────────────────────┘

Scan level options:

L1Fast (structural)ocr scan ./src --level l1
L2Standard (embedding)ocr scan ./src --level l2
L3Deep (LLM)ocr scan ./src --level l3
4

Auto-Heal Issues

OCR doesn't just report problems — it fixes them. One command, AI-generated patches.

shell
ocr heal ./src

Industry First: Detect & Heal

Other tools tell you what's wrong. OCR fixes it: replaces hallucinated packages, updates stale APIs, repairs logic gaps.

shell
# Heal + auto-commit in CI/CD
ocr heal ./src --auto-commit

# Review changes before applying
ocr heal ./src --dry-run
5

Add to CI/CD

Automatically scan on every PR and block low-quality code from merging.

GitHub Actions

yaml
# .github/workflows/ocr.yml
name: Code Quality Gate
on: [pull_request]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm install -g @opencodereview/cli
      - run: ocr scan ./src --level l3 --threshold 70
        env:
          GLM_API_KEY: ${{ secrets.GLM_API_KEY }}

GitLab CI

yaml
# .gitlab-ci.yml
code-review:
  stage: test
  image: node:20-slim
  script:
    - npm install -g @opencodereview/cli
    - ocr scan ./src --level l3 --threshold 70
  variables:
    GLM_API_KEY: $GLM_API_KEY

Frequently Asked Questions