New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

open-code-review-alibaba

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

open-code-review-alibaba

OpenCodeReview CLI — AI-powered code review tool

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

OpenCodeReview CLI

AI-powered code review tool that reads Git diffs, sends changed files to a configurable LLM via OpenAI-compatible API, and generates structured review comments. It goes beyond surface-level analysis — the Agent can read project context for deep reviews.

Install

npm install -g @alibaba/open-code-review

After installation, the ocr command is available globally.

Version Control

# Install specific version
OCR_VERSION=v1.0.0 npm install -g @alibaba/open-code-review

Prerequisites

You must configure an LLM provider before using ocr. The tool requires access to an OpenAI-compatible API endpoint (OpenAI, Claude, local models, etc.).

ocr config set llm.url https://api.anthropic.com/v1/messages \
    && ocr config set llm.auth_token {{your-api-key}} \
    && ocr config set llm.model claude-opus-4-6 \
    && ocr config set llm.use_anthropic true  \
    && ocr config set language Chinese

Config is stored in ~/.open-code-review/config.json.

Or via environment variables:

export OCR_LLM_URL=https://api.anthropic.com/v1/messages
export OCR_LLM_TOKEN=your-api-key
export OCR_LLM_MODEL=claude-opus-4-6

Test Connectivity

ocr llm test

Quick Start

Navigate to any Git repository and run:

# Review all workspace changes
ocr review

# Review diff between two branches
ocr review --from main --to feature-branch

# Review a single commit
ocr review --commit abc123

Commands

CommandDescription
ocr review / ocr rStart code review
ocr config set <key> <value>Manage configuration
ocr llm testTest LLM connectivity
ocr viewerStart WebUI session viewer
ocr versionShow version info

Common Options

FlagShorthandDefaultDescription
--repocurrent dirGit repository root
--fromSource ref (e.g., main)
--toTarget ref (e.g., feature-branch)
--commit-cReview a single commit
--format-ftextOutput format: text or json
--concurrency4Max concurrent file reviews
--timeout10Per-file timeout (minutes)

Features

  • Three review modes: workspace changes, branch range, single commit
  • Context-aware: Agent reads arbitrary files, searches code via git grep, inspects diffs
  • Plan phase: Large changes (>50 lines) get risk analysis first
  • Any LLM: Works with OpenAI, Claude-compatible endpoints, local models
  • Concurrent: Files reviewed in parallel (configurable workers)

License

Apache-2.0

FAQs

Package last updated on 21 May 2026

Related posts