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.
npx @minirouter/code-review swarm \
--base origin/main --head HEAD \
--agents 25 --budget 520 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.
npx @minirouter/code-review review \
--base origin/main --head HEAD \
--budget 2Review committed changes with three agents by default: one reviewer, one verifier and one judge.
npx @minirouter/code-review audit \
--head HEAD --budget 2Review the committed head snapshot with three agents by default. No base revision is needed.
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.
npx @minirouter/code-review swarm \
--base origin/main --head HEAD \
--model minirouter/auto --budget 5npx @minirouter/code-review swarm \
--base origin/main --head HEAD \
--model @preset/code-review --budget 5Create a preset with the slug code-review, then change its model from your dashboard without editing the command.
CLI options
Options and GitHub posting
- --base /
--head - Committed revisions. Review and swarm default to
HEAD~1andHEAD; audit uses the head snapshot. - --model
minirouter/autoby 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_TOKENandGITHUB_REPOSITORY. Review and swarm also needGITHUB_PR_NUMBER. Audits update a tracking issue. - --fail-on
noneby default. UseP1,P2orP3to 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.