Guides

Local agent swarm

Review code from your terminal with 25 agents, your model and your MiniRouter key.

Run locally

Use Node.js 24 or later and Git. The CLI runs locally and sends code to models through MiniRouter. Only committed code is reviewed.

Create a dedicated review key with a spend cap. Set MINIROUTER_API_KEY in your environment, then run from your Git repository.

Terminal
npx @minirouter/code-review swarm \
  --base origin/main --head HEAD \
  --agents 25 --budget 5

20 reviewers cover logic, security, data, performance and API behavior across file slices. Four verifiers re-read the source, then one judge consolidates findings. At most eight agents run at once.

Reports are saved in .minirouter-review: review.md, review.json and review.sarif.

Choose your model

The default is minirouter/auto. Pass a model ID or a preset with --model.

Terminal
npx @minirouter/code-review swarm \
  --base origin/main --head HEAD \
  --model minirouter/auto --budget 5

CLI options

Options and GitHub posting
--base / --head
Committed revisions. Review and swarm default to HEAD~1 and HEAD; audit uses the head snapshot.
--model
minirouter/auto by default. Also accepts a model ID or @preset/slug.
--agents
3 for review and audit; 25 for swarm. Choose 3–25.
--budget
Reported cost limit in USD. Default: 2.
--out
Report directory. Default: .minirouter-review. Writes Markdown, JSON and SARIF.
--post
Post using GITHUB_TOKEN and GITHUB_REPOSITORY. Review and swarm also need GITHUB_PR_NUMBER. Audits update a tracking issue.
--fail-on
none by default. Use P1, P2 or P3 to exit with code 1 for findings at that priority or higher.
--timeout-ms
Per-call timeout. Default: 120000 ms.
--deadline-ms
Overall review deadline. Default: 900000 ms.
--base-url
API base URL. Default: https://api.minirouter.sh/v1.

Cost and incomplete reviews

The budget stops new calls once reported cost reaches the limit. Calls already in flight can exceed it; use a per-key spend cap as the hard limit. See requests in Activity.

Timeouts, missing cost reports, exhausted credits and unrepaired model responses produce an incomplete review. Reports preserve completed work and explain the stop.

Incomplete runs exit with code 2 even with --fail-on none. Exit codes:

  • 0 — Review completed; findings did not trigger the severity gate.
  • 1 — Review completed; findings meet --fail-on.
  • 2 — Incomplete run or error.
Esc