This integration exposes OpenCodeReview as native tools and slash commands in OpenCode.
It registers:
ocr_review— review workspace changes, one commit, or a ref range and return structured JSON findings.ocr_health— show the installed OCR version and test its configured LLM connection./ocr-reviewand/ocr-health— convenient prompts that invoke the tools.
Existing user commands with either name are preserved.
Install and configure OpenCodeReview first:
npm install -g @alibaba-group/open-code-review
ocr config provider
ocr config model
ocr llm testmkdir -p ~/.config/opencode/plugins
curl -fsSL \
https://raw.githubusercontent.com/alibaba/open-code-review/main/plugins/open-code-review/opencode/open-code-review.ts \
-o ~/.config/opencode/plugins/open-code-review.tsRestart OpenCode after installation.
Run this from the project root:
mkdir -p .opencode/plugins
curl -fsSL \
https://raw.githubusercontent.com/alibaba/open-code-review/main/plugins/open-code-review/opencode/open-code-review.ts \
-o .opencode/plugins/open-code-review.tsCommit the plugin file if the integration should be shared with the project.
Use the registered commands:
/ocr-review current workspace; focus on authentication regressions
/ocr-review compare main to feature/auth-refresh
/ocr-health
Or ask OpenCode naturally:
Use ocr_review to review my current changes. The goal is to add rate limiting
without changing the public API.
Set preview to true to inspect which files would be reviewed without making
an LLM request.
- Reviews use
--audience agentand JSON output. - The process is launched with an argument array and
shell: false. - Reviews have a 15-minute overall timeout and a 10 MiB output limit.
- Cancelling the OpenCode tool terminates the OCR process.
- OCR credentials remain in the existing OCR configuration or environment.
- Workspace mode includes staged, unstaged, and untracked files.
cd plugins/open-code-review/opencode
npm install
npm run check