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
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
| Flag | Default | What it does |
|---|---|---|
--dry-run | off | Print the plan. Writes nothing, needs no credential, contacts no host. |
--no-commit | off | Write 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> | detected | One 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 detected | Which 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 host | What 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-ownership | Capabilities 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> | none | The same names, selected again. --with review-ownership writes CODEOWNERS, which is off by default. |
--review-owners <list> | the platform team | Who 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 observe | How hard the gate blocks: observe, block-blocker or block-high. Moving up needs recorded evidence (see redline evidence). Moving down is always allowed. |
--blocking | off | Make the merge gate blocking instead of advisory. --rung is the finer-grained version of the same choice. |
--gate-source org|local | recorded, else org | org 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 0 | Approving reviews the branch policy requires, 0 to 10. |
--branches <patterns> | the default branch | Branches the merge policy governs, comma separated, in the host's syntax (~DEFAULT_BRANCH, refs/heads/release/*). Never detected. |
--docs-url <base> | unset | Where your organisation publishes the standard. Each finding then links to <base>/r/<rule-id>. Pass an empty string to clear it. |
--integrations <list> | detected | Controls 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> | none | Extra 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-cli | on | Add 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-speckit | on | Add the spec-first context section to the assistant files. Dropped automatically where the repository already runs Spec Kit. |
--tmf / --no-tmf | off | Add the TM Forum context section. The negative removes a section rendered earlier. |
--adr / --no-adr | on | Require 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. |
--repair | off | Re-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-caller | off | Take 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-a11y | off | Recorded in .redline.json. Changes nothing yet. |
--help prints the same list from the CLI you have installed.
Examples
See the plan first
$ 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
$ npx redlinegate@latest init --no-pin-cli
Change one choice later
$ pnpm redline init --vendors copilot,claude $ pnpm redline init --pipeline azure-pipelines $ pnpm redline init --with review-ownership --review-owners @acme/platform
$ npx redlinegate init --vendors copilot,claude $ npx redlinegate init --pipeline azure-pipelines $ npx redlinegate init --with review-ownership --review-owners @acme/platform
$ yarn redline init --vendors copilot,claude $ yarn redline init --pipeline azure-pipelines $ yarn redline init --with review-ownership --review-owners @acme/platform
$ bun run redline init --vendors copilot,claude $ bun run redline init --pipeline azure-pipelines $ bun run redline init --with review-ownership --review-owners @acme/platform
Exit codes
| Code | Meaning |
|---|---|
0 | Onboarded, already onboarded, or the dry run finished. Items an administrator still has to enable are printed as a warning, not an error. |
1 | The changes are committed on the onboarding branch, but the pull request could not be opened. Push the branch and open it by hand. |
2 | Usage error: an unknown flag or value, or a Node version below 18.11. |
3 | The host refused the credential. |
4 | The host could not be reached, or the repository was not found. |
130 | Cancelled at a menu prompt. Nothing was written. |