# CLI reference

> The cross-review command, its everyday commands, the verbs the skills use, the low-level runner commands, and the exit codes.

The installer puts a `cross-review` command in `~/.local/bin` (not on Windows). It runs the installed runner, `~/.claude/skills/cross-review/scripts/review-runner.js`; without the command, run `node` on that file with the same arguments. Run `cross-review` with no command to print the usage of the low-level commands.

> **Caution:**
>
> The npm package runs only one of these commands itself: `npx @tlelabs/cross-review dashboard`. Any other argument to `npx @tlelabs/cross-review` runs the installer.

```sh
cross-review version
cross-review dashboard [--root DIR] [--port N] [--no-open] [--idle-exit SECONDS]
cross-review plans --working-dir DIR [--finished FILE]


# Used by the skills (CLI fallback when the MCP server is not available)
cross-review begin --skill SKILL [--mode MODE] --input FILE|- [--working-dir DIR] [--model NAME] [--effort LEVEL] [--timeout SECONDS] [--reviewer NAME] [--skills-dir DIR]
cross-review wait SESSION_DIR [--max-wait SECONDS]
cross-review reply SESSION_DIR --input FILE|- [--model NAME] [--effort LEVEL]
cross-review end SESSION_DIR [--outcome consensus|stalemate]
```

> **Note:**
>
> The skills run `begin`, `wait`, `reply` and `end` for you. You run the everyday commands yourself. The low-level commands are listed at the end for debugging.

## Everyday commands

| Command                                | What it does                                                                                                                                 |
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `cross-review version`                 | Prints the runner version as plain text (`15`).                                                                                              |
| `cross-review dashboard`               | Serves the dashboard on `127.0.0.1` and prints its link. See [the dashboard guide](https://cross-review.tlelabs.com/docs/guides/dashboard/). |
| `cross-review plans --working-dir DIR` | Creates `.cross-review/plans/` in `DIR`, keeps its `.gitignore` in step with the settings, and prints the plans as JSON.                     |

### dashboard options

| Option                | Default                           | Description                                                                                         |
| --------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------- |
| `--root DIR`          | The current directory             | Folder to scan. The scan goes three levels down. It must exist.                                     |
| `--port N`            | A random port from 20000 to 30000 | Port to listen on. Must be a port number.                                                           |
| `--no-open`           | Off                               | Prints the link and does not open the browser.                                                      |
| `--idle-exit SECONDS` | Off                               | Stops the dashboard after this many seconds with no open browser page. Must be a number above zero. |

Errors go to stderr, and the command exits with `1`.

### plans options

| Option              | Description                                                                                            |
| ------------------- | ------------------------------------------------------------------------------------------------------ |
| `--working-dir DIR` | Required. The workspace whose plans are listed.                                                        |
| `--finished FILE`   | A plan file that just finished. With `open_plans` on, the command opens its Plan tab in the dashboard. |

The output is one JSON object with `dir`, `track_plans`, `gitignore`, `git`, `plans`, and, when there is something to report, `warning`, `dashboard_url` or `dashboard_error`.

## Verbs the skills use

These four verbs wrap a review round. The skills call the MCP tools when they are available and fall back to these commands otherwise. See [MCP tools](https://cross-review.tlelabs.com/docs/reference/mcp-tools/) for the same operations as tools.

| Command             | Input                                                          | Output                                                                                 |
| ------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `begin`             | `--skill`, `--input` (required), plus the optional flags below | JSON with `session_dir`, `round`, `status`, and `analysis_prompt` for peer skills.     |
| `wait SESSION_DIR`  | `--max-wait` (seconds, default `110`)                          | JSON poll result with `next` and `next_reason`.                                        |
| `reply SESSION_DIR` | `--input` (required)                                           | JSON with `status`, `session_dir`, `round`, `thread_id`.                               |
| `end SESSION_DIR`   | `--outcome` (optional)                                         | JSON with `status`, `session_dir`, `finalized`, and `verdict` or `error` when present. |

### begin options

| Option                | Description                                                                                                                               |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `--skill`             | One of `review-plan`, `review-impl`, `review-think`, `review-pr`.                                                                         |
| `--mode`              | Required by `review-impl`: `working-tree` or `branch`. Not needed by the other skills.                                                    |
| `--input`             | A file with the placeholder values in markdown, or `-` for stdin.                                                                         |
| `--working-dir`       | The repository under review. Defaults to the current directory.                                                                           |
| `--model`, `--effort` | Reviewer model and reasoning effort. When omitted, the [settings](https://cross-review.tlelabs.com/docs/reference/configuration/) decide. |
| `--timeout`           | Deadline for the reviewer in seconds. Default `18000` (5 hours).                                                                          |
| `--reviewer`          | Reviewer CLI. Only `codex` today.                                                                                                         |
| `--skills-dir`        | Folder with the skill’s `references/` templates. Defaults to the installed skills.                                                        |

### wait, reply and end options

- `wait --max-wait` sets how long one call waits for the reviewer. The call returns earlier when the round ends.
- `reply --input` takes the next round’s placeholder values. `--model` and `--effort` change the stored settings for later rounds.
- `end --outcome` takes `consensus` or `stalemate`. Peer skills (`review-think`, `review-pr`) need it when their exit rule is met. Plan and implementation reviews take their verdict from the last round and do not need it.

## Low-level runner commands

Use these only when you debug a session by hand. They change session state without the checks the verbs make.

| Command                                                      | Purpose                                                                                                                                                 |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `init --skill-name NAME --working-dir DIR [--reviewer NAME]` | Creates a session directory and prints `SESSION:` followed by its path.                                                                                 |
| `start SESSION_DIR`                                          | Starts round 1 from a prompt on stdin. Flags: `--model`, `--effort`, `--timeout`, `--sandbox`, `--stall-threshold`.                                     |
| `resume SESSION_DIR`                                         | Starts the next round on the same reviewer thread from a prompt on stdin. Flags: `--model`, `--effort`, `--timeout`, `--stall-threshold`, `--recovery`. |
| `poll SESSION_DIR`                                           | Prints the round status. Flag: `--min-interval` (seconds, default `120`).                                                                               |
| `stop SESSION_DIR`                                           | Stops the reviewer.                                                                                                                                     |
| `finalize SESSION_DIR`                                       | Writes `meta.json`. Reads an override JSON on stdin, for example `{"verdict":"APPROVE"}`.                                                               |
| `status SESSION_DIR`                                         | Prints the session state.                                                                                                                               |
| `render --skill NAME --template NAME --skills-dir DIR`       | Prints a rendered prompt. The placeholder values come as JSON on stdin.                                                                                 |

`start` uses the reviewer’s read-only sandbox unless `--sandbox` names another one. `begin` starts the reviewer with the full-access sandbox, and `reply` resumes it with the sandbox stored in the session. See [session files](https://cross-review.tlelabs.com/docs/reference/session-files/) for what each command writes.

## Exit codes

The process exit code is `0` for success and `1` for an error. The verbs also exit with `5` when the reviewer CLI is missing.

| Code | Meaning                                                          | Where it appears                     |
| ---- | ---------------------------------------------------------------- | ------------------------------------ |
| `0`  | Success.                                                         | Any command.                         |
| `1`  | Any other error.                                                 | Any command.                         |
| `5`  | The reviewer CLI was not found in `PATH` (`REVIEWER_NOT_FOUND`). | `begin`, `start`, `resume`, `reply`. |

Commands that print JSON report an error as JSON on stdout, with `status` set to `error`, a `code` and a message. `dashboard` prints its errors as text on stderr.

### Round results

These are not process exit codes. The poll result of a round carries an `exit_code` field: `2` for a runner deadline timeout, `3` for a failed turn, and `4` for a stalled reviewer (12 checks in a row with no new output; at the skills’ two-minute interval, about 24 minutes). `poll` exits with `0` whatever the result. `wait` exits with `1` when the round result has an `error` (a failed, stalled or timed-out round), and its output still carries `status`, `next` and `next_reason`.
