redline review

Review your change against only the rules that apply to the files it touches.

Reviews your change before you push, against the rules for the stacks your diff actually touches. At a terminal with no --engine, it prints what a checker can decide without a model, straight away. Inside an assistant's shell or a pipe, it prints a prompt for that assistant to apply. With --engine api, it sends the diff to a model endpoint you configure, which can be local. Results are never recorded and never fail anything.

Where it runs: Inside the product repository, through the copy pinned in its devDependencies. The profile comes from .redline.json unless you pass --profile.

Synopsis

synopsis
redline review [--staged] [--diff-file <path>] [--base <ref>] [--engine <name>] [--print-prompt]
               [--provider openai|anthropic] [--model <name>] [--base-url <url>] [--json]

Flags

FlagDefaultWhat it does
--stagedoffReview only what is staged.
--diff-file <path>noneReview a unified diff from a file instead of the checkout.
--base <ref>the default branchThe branch to diff against. The diff is taken from the merge base, so commits that landed on the base since you branched are not reviewed.
--profile <name>from .redline.jsonThe profile whose rules apply.
--engine embeddedsee abovePrint the bounded prompt for the assistant running the command.
--engine apioffCall a model endpoint and print its findings. Nothing is sent unless you pass this flag.
--provider openai|anthropicfrom the API keyWhich API the api engine speaks. Inferred from OPENAI_API_KEY or ANTHROPIC_API_KEY. openai covers any OpenAI-compatible server, such as Ollama, LM Studio or vLLM.
--model <name>REDLINE_REVIEW_MODELThe model the api engine calls. Required one way or the other.
--base-url <url>the provider'sThe endpoint the api engine calls. A local OpenAI-compatible server needs no key.
--print-promptoffWrite only the prompt to stdout, everything else to stderr, so redline review --print-prompt | pbcopy copies the prompt alone. Not with --engine api.
--jsonoffScope, prompt and findings as JSON on stdout.

--help prints the same list from the CLI you have installed.

Examples

At a terminal

terminal
$ pnpm redline review

profile javascript-typescript — rules in scope: core, typescript
src/a.ts:2
  Redline/HIGH [core/untracked-todo]: this TODO carries no ticket reference, so nothing will bring anyone back to it. Add the ticket id on the same line, or do the work now.
1 finding(s)
that is every rule a checker can decide; the rest of the standard needs a model — run /redline-review in your assistant, or `redline review --engine api`
local review — not recorded, and not counted in rule-tuning telemetry

With a local model

terminal
$ pnpm redline review --engine api --provider openai --base-url http://localhost:11434/v1 --model qwen2.5-coder:14b

Paste the prompt into any assistant

terminal
$ pnpm redline review --print-prompt | pbcopy

Exit codes

CodeMeaning
0Always when the review ran, whatever it found. It is a pre-push check, not a gate.
2Usage error: an unknown flag or value, or a Node version below 18.11.