The complete, verified surface of the advisory review command. This is the live help text:
usage: shipmoor review [-h] [--config REVIEW_CONFIG] [--staged |
--commit COMMIT | --scan] [--from FROM_REF]
[--to TO_REF] [--agent AGENT]
[--concurrency CONCURRENCY] [--timeout TIMEOUT]
[--background] [--preview] [--json] [--sarif]
[--output OUTPUT] [--no-color]
[target]
shipmoor review is a peer subcommand of shipmoor scan. It is gated behind the cli_pro entitlement, checked before any config, git, or agent work. A locked run never imports the review engine or spawns your agent.
Positional argument
| Argument | Default | Meaning |
|---|---|---|
target | . | Project directory or repo root to review. |
What gets reviewed: the selectors
By default shipmoor review reviews your working tree (tracked changes plus untracked files) as a diff. The selectors below change that. --staged, --commit, and --scan are mutually exclusive (argparse rejects combining them). --from and --to form a range and must be given together.
| Flag | Mode | What it reviews |
|---|---|---|
| (none) | diff | Working tree: tracked changes (HEAD to working, staged fallback) plus untracked files. |
--staged | diff | Staged changes only (the index, like git diff --staged). |
--commit <ref> | diff | A single commit versus its parent. |
--from <base> --to <head> | diff | A range: merge-base(base, head)..head. |
--scan | whole-file | Whole files, not a diff. Reviews entire file contents. |
shipmoor review # working tree (default)
shipmoor review --staged # the staged index
shipmoor review --commit HEAD # the last commit vs its parent
shipmoor review --from origin/main --to HEAD # everything since main
shipmoor review --scan src/ # whole files under src/
Invalid combinations are usage errors (exit 2) with a specific message:
--fromwithout--to(or the reverse) gives--from and --to must be given together.--scanwith any diff selector gives--scan cannot be combined with a diff selector (--from/--to/--commit/--staged).
There is no
--changedflag onreview(the working tree is the default, and--changedis ashipmoor scanflag). There is no--fail-oneither: a review never gates, so there is no threshold to set.
The reviewer: --agent
| Flag | Meaning |
|---|---|
--agent <agent> | The reviewing agent. A built-in preset (claude or codex) drives that coding-agent CLI for you. Any other value is a bring-your-own-agent command: shlex-split and run as a subprocess, with a JSON review request on its stdin and a JSON response on its stdout. Required to run a review. Omit it only with --preview. |
The simplest form is the built-in claude preset (it drives your local claude CLI, no wiring required):
shipmoor review . --agent claude
Omitting --agent (without --preview) is a usage error:
$ shipmoor review .
shipmoor: --agent is required to run a review (or use --preview); try --agent claude (the built-in preset that drives your `claude` CLI), or set the review.agent config key.
Apart from the presets, the value is shlex-split and executed as a command. See AI coding agents for the request and response wire contract and how to adapt an agent that is not already a stdin-to-stdout filter (a raw claude -p is not one, which is what the claude preset solves). Override the preset’s underlying command with SHIPMOOR_REVIEW_CLAUDE_CMD (or SHIPMOOR_REVIEW_CODEX_CMD). The --agent self form in the Shipmoor Skills is a Skills-context placeholder, not a CLI keyword. The bare CLI has no self sentinel.
Execution knobs
| Flag | Default | Meaning |
|---|---|---|
--concurrency <n> | 8 | Per-file worker pool size: how many files are reviewed in parallel. |
--timeout <seconds> | 120 | Per-file timeout. A file whose review exceeds this is a failure for that file. |
--background | off | Launch the review and return immediately with a run handle (does not wait for findings). |
--preview | off | Resolve the selection and plan the run without invoking the agent. |
shipmoor review . --agent claude --concurrency 4 --timeout 300
--preview plans without spending a token and always exits 0:
$ shipmoor review . --preview
Advisory code review — preview (no agent invoked)
preview: 1 file(s) to review, 0 excluded (1 changed)
--background returns a handle and exits 0:
$ shipmoor review . --agent claude --background
Advisory code review — launched
review launched (handle: review-run-local)
--background and --preview cannot be combined (usage error: --background and --preview cannot be combined.).
Output
| Flag | Meaning |
|---|---|
--json | Write the shipmoor.scan.v1 JSON contract. |
--sarif | Write SARIF 2.1.0. |
--output <file> | Write the machine output (JSON or SARIF) to a file instead of stdout. |
--no-color | Disable terminal color in the human output. |
The human, JSON, and SARIF output reuse the exact shipmoor scan plumbing. A review finding is a shipmoor.scan.v1 finding with category: "code_review" and rule_id: "shipmoor.review.llm". The human output adds an advisory header so it never reads like the gate. See the Quickstart for a full JSON sample.
Config
| Flag | Meaning |
|---|---|
--config <path> | Path to the project config file (otherwise discovered from target). |
Defaults come from a review: block in .shipmoor.yaml. The precedence is flags, then config, then built-in defaults:
review:
agent: "claude"
concurrency: 8
timeout: 120
background: false
exclude:
- "**/generated/**" # extra excludes applied in whole-file (--scan) mode
| Key | Default | Notes |
|---|---|---|
review.agent | (unset) | A preset (claude or codex) or a bring-your-own-agent command. Required to run a review. |
review.concurrency | 8 | Range-guarded (>= 1). |
review.timeout | 120 | Seconds. Range-guarded (>= 1). |
review.background | false | |
review.exclude | [] | Extra exclude globs, appended for whole-file scan mode. |
Exit codes
shipmoor review shares the CLI’s exit-code constants but uses a narrowed subset. The defining rule: review never returns 1 (the “threshold breached” code the scan gate uses). A review with findings is still a success.
| Code | Constant | When |
|---|---|---|
0 | EXIT_CLEAN | Completed (with or without findings), or --preview, or --background launched. |
2 | EXIT_USAGE | Not entitled (cli_pro locked), bad flags, a git or ref or config error, or an --agent command that cannot be launched (the agent never ran, for example a literal self, a typo, a non-executable script). |
3 | EXIT_SCAN_FAILED | An operational failure: the agent ran but the run failed (transport error, timeout, or the engine errored). |
So:
- Found 10 issues, all critical? Exit
0. Advisory never gates. cli_prolocked? Exit2(with theshipmoor.paid_feature_error.v1contract under--json).- Passed
--agent self, or an agent that is not onPATH? Exit2withagent command '…' not found(a usage mistake: fix the--agentvalue). - Your agent crashed or timed out on every file? Exit
3with a headerAdvisory code review — failed.
Combining with the gate (shipmoor scan --fail-on)
Use the two commands together. The gate is shipmoor scan with --fail-on. The advice is shipmoor review:
# 1) The deterministic gate — THIS is what blocks. Non-zero exit fails CI.
shipmoor scan . --changed --fail-on high
# 2) The advisory review — informational; never changes the build's pass/fail.
shipmoor review . --from "origin/main" --to HEAD --agent claude --json --output review.json || true
shipmoor scan --fail-on high returns 1 when a blocking finding crosses the threshold. shipmoor review returns 0 regardless of what it finds. Even if you parse review findings in CI, the build’s verdict stays the scan exit code: the code_review category is excluded from the gate by construction, so an advisory finding can never flip a passing scan to a failure (or rescue a failing one). The recommended CI wiring, including the fork-PR trust model, is in CI integration.