gh-scaffold
v1.0.3
Published
CLI to scan a repo and generate missing GitHub community health files (.github templates, CONTRIBUTING, SECURITY, etc.)
Maintainers
Readme
gh-scaffold
gh-scaffold is a CLI that scans a repository and helps you generate missing GitHub “community health” files (CONTRIBUTING, SECURITY, issue/PR templates, etc.).
It’s designed to be:
- Safe by default (no overwrites unless you ask)
- Repeatable (idempotent)
- Configurable (presets + optional config file)
What it can generate
Depending on preset/flags:
CONTRIBUTING.mdSECURITY.md.github/PULL_REQUEST_TEMPLATE.md.github/ISSUE_TEMPLATE/bug_report.(md|yml).github/ISSUE_TEMPLATE/feature_request.(md|yml).github/ISSUE_TEMPLATE/config.ymlCODE_OF_CONDUCT.mdSUPPORT.md
Strict preset also includes:
.github/CODEOWNERS.github/FUNDING.ymlGOVERNANCE.mdMAINTAINERS.mdCHANGELOG.mdLICENSE(MIT/Apache/GPL)
Install
npm (planned)
npm i -g gh-scaffoldFrom source
git clone https://github.com/rafazafar/gh-scaffold
cd gh-scaffold
npm i
npm run build
node dist/cli.js --helpQuick start
Interactive (default): scan → choose missing files → preview/write
npx gh-scaffoldNon-interactive scan:
npx gh-scaffold --scan
# or machine-readable:
npx gh-scaffold --scan --jsonNon-interactive write:
npx gh-scaffold -w
# preview:
npx gh-scaffold -w --dry-run --diffInteractive init (writes a config file too):
npx gh-scaffold initCommon usage
Preview what would change:
gh-scaffold -w --dry-run --diffOverwrite existing:
gh-scaffold -w --forcePresets (mainly for non-interactive/CI runs):
gh-scaffold -w --preset minimal
gh-scaffold -w --preset standard
gh-scaffold -w --preset strictLicense selection:
gh-scaffold -w --preset strict --license mit
gh-scaffold -w --preset strict --license apache-2.0
gh-scaffold -w --preset strict --license gpl-3.0Issue templates format:
gh-scaffold -w --issue-templates markdown
gh-scaffold -w --issue-templates formsUpdate mode (Markdown-only managed markers; doesn’t touch non-markdown files):
gh-scaffold -w --update --diffMonorepo scope:
gh-scaffold -w --scope root
gh-scaffold -w --scope packages
gh-scaffold -w --scope allOnly/skip certain targets:
gh-scaffold -w --only SECURITY,CONTRIBUTING
gh-scaffold -w --skip FUNDING,CODEOWNERSConfig file
Optional config locations:
gh-scaffold.yml.github/gh-scaffold.yml
Example:
preset: strict
issueTemplates: forms
license: mit
contacts:
supportUrl: https://github.com/OWNER/REPO/discussions
securityEmail: [email protected]
cocContact: [email protected]
ownership:
defaultOwners: ["@org/team"]
funding:
github: orgname
custom:
- https://example.com/sponsorCI enforcement
This repo includes an example workflow that fails PRs if essential files are missing:
.github/workflows/check-community-health.yml
Backward compatibility
gh-scaffold scanstill works (deprecated).gh-scaffold applystill works (deprecated).
Notes
- Templates are intentionally generic; customize to your project.
- Prefer committing generated files and reviewing diffs in PRs.
