Skip to content

Introduction

miu-cr

miu-cr (MIU Code Review) is AI code review for the CLI, CI, and MCP hosts, built on a deterministic + agent engine. Review your own changes locally before you open a PR, gate them in CI, review GitHub PRs with inline comments, or drive the engine from any MCP-capable agent host (Claude Code, Codex, …). One review path, four ways to run it, a stable JSON envelope on stdout.

Latest release: v0.42.0 — a single static binary; credentials are passed at runtime and never persisted.

Diff-only review misses cross-file bugs; bare-agent review drifts and burns tokens. miu-cr keeps the correctness-critical parts deterministic — file selection, context assembly, line-anchoring, severity gating, dedupe — and uses the LLM only where judgment helps: finding bugs and proposing fixes.

  • Local reviewUsage · Use cases
    • Run staged, range, or commit reviews: --staged, --from + --to, --commit.
    • Deterministic select → context → single LLM pass → line-anchor → gate → dedupe.
    • CI-friendly exit codes at or above --gate severity.
  • GitHub PR reviewGitHub PR review
    • Head-SHA-anchored inline comments, including multi-line ranges.
    • One idempotent summary, or a required GitHub Check Run with --mode checks.
    • --filter-mode, SARIF export, cross-push dedupe, --suggest, and --approve-clean.
  • Project rulesProject rules
    • .miu/cr/rules/*.md frontmatter selects context by changed-file glob.
    • Built-in, user, and repo layers; repo rules are trust-fenced on fork PRs.
  • Semantic code-recallSemantic code-recall
    • Optional embeddings + pgvector recall prior findings as advisory context.
    • Off by default.
  • serve · poll · ActionServe & Action
    • HMAC webhook daemon, opt-in poll trigger, and reusable GitHub Action.
    • All three funnel into the same review path.
  • MCP serverMCP integration
    • miucr mcp exposes review_run / review_get over stdio.
  • REST API + GitHub AppREST API & GitHub App
    • MIUCR_API_TOKEN registers /v1/reviews.
    • [github] mode = app swaps PAT auth for App installation auth.
  • Review historyReview history
    • Every review auto-saves findings, stats, transcript, and raw I/O.
    • Browse with miucr history, miucr history show <id>, and miucr history prune.
  • Store backendsStore backends
    • SQLite by default; opt into Postgres via [store] backend + MIUCR_PG_DSN.
  • Single static binary
    • Credentials are passed at runtime and never persisted.
Terminal window
export ANTHROPIC_API_KEY=... # bring your own key (--provider auto detects OpenAI too)
miucr login --provider openai # or: review on your ChatGPT plan
miucr review --staged # review staged changes
miucr review --from main --to HEAD -o pretty # review a range, human-readable
miucr review --commit HEAD~1 --gate high # exit 2 if a high+ finding lands
miucr review --pr owner/repo#123 --no-post -o json # dry-run a GitHub PR
miucr mcp # serve the engine over MCP (stdio)

Every command emits the stable miucr.cli/v1 JSON envelope by default (-o pretty for a human table). New here? Start with Getting started, then browse copy-paste starters (rules, GitHub Action, MCP setup, Docker) in examples/. It is Apache-2.0 licensed; the source of truth is the repository.