create-klee-node-ts-cli

Scaffold a Node.js + TypeScript CLI project (tsx + tsconfig from the klee template).


Keywords
cli, scaffold, scaffolding, typescript, node, tsx, template
License
MIT
Install
npm install create-klee-node-ts-cli@1.0.1

Documentation

create-klee-node-ts-cli

Scaffold a Node.js + TypeScript CLI project, based on the klee template (tsx + typescript@6 + the strict tsconfig.json from E:\WebProgs\nott).

Usage

# interactive (prompts for project name)
npx create-klee-node-ts-cli

# with a project name
npx create-klee-node-ts-cli my-cli

# skip all prompts / install deps / overwrite
npx create-klee-node-ts-cli my-cli --yes
npx create-klee-node-ts-cli my-cli --install        # prompts: pnpm or npm?
# pick the package manager non-interactively
npx create-klee-node-ts-cli my-cli --install --pm pnpm
npx create-klee-node-ts-cli my-cli --install --pm npm
npx create-klee-node-ts-cli my-cli --force

# scaffold into the current directory
npx create-klee-node-ts-cli .

What you get

my-cli/
├── package.json         # name injected; scripts.dev = "tsx src/index.ts"
├── tsconfig.json        # strict, es2022, rootDir=src, outDir=dist
├── pnpm-workspace.yaml  # pnpm settings (allowBuilds: esbuild)
├── .gitignore
└── src/
    └── index.ts         # hello world
cd my-cli
pnpm install    # or npm install
pnpm run dev    # run src/index.ts with tsx
pnpm tsc        # compile to ./dist

When installing dependencies, the CLI asks whether you want to use pnpm; if you say no (or pnpm is unavailable), it falls back to npm. Pass --pm pnpm / --pm npm to skip the question. If you choose pnpm and it is not installed, the CLI installs it globally (npm install -g pnpm) first.

Local development

npm link                 # link the CLI globally
create-klee-node-ts-cli my-cli
# or run directly without linking:
node bin/index.js my-cli

Publish

npm publish              # then it works via npx create-klee-node-ts-cli

The CLI is dependency-free (Node >= 18 built-ins only), so npx installs instantly. Templates live in templates/ and are shipped via the files field in package.json.