Template for a CLI using TypeScript.
This CLI has only one command: init. In an interactive terminal it prompts for a project name and then prints a message with the name. When stdin or stdout is not a TTY it skips the prompt and uses my-project; use --name for scripted runs.
- Node.js 24.11+ - Runtime,
util.styleTextfor colors - Bun - Package Manager
- Clack - CLI Prompts
- Commander - CLI Framework
- TypeScript 7 - JavaScript with Syntax, via the native compiler
- Biome with Ultracite core preset - Linting and Formatting
- Zod - Validation
- tsdown - Bundler
- tsx - TypeScript runner
- Node.js
>=24.11.0 - Bun
1.4.3
TypeScript 7 is the native compiler. tsc --noEmit is the typecheck gate, and tsdown emits declarations through TypeScript 7's native compiler, which is currently experimental in tsdown, so declaration emit may print an experimental warning. TS 7 does not ship the legacy tsserver, so editors need native TypeScript 7 support (or a side-by-side TS 6 install for legacy editor tooling).
- Run
bun installto install dependencies. - Run
bun run devto execute the CLI (usingtsx).
build- Builds the CLI usingtsdown.build:silent- Builds the CLI usingtsdownwithout showing the output.check- Checks lint and formatting usingultracite.dev- Runs the CLI usingtsx.dev:node- Builds the CLI usingbuild:silentand executes it usingstart.doctor- Diagnoses theultracitesetup.fix- Applies safe lint and formatting fixes usingultracite.fix:unsafe- Applies unsafe lint and formatting fixes usingultracite.pub:beta- Builds the CLI usingbuildand publishes it to thebetatag.pub:next- Builds the CLI usingbuildand publishes it to thenexttag.pub:release- Builds the CLI usingbuildand publishes it to thelatesttag.start- Starts the CLI usingnode.test- Builds the CLI usingbuild:silentand runs the tests usingnode --test.typecheck- Checks the code usingtsc.