CLI commands
Every command redline --help prints, grouped by when you use it. Each page has the flags, real output and exit codes.
Running a command
The package is redlinegate, and it installs two names for the same CLI: redline and redlinegate. In a product repository, run the copy pinned in the project's devDependencies, so everyone runs the same version. redline init adds it by default. Before that, or in a repository without it, run the published package with npx redlinegate@latest.
$ pnpm redline --help $ pnpm redline init --help
$ npx redlinegate --help $ npx redlinegate init --help
$ yarn redline --help $ yarn redline init --help
$ bun run redline --help $ bun run redline init --help
Estate commands are different: they run from the Redline source repository or the metrics repository, and each page says which.
Set up a repository
Run once per machine or repository, and again when you change what is installed.
| Command | What it does |
|---|---|
redline init | Onboard this repository: assistant rules, security floor, merge gate and a pull request with all of it. |
redline doctor | Check this machine can run Redline here: Node, git, the remote, a credential, onboarding. |
redline status | What is installed here, how hard the gate blocks, and what an administrator still owes you. |
redline remove | Take Redline back out of this repository, as a pull request. |
redline completion | Print a tab-completion script for bash, zsh or fish. |
Everyday work
Run while you write and review code. The gate runs verify, policy and exempt for you on every pull request.
| Command | What it does |
|---|---|
redline review | Review your change against only the rules that apply to the files it touches. |
redline explain | Turn the rule id in a finding into the rule, where it is defined, and who receives it. |
redline verify | Check the repository and its host settings still match what .redline.json claims. |
redline policy | Evaluate the rules a checker can decide, with no model call. |
redline exempt | Decide whether a pull request carries a valid exemption for a failing process check. |
redline evidence | Show the measurement behind this repository's rung, and record a new one. |
redline funnel | Where your own runs of the CLI succeed and fail. Off by default, local only. |
Across the organisation
Run by the platform team, from the Redline source repository or the metrics repository. Not from a product repository.
| Command | What it does |
|---|---|
redline sync | Open a pull request on every registered repository whose standards are behind. |
redline registry | Build registry.json, the list of onboarded repositories, by walking the organisation. |
redline metrics | Collect review telemetry and build the dashboard, digest, inbox and ROI pages. |
Exit codes
Every command uses the same codes, so a script can tell a finding from a broken run. Each command page lists the ones it returns.
| Code | Meaning |
|---|---|
0 | Success. |
1 | The command ran and the answer is no: drift, a BLOCKER, no valid exemption. |
2 | Usage: an unknown command, flag or value, a repository that is not onboarded, or Node older than 18.11. |
3 | Permission: the host refused the credential. |
4 | Host: the host could not be reached or the repository was not found. Also an unexpected error inside Redline; re-run with REDLINE_DEBUG=1 for the stack trace. |
130 | Cancelled at an init menu prompt. Nothing was written. |
Related
- Learn path: the commands in the order you would use them.
- Who runs what: which commands need which credential.
- Troubleshooting