Interactive CLI to scaffold standardized frontend project templates (with optional CI/Release workflows).
Node.js >= 22
# If published on npm:
npm i -g frontpl
# or
pnpm add -g frontpl
# Or run once via npx:
npx frontpl --helpfrontpl my-frontend
# or
frontpl init my-frontendFollow the prompts to choose:
- Package manager (
npm/pnpm/yarn/bun/deno) - Optional tooling:
oxlint,oxfmt,vitest,tsdown
When oxlint is enabled, generated projects use @kingsword/lint-config via oxlint.config.ts.
- Git init
- GitHub Actions workflows:
- CI only
- CI + release (release supports tag/commit/both)
Scaffold a new project into ./<name> (or prompt for a name when omitted).
Generated output includes (based on options):
.editorconfig,.gitignore,.gitattributespackage.json(+ scripts like optionallint,format:check,test,build)tsconfig.json,src/index.ts- Optional configs:
oxlint.config.ts,.oxfmtrc.json,tsdown.config.ts - Optional GitHub Actions workflows in
.github/workflows/
Add or update CI/Release workflows for an existing project (run it in your repo root).
What it does:
- Detects the package manager via
package.json#packageManageror lockfiles - Suggests a
workingDirectory(supports monorepo layouts likepackages/*/apps/*) - Detects Node.js major version from
.nvmrc,.node-version, orpackage.json#engines.node(defaults to22) - Generates
.github/workflows/ci.yml - Optionally generates
.github/workflows/release.yml(tag/commit/both) - Optionally generates
.github/dependabot.ymlwith grouped updates (dependencies,github-actions)
frontpl generates workflows that call reusable workflows from kingsword09/workflows (pinned to commit SHA + # vX.Y.Z comment by default):
- CI:
cli-ci.yml - Release (tag, recommended):
cli-release-tag.yml - Release (commit, legacy):
cli-release.yml
- Tag (recommended): trigger on tag push (
vX.Y.Z), validatepackage.json#versionmatches the tag. - Commit (legacy): trigger on
mainpush, publish only when the commit message matcheschore(release): vX.Y.Z(also supportschore: release vX.Y.Z), and the workflow will create/push the tag. - Both: a single
release.ymllistens to bothmainandtags, and routes to the corresponding reusable workflow.
- Trusted publishing (OIDC): enable
trustedPublishing: true(noNPM_TOKENrequired). Your repo must be configured on npm as a trusted publisher for the calling workflow. - NPM token: set
trustedPublishing: falseand provideNPM_TOKENin GitHub secrets.
When CI workflows are enabled, frontpl can also generate .github/dependabot.yml:
- Keeps
github-actionsupdates enabled - Adds grouped dependencies updates (
groups.dependencies) - Uses the selected
workingDirectory(.->/, monorepo package ->/packages/<name>) - Maps JavaScript package managers (
npm/pnpm/yarn/bun) to Dependabotpackage-ecosystem: "npm"
pnpm install
pnpm run lint
pnpm run build
node dist/cli.mjs --help
node dist/cli.mjs ciThis repository itself uses @kingsword/lint-config (see oxlint.config.ts).