redline init

Onboard this repository: assistant rules, security floor, merge gate and a pull request with all of it.

Onboards the repository you are in. It writes the standards into the files each AI assistant reads, turns on the organisation's security floor (secret scanning, push protection, dependency alerts), installs the merge gate in advisory mode, and records every choice in .redline.json. On a repository with a remote, everything lands as one pull request on the redline/onboard branch. Run it once to onboard, and again whenever you want to change what is installed: omitted flags keep what .redline.json already recorded.

Where it runs: Inside the product repository. The first run uses the published package; after that, use the pinned copy init adds by default. With no flags at a terminal, init walks a menu with what it detected preselected and offers a dry run before applying. Any flag, a pipe, CI, or REDLINE_NO_PROMPT=1 skips the menu.

Synopsis

synopsis
redline init [--profile <list>] [--vendors <list>] [--blocking] [--no-a11y] [--dry-run] [--repair]
             [--adopt-caller] [--skip <list>] [--with <list>] [--pipeline <name>]
             [--gate-source org|local] [--docs-url <base>] [--approvals <n>] [--no-commit]

Flags

FlagDefaultWhat it does
--dry-runoffPrint the plan. Writes nothing, needs no credential, contacts no host.
--no-commitoffWrite the files into the working tree and stop. No repository setting, branch, commit or pull request. Works offline. Commit the files, then run init again to apply the settings.
--profile <list>detectedOne profile, or several separated by commas, rendered together (web,infra for a React app with Terraform beside it). Short aliases such as web and infra work. Order does not matter.
--vendors <list>recorded, else detectedWhich assistants to write files for: copilot, agents, codex, claude, cursor. Replaces both detection and the recorded list. A vendor the organisation has disabled never renders. See Adaptors.
--pipeline <name>recorded, else follows the hostWhat runs this repository's pull request checks: github-actions, azure-pipelines or local-agent. Set it when the host and the CI differ, such as a GitHub repository built by Azure Pipelines. local-agent installs no CI: the gate is a pre-push hook.
--skip <list>review-ownershipCapabilities not to install: gate, merge-policy, labels, review-ownership. Use it when the repository already has its own. The security floor cannot be skipped.
--with <list>noneThe same names, selected again. --with review-ownership writes CODEOWNERS, which is off by default.
--review-owners <list>the platform teamWho owns the paths seeded into CODEOWNERS: teams, users or emails, comma separated. GitHub ignores an owner it cannot resolve, so set this to someone who exists.
--rung <name>recorded, else observeHow hard the gate blocks: observe, block-blocker or block-high. Moving up needs recorded evidence (see redline evidence). Moving down is always allowed.
--blockingoffMake the merge gate blocking instead of advisory. --rung is the finer-grained version of the same choice.
--gate-source org|localrecorded, else orgorg references the reusable gate in <org>/.github. local copies the gate into .github/workflows/redline-gate.yml. local is weaker: a pull request can edit the gate that judges it, so protect .github/workflows/ with CODEOWNERS.
--approvals <n>recorded, else 0Approving reviews the branch policy requires, 0 to 10.
--branches <patterns>the default branchBranches the merge policy governs, comma separated, in the host's syntax (~DEFAULT_BRANCH, refs/heads/release/*). Never detected.
--docs-url <base>unsetWhere your organisation publishes the standard. Each finding then links to <base>/r/<rule-id>. Pass an empty string to clear it.
--integrations <list>detectedControls this repository already runs: sonarqube, snyk, mend, dependabot, renovate, gitleaks, trufflehog, codeql. Corrects detection, which cannot see a scanner wired through a shared pipeline template.
--setup <list>noneExtra controls to install: dependabot, renovate, codeql. Writes .github/dependabot.yml, renovate.json or .github/workflows/codeql.yml. Never overwrites an existing file.
--pin-cli / --no-pin-clionAdd redlinegate to devDependencies at this exact version, with the project's package manager, in the same pull request. On in npm and pnpm projects that do not list redlinegate yet; yarn and bun projects need --pin-cli, since committed yarn plugins still load. The team then runs pnpm redline, yarn redline or npx redlinegate.
--speckit / --no-speckitonAdd the spec-first context section to the assistant files. Dropped automatically where the repository already runs Spec Kit.
--tmf / --no-tmfoffAdd the TM Forum context section. The negative removes a section rendered earlier.
--adr / --no-adronRequire a pull request over 300 changed lines to link a decision record in docs/adr/. One pull request can skip it with the no-adr label.
--repairoffRe-apply every capability even if the repository looks onboarded. Use it to clear an item still waiting on an administrator. Works with --dry-run.
--adopt-calleroffTake over an existing .github/workflows/redline.yml or .azuredevops/redline-gate.yml that nothing marks as Redline's. Without it, init refuses to overwrite the file.
--no-a11yoffRecorded in .redline.json. Changes nothing yet.

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

Examples

See the plan first

terminal
$ npx redlinegate@latest init --dry-run

  profile web-react · dry run
  opted out: review-ownership

  Files  22 to write
   + .github/copilot-instructions.md
   + .github/instructions/redline-javascript.instructions.md
   …
   + AGENTS.md
   + CLAUDE.md
   + .cursor/rules/redline-core.mdc
   …
   + .github/workflows/redline.yml
   + .github/pull_request_template.md
   + .redline.json

  Repository settings  4 to apply
   → merge gate machinery on github
   → security floor: secret scanning, push protection, dependency alerts
   → branch policy: no approving review, gate advisory
   → pull request on redline/onboard

  menu: blockingGate=false adrForLargeDiffs=true accessibility=true speckit=true tmf=false sensitivePathReviewers=false

dry run — nothing was written, read or changed on the host

Onboard without pinning the CLI

terminal
$ npx redlinegate@latest init --no-pin-cli

Change one choice later

terminal
$ pnpm redline init --vendors copilot,claude
$ pnpm redline init --pipeline azure-pipelines
$ pnpm redline init --with review-ownership --review-owners @acme/platform

Exit codes

CodeMeaning
0Onboarded, already onboarded, or the dry run finished. Items an administrator still has to enable are printed as a warning, not an error.
1The changes are committed on the onboarding branch, but the pull request could not be opened. Push the branch and open it by hand.
2Usage error: an unknown flag or value, or a Node version below 18.11.
3The host refused the credential.
4The host could not be reached, or the repository was not found.
130Cancelled at a menu prompt. Nothing was written.