Apply and update repository templates safely with deterministic overlays, manifests, and merge-aware updates.
Use a Git URL or a local filesystem path:
- Git URL:
repokit init --template https://github.com/org/template.git --ref main --profiles base,service
- Local path:
repokit init --template /path/to/template --profiles base,service
Notes:
initis the only command that accepts--template,--ref, and--profiles.- If
.kit.tomlalready exists,initfails; userepokit config setinstead. - Use
--forceto overwrite conflicting files instead of writing.new. - Local templates do not support
--ref. baseis always included first; duplicate profiles are ignored.
After init, update always uses .kit.toml (no CLI overrides):
repokit updaterepokit update --force(overwrite conflicts instead of writing.new)
After init, status always uses .kit.toml (no CLI overrides):
repokit status
Use repokit config to inspect and update .kit.toml:
- Show:
repokit config show
- Set:
repokit config set --template https://github.com/org/template.git --ref main --profiles base,service
- Clear ref:
repokit config set --ref ""
Templates are expected to follow this structure:
profiles/base(required)profiles/<profile>(optional overlays)- Optional merge rules (combined across selected profiles, later profiles win on conflicts):
profiles/<profile>/.repokit/merge.toml
- Optional GitHub labels per profile:
profiles/<profile>/.repokit/github/labels.toml
The .repokit/ directory configures repokit behavior only and is not copied into the target repo.
repokit replaces template variables in file contents only (not filenames or paths). Values are derived from git remote origin. If the origin is missing or unsupported, variables are left unchanged and a warning is emitted.
Supported variables:
{{REPOSITORY_NAME}}—owner/repo(e.g.acme/widgets){{REPOSITORY_URL}}— full origin URL (e.g.git@github.com:acme/widgets.git)
[[rule]]
name = "gitignore"
strategy = "gitignore"
patterns = [".gitignore"]
[[rule]]
name = "docs"
strategy = "markdown_block"
patterns = ["README.md", "docs/**/*.md"]- Writes
.kit.tomlwith template metadata and file hashes. - Updates overwrite only if unchanged; otherwise writes
.new. - Merge-aware files (e.g.
.gitignore, Markdown blocks) are merged without.new. - GitHub labels are additive and idempotent (no deletions).
- If no GitHub auth is available, label sync is skipped with a warning.
gitfor Git URL templatesghorGITHUB_TOKENfor GitHub label operations