pi-open-code-review
v0.1.5
Published
BTKS Pi package for running Alibaba Open Code Review with a skill and slash command.
Maintainers
Readme
BTKS Pi Open Code Review
BTKS Pi package for running Alibaba Open Code Review from Pi with the same operating model as the Claude Code and Codex integrations.
OCR remains the review engine. Pi provides:
- an
open-code-reviewskill for natural language review requests, - one slash command,
/ocr, for explicit review, fix, and scan workflows.
Prerequisites
The /ocr command checks for the official OCR CLI before each run. If ocr is missing, it attempts to install it with:
npm install -g @alibaba-group/open-code-reviewOCR still needs its own LLM configuration before review can run:
ocr llm testOCR uses its own LLM configuration. Installing this Pi package does not configure API keys and does not change Pi's model provider.
Install
From npm:
pi install npm:pi-open-code-reviewFor local development from this checkout:
pi install D:\workspace\pi\pi-open-code-reviewFor a single trial run without adding it to settings:
pi -e D:\workspace\pi\pi-open-code-reviewUsage
Slash command:
/ocr 帮我review一下还没提交的这些代码
/ocr 帮我review src/auth 代码,重点看安全问题
/ocr review
/ocr review --from main --to feature-branch
/ocr review --commit abc123
/ocr fix --from main --to feature-branch
/ocr scan --path src/ocr is the only package-provided slash command. It supports both natural-language requests and precise OCR subcommands. review, fix, and scan are subcommands that map to OCR workflows rather than separate Pi commands.
Natural-language /ocr input is routed back to the Pi agent with the open-code-review skill, so the model can decide whether to run a workspace review, full-file scan, commit review, branch comparison, or fix workflow:
/ocr 帮我review一下还没提交的这些代码
/ocr 看一下 src/auth 这块代码有没有安全问题
/ocr review一下这个分支和main相比的改动Precise mode is still available when the text starts with review, fix, scan, or a flag such as --commit.
Natural language requests that mirror the Codex plugin:
Use Open Code Review to review my current changes.
Use Open Code Review to review this branch against main.
Use Open Code Review to review and fix high-confidence issues.The extension executes OCR with machine-readable output:
ocr review --format json --audience agentFor scan mode:
ocr scan --format json --audience agentBehavior
- Default review checks staged, unstaged, and untracked workspace changes, matching OCR CLI behavior.
- If
ocris missing,/ocrattempts to install the official@alibaba-group/open-code-reviewCLI, matching the Codex plugin flow. - Before review,
/ocrrunsocr llm testand stops with setup guidance if OCR's model provider is not configured. /ocr fixmeans review first, then ask Pi to fix precise High and Medium findings./ocr review --previewand/ocr scan --previewdisplay OCR's text preview output instead of requiring JSON./ocr reviewnever edits files unless the user explicitly asks for fixing./ocr <natural language request>asks the Pi agent to interpret the request with theopen-code-reviewskill instead of parsing it as OCR flags.- Low-confidence findings are filtered out by the skill rules unless the user asks for all comments.
- The package forwards a conservative allowlist of OCR flags to avoid accidental shell behavior.
Pi Package Gallery
Pi's package gallery at https://pi.dev/packages lists public npm packages tagged with the pi-package keyword. This package includes that keyword and this Pi manifest:
"pi": {
"extensions": ["./extensions/open-code-review.js"],
"skills": ["./skills"],
"image": "https://raw.githubusercontent.com/alibaba/open-code-review/main/imgs/highlights-en.png"
}The gallery may lag behind npm's download API. If npm shows downloads but Pi shows 0 or not available, treat npm as the source of truth and wait for Pi indexing or report the package from the Pi package page.
Development
npm test
npm run test:pi
npm run pack:checkThe core command-building logic is in extensions/open-code-review-core.mjs. The Pi command entrypoint is extensions/open-code-review.js.
