init
init is how a repo becomes Valinor-governed. It propagates the versioned canonical doctrine into the target's AGENTS.md≡CLAUDE.md (inlined between the valinor-doctrine anchors, kept byte-identical) and scaffolds the minimum to run the doctrine gate there.
It is safe to re-run: the agent-docs are content-preserving (the block is replaced in place, never duplicated), and each scaffold file is written only when absent — an existing claims.yml / governance.config.yml / README.md / .greptile/config.json / workflow is left untouched. So re-running to pull a doctrine update never clobbers your custom claims, config, or rules.
Propagate + scaffold
Unlike the other commands, init takes a required target-path argument (not the optional default-path positional) plus flags.
Arguments
- Name
targetPath- Type
- string (required)
- Description
The repo to govern. The doctrine block is written into its
AGENTS.mdandCLAUDE.md(a neutral# AGENTS.md / CLAUDE.mdH1 is normalised on every run).
Flags
- Name
--profile- Type
- enum
- Description
technical-app·marketing-site·bizdev-proposal·library. Selects the governance profile.
- Name
--maturity- Type
- enum
- Description
greenfield·actively-developed·mature·deep-legacy. The adoption maturity that tunes whether whole-tree gates run against everything or only new code.
- Name
--mode- Type
- enum
- Description
strict·new-code·advisory. The strictness dial;new-coderequires a baseline file to grandfather existing findings.
- Name
--stack- Type
- string
- Description
Overrides the profile-aware default (
marketing-site→nextjs, otherwiseunknown). Parsed through theGovernanceConfigschema — an invalid value fails closed.
- Name
--dry-run- Type
- flag
- Description
Print the plan and write nothing.
Scaffold a repo
npx @cmbrcreative/valinor init ./my-repo \
--profile library \
--maturity greenfield \
--mode strict \
--stack node-ts
What it scaffolds
AGENTS.md / CLAUDE.md # doctrine block (byte-identical)
governance.config.yml # from the flags above
claims.yml # doctrine-block-present + presence baseline
README.md # starter
.greptile/config.json # the canonical review-rubric rules
.github/workflows/
valinor-gates.yml # Node 24; runs npx @cmbrcreative/valinor <gate>
The scaffolded valinor-gates workflow mints a Packages-read GitHub App token (from
VALINOR_APP_ID + VALINOR_APP_PRIVATE_KEY), configures .npmrc to authenticate
@cmbrcreative against npm.pkg.github.com, and runs each gate. It gracefully
::warning::-skips when the App credentials are absent, and its continue-on-error
follows adoption.mode — advisory is non-blocking, new-code / strict block.
On success init prints a Next steps block pointing at the scaffolded repo's prerequisites — install the App, set the secrets, and connect Greptile. See docs/guide/prerequisites.md for the full setup contract (the same content is surfaced on the help-center's Prerequisites page).