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.

terminal
$ pnpm redline --help
$ pnpm 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.

CommandWhat it does
redline initOnboard this repository: assistant rules, security floor, merge gate and a pull request with all of it.
redline doctorCheck this machine can run Redline here: Node, git, the remote, a credential, onboarding.
redline statusWhat is installed here, how hard the gate blocks, and what an administrator still owes you.
redline removeTake Redline back out of this repository, as a pull request.
redline completionPrint 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.

CommandWhat it does
redline reviewReview your change against only the rules that apply to the files it touches.
redline explainTurn the rule id in a finding into the rule, where it is defined, and who receives it.
redline verifyCheck the repository and its host settings still match what .redline.json claims.
redline policyEvaluate the rules a checker can decide, with no model call.
redline exemptDecide whether a pull request carries a valid exemption for a failing process check.
redline evidenceShow the measurement behind this repository's rung, and record a new one.
redline funnelWhere 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.

CommandWhat it does
redline syncOpen a pull request on every registered repository whose standards are behind.
redline registryBuild registry.json, the list of onboarded repositories, by walking the organisation.
redline metricsCollect 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.

CodeMeaning
0Success.
1The command ran and the answer is no: drift, a BLOCKER, no valid exemption.
2Usage: an unknown command, flag or value, a repository that is not onboarded, or Node older than 18.11.
3Permission: the host refused the credential.
4Host: 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.
130Cancelled at an init menu prompt. Nothing was written.