@nk070281sjv/cli
v3.0.3
Published
CLI for Open Code Review - Multi-environment setup and progress tracking
Downloads
2,534
Maintainers
Readme
@open-code-review/cli
Command-line interface for Open Code Review — OpenCode-only setup, process-agent review execution, real-time progress tracking, and environment health checks.
Quick Start
Requires Node.js >= 22.5 — OCR's storage engine is Node's built-in SQLite (node:sqlite), so there's no native module to compile and it installs cleanly under any package manager (npm, pnpm 10+, yarn).
# 1. Install globally
npm install -g @open-code-review/cli
# 2. Initialize in your project
cd your-project
ocr initocr init configures OCR for OpenCode. Then run a review from OpenCode:
/ocr:review
/ocr-review against spec.md # With requirements context
/ocr-review --team architect:1,java-spring-engineer:1 # Custom team composition
/ocr-review --reviewer "Focus on error handling" # Add an ephemeral reviewer
/ocr-map # Code Review Map for large changesetsRun ocr doctor to verify your setup at any time.
Reviewer Library
OCR ships with 7 reviewer personas focused on backend service review: Architect, Database Administrator, Integration API Contract Engineer, Java Spring Engineer, Performance, QA Test Engineer, and Security Engineer.
Add ephemeral one-off reviewers with --reviewer, or create persistent custom reviewers with /ocr:create-reviewer.
Multi-Model Teams
Different reviewers can run on different models. Pair a fast generalist with a deeper specialist, or mix vendors across a single team:
# .ocr/config.yaml
models:
aliases:
workhorse: claude-sonnet-4-6
big-brain: claude-opus-4-7
default: claude-sonnet-4-6
default_team:
architect: # per-instance models
- { model: big-brain }
- { model: workhorse, name: architect-balanced }
security-engineer: { count: 1, model: big-brain } # one model, multiple instances
java-spring-engineer: 2 # default model
pipeline_agents:
aggregation: { model: big-brain }
validation: { model: big-brain }
synthesis: { model: big-brain }
translation_uk: { model: big-brain }Override per-review via --team on the CLI. OCR can list the models your installed OpenCode runtime exposes.
OpenCode reviews use ocr review run-agents internally. The CLI starts every
resolved reviewer process, writes exact prompt snapshots under
rounds/round-{n}/prompts/, writes reviewer stdout under reviews/, and then
runs aggregation, validation, and synthesis as separate process agents.
After final.md is written, it runs translation_uk and writes final.uk.md
as a Ukrainian human-readable copy; translation failure is logged without
invalidating the completed English review.
If any configured reviewer or pipeline model is missing or any process fails,
the round stops instead of continuing with a partial team or fabricated output.
For normal OpenCode use, run ocr review run-agents --fresh without
--background; the command keeps the shell call active, prints progress, and
returns only when the review is completed or failed.
If a parent tool regains control while the review is still running, use
ocr review wait --session-id <id> to block until completion instead of
returning a mid-run summary.
Commands
ocr init
Initialize Open Code Review in your project. Creates .ocr/ with skills, commands, and config, then configures OpenCode integration.
ocr init
ocr init --tools opencodeocr progress
Watch a review or map session in real-time. Shows current phase, elapsed time, reviewer status, finding counts, and completion percentage.
ocr progress # Auto-detect current session
ocr progress --session 2026-01-26-main # Specific sessionocr doctor
Verify your OCR installation and all dependencies.
ocr doctorChecks: git, opencode, gh (GitHub CLI), .ocr/ setup, and capabilities.
ocr update
Update OCR skills and commands after upgrading the package. Preserves your .ocr/config.yaml and all reviewer personas.
ocr update # Update everything
ocr update --dry-run # Preview changes
ocr update --commands # Commands only
ocr update --skills # Skills and references only
ocr update --inject # AGENTS.md/CLAUDE.md onlyocr reviewers
Manage reviewer personas. Sync metadata from reviewer markdown files to reviewers-meta.json for CLI/OpenCode reviewer resolution and generated OCR assets.
ocr reviewers sync --stdin # Pipe JSON from AI-generated metadataocr state
Internal command used by the review workflow to manage session state. Subcommands: begin, advance, complete-round, complete-map, finish, status, show, sync, reconcile.
ocr state begin --session-id <id> --branch <branch> --workflow-type review
ocr state advance --phase reviews # Advance to a phase (graph-validated)
ocr state complete-round --stdin # Finalize a round from piped JSON
ocr state finish # Close the workflow (invariant-checked)
ocr state status --json # Completeness + next action
ocr state show --json # Show current session state
ocr state sync # Rebuild state from filesystemocr review run-agents
Execution entrypoint used for OpenCode reviews. It is normally called by the
installed /ocr-review command, but can be run directly for debugging.
ocr review run-agents --session-id <session-id> --round <n>
ocr review run-agents [target] --fresh --requirements <text-or-path> --team <json>
ocr review status --session-id <session-id>
ocr review watch --session-id <session-id>
ocr review wait --session-id <session-id>This path owns process spawning and artifact writing. Agents return stdout and NDJSON only; they do not write OCR session files directly.
Supported Runtime
This fork supports one runtime:
| Tool | Config Directory |
|------|------------------|
| OpenCode | .opencode/ |
Updating
After upgrading the package:
npm i -g @open-code-review/cli@latest
ocr updateThe CLI notifies you when a new version is available.
Links
- Full documentation: github.com/spencermarx/open-code-review
- npm: @open-code-review/cli
License
Apache-2.0
