Open Code Review
Run AI code reviews with the ocr CLI on Nebul models through a custom OpenAI-compatible provider.
Open Code Review (ocr) is an AI code review CLI, open-sourced from Alibaba's internal review assistant. It reads Git diffs, gives an agent tool access to your codebase for context, and produces structured line-level review comments. You configure an LLM for it, and any OpenAI-compatible endpoint works, including Nebul.
Prerequisites
- Git 2.41 or later
- Node.js for the npm install
- A Nebul AI Studio account with API access
- An API key for your active project
- A model ID from the Model Catalog
Installation
npm install -g @alibaba-group/open-code-reviewAfter installation the ocr command is available globally. For install scripts, release binaries, and building from source, see the project README.
Configure Nebul
ocr config provider opens an interactive setup that walks through provider selection, API key entry, and model configuration, then tests connectivity against the endpoint:
- Run the config command in any repository:
ocr config provider- Choose to add a custom provider rather than a built-in one.
- Enter the Nebul base URL:
https://api.inference.nebul.io/v1. - Enter your Nebul API key from AI Studio.
- Pick a model for the provider, for example
zai-org/GLM-5.3.
The setup finishes with a connectivity test. If it passes, the provider and model are saved. Pick a model that supports tool calling, because the review agent uses OpenAI-native tools to read files and search the codebase. See Function Calling & Tools.
To change the model later without redoing the provider:
ocr config modelRun a review
From the repository you want reviewed:
# Review all staged, unstaged, and untracked changes
ocr review
# Review a feature branch's changes since it diverged from main
ocr review --from main --to feature-branch
# Review a single commit
ocr review --commit abc123ocr scan reviews whole files instead of a diff, for auditing unfamiliar code:
ocr scan
ocr scan --path internal/agentFor programmatic use, save the result as JSON:
ocr review --format json --output result.jsonThe review agent sends the changed files, plus whatever context it reads with its tools, to the model you configured. Usage appears under the API key's project in AI Studio.
Already running a coding agent on Nebul?
Delegation mode (ocr delegate) has the review run inside your coding agent using the agent's own LLM, so OCR needs no API key of its own. Plugins exist for Claude Code, Codex, Cursor, Kimi Code, and OpenCode; see the README.
Troubleshooting
- Connectivity test fails with 401: the API key is wrong, revoked, or from a different project. Create a fresh key in AI Studio.
- Connectivity test fails with 404: the base URL must be
https://api.inference.nebul.io/v1, with the/v1suffix. - Model not found: use the exact model ID from the Model Catalog. Only models enabled for your project work.
- Reviews time out or stall: reviews read a lot of context through tool calls. A model with a large context window, such as
zai-org/GLM-5.3with 1M tokens, keeps long reviews in one pass.
Data and telemetry
Open Code Review sends the diffs and files it reviews to the LLM provider you configure, which after this setup is Nebul. The project documents no separate anonymous telemetry channel; its observability integration is opt-in OpenTelemetry. See the repository for current details.
For how Nebul treats the requests it receives, see Privacy & Security.