This is @andreww2012's personal generic TypeScript project template, powered by Bingo.
Create a new project in the my-project directory:
pnpm dlx @andreww2012/typescript-project-template --directory my-projectThe CLI asks for everything it can't infer. Template options:
--repository: repository name, also used as the package name (defaults to the directory name)--owner: GitHub user or organization (inferred from the GitHub CLI if you're logged in)--author:package.jsonauthor (defaults to--owner)--description: short description forpackage.jsonandREADME.md--kind:app(default) orlib, a published library: it's built with tsdown, its types are checked with attw before publishing,package.jsonisn't private and hashomepage,bugs,repository,exports,typesandfiles, and ESLint usesmode: 'lib'--changesets: only forlib,none(default),github(with@changesets/changelog-github) ordefault(with the default changelog format)--contributors: only forlib,no(default) oryesto set up all-contributors--node: the lowest Node.js major version to support, out of those inengines.nodeof this repository (the lowest one by default);@types/nodeandtarget/libintsconfig.jsonmatch it--pnpm:12(default) or11--formatter:oxfmt(default) orprettier--tools: comma-separated tools to set up:knip,cspell,commitlint,lefthook(these are the default) andvitest--languages: only withcspell, comma-separated extra CSpell languages, none by default:en-GB,nl,fr,de,it,pl,pt,ru,es,tr,uk--updater: dependency updater,ncu(default, run by hand),dependabot,renovateornone--ci:yes(default) to set up GitHub Actions like in this repository (checks for every chosen tool, tests on every supported Node.js version, and the changesets release), orno--lychee: only with--ci yes,no(default) oryesto check links with lychee in CI--utils: utility library to install,@andreww2012/unutils(default) ornone
Outside of an interactive terminal (for example in CI), pass all options that have a default, because the CLI can't ask for them there.
Add --remote to also create the repository on GitHub.
See the Bingo CLI docs for all other flags.
After that, install the dependencies and go through the setup checklist in the new README.md.
Create a repository from this template on GitHub, clone it and run the same command inside it (without --directory).
Bingo sees that the repository was created from this template, removes the template files and creates the project in their place.
Running the command inside an existing git repository updates it to the latest template version (Bingo's "transition" mode).
It overwrites files with the template versions, including package.json and README.md, so review the changes with git diff before committing.
The files of new projects live in template/.
They are completely independent from the files of this repository, which only builds and publishes the CLI:
the tools here (ESLint, Prettier, CSpell, knip and so on) ignore template/ and use their own configs.
Files in template/ are copied as is, except the parts that depend on the options.
Such parts are wrapped in comment lines, which are removed from the result:
// @if oxfmt
import oxfmtConfig from './oxfmt.config.js';
// @endif@if !feature keeps the lines when the feature is not used, and # and <!-- --> comments work too.
A feature is an option value (like lib, oxfmt or knip), pnpm11/pnpm12, changesets, changelog-github or a CSpell language code.
Which files, package.json scripts and dependencies need which features is listed in src/template.ts.
template/package.json lists all dependencies that might be needed, so that ncu keeps all of them up to date.
That includes @types/node for every supported Node.js major version, with aliases like "@types/node24": "npm:@types/node@24.19.1".
The oxfmt version is in the format catalog of template/pnpm-workspace.yaml, because the ESLint plugin that formats Markdown code blocks must use the same version.
These files are also changed:
package.json: name, description and author come from the options, andengines.nodecomes frompackage.jsonof this repository.github/actions/prepare/action.ymland.github/workflows/ci.yml: Node.js versions match the supported onestsconfig.json:targetandlibmatch the lowest supported Node.js version, like in@tsconfig/basespnpm-workspace.yaml: theallowBuildsentry of lefthook gets its version fromtemplate/package.jsonREADME.md: gets the project name and description on topLICENSE.md: gets the current year and the authorcspell.config.ts: gets the extra languages.changeset/config.json: gets the changelog format
Files ignored by git are skipped.
Symlinks (like .claude/skills) are created again with ln -s, because npm packages can't contain them.
The lockfile isn't part of the template, so dependencies are resolved on the first install.
The CLI code is in src/:
src/options.tsdescribes the optionssrc/prompts.tsasks the questions Bingo can't ask on its own (conditional and multi-select ones), before Bingo startssrc/template.tsdescribes how the files are changed
nr build saves the files from template/ into dist/files.json and compiles the CLI.
It runs automatically before publishing.
The pnpm 11 version isn't stored in any package.json, so update it in src/template.ts by hand.
To try the template from source:
nr dev --directory ../my-test-project