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
Install the CLI
One command to install the Open Code Review CLI globally.
npm install -g @opencodereview/cli
Or run without installing: npx @opencodereview/cli@latest scan ./src
Choose Your LLM Provider
Set your API key as an environment variable. L1 scan needs no config; L3 deep scan requires an LLM.
export GLM_API_KEY=your-key-here
export OLLAMA_BASE_URL=http://localhost:11434
export OPENAI_API_KEY=sk-...
export DEEPSEEK_API_KEY=sk-...
8+ providers supported: GLM, OpenAI, Anthropic, DeepSeek, Ollama, Groq, Mistral, Google Gemini
Run Your First Scan
Scan your source code and get an AI code quality score.
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:
ocr scan ./src --level l1ocr scan ./src --level l2ocr scan ./src --level l3Auto-Heal Issues
OCR doesn't just report problems — it fixes them. One command, AI-generated patches.
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.
# Heal + auto-commit in CI/CD ocr heal ./src --auto-commit # Review changes before applying ocr heal ./src --dry-run
Add to CI/CD
Automatically scan on every PR and block low-quality code from merging.
GitHub Actions
# .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
# .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