repo-starter-kit
v0.4.0
Published
CLI to bootstrap and sync repository labels, issues, branch rulesets and config.
Maintainers
Readme
@zokugun/repo-starter-kit
Command-line helper to bootstrap and sync repository settings (labels, issues, branch rulesets and basic config) from a reusable package or local files.
Why use this tool?
- Reuse a central
repo-starter-kitconfiguration published as an npm package or provide local files to keep repositories consistent. - Manage issue templates and labels programmatically.
- Lightweight CLI with interactive prompts when needed.
Quick start
Install globally with npm:
npm install -g @zokugun/repo-starter-kitOr run directly with npx:
npx @zokugun/repo-starter-kit --repo owner/name --package @your/packageUsage
Basic example:
repo-starter-kit --repo daiyam/temp --package @daiyam/default --keep-labelsOptions
-r, --repo <owner/name>: Target repository (OWNER/NAME). Required.-c, --create: Create the repository if it does not exist-l, --labels <path>: Path to a labels YAML file to apply to the repository. Supports local files or npm URLs such asnpm:@scope/config/labels.yml.-i, --issue <path>: Path to a Markdown file used as an issue template. Supports local files or npm URLs such asnpm:@scope/config/issue.md.-b, --rulesets <path>: Path to a YAML/JSON file containing branch rulesets definitions. Supports local files or npm URLs such asnpm:@scope/config/rulesets.yml.-p, --package <name>: An npm package or a direct directory that includes arepo-starter-kitconfiguration file to apply.--keep-labels: Do not delete labels missing from the provided configuration (defaults tofalse).--keep-rulesets: Do not delete branch rulesets missing from the provided configuration (defaults tofalse).-v, --version: Show version number.
Examples
- Apply a published starter package to a repository:
repo-starter-kit -r myuser/myrepo -p @myorg/myconfig- Apply local labels file and an issue template (do not remove existing labels):
repo-starter-kit -r myuser/myrepo -l labels.yml -i issue.md -kConfiguration package
The configuration package need to be prefixed:
--package @daiyam/defaultwill load the package@daiyam/repo-starter-kit-default
At its root, it needs to have one of the following file:
repo-starter-kit.ymlrepo-starter-kit.yamlrepo-starter-kit.json
With its content as:
labels: <path to labels file>
issue: <path to issue file>
rulesets: <path to branch rulesets file>Each <path> can be either a relative file path inside the package or an npm URL that references another published package (for example npm:@scope/reusable-kit/labels.yml).
For reference, please check https://github.com/daiyam/repo-starter-kit-default.
Branch rulesets
Each ruleset entry mirrors the payload accepted by the GitHub branch rulesets API. The file must contain an array of objects, for example:
- name: Protect main
enforcement: active
target: branch
conditions:
ref_name:
include:
- refs/heads/main
rules:
- type: pull_request
parameters:
required_approving_review_count: 1Examples
The examples/ directory in this repository contains ready-to-use folders showing how to bundle labels, issues, and branch rulesets. Use them directly:
npx @zokugun/repo-starter-kit --repo <owner/name> --package ./examples/basic/or publish one of the folders as an npm package (each folder already includes a repo-starter-kit.yml manifest) so you can pass --package @scope/name.
Donations
Support this project by becoming a financial contributor.
License
Copyright © 2025-present Baptiste Augrain
Licensed under the MIT license.
