A template for building command-line interface (CLI) applications with TypeScript.
- TypeScript for type safety
- Comprehensive testing setup with Vitest
- Linting with ESLint, Biome, and Oxlint
- Build system with tsup
- Zod for runtime validation
- Proper error handling and exit codes
.
├── bin/ # CLI executable scripts
├── src/ # Source code
├── test/ # Test files
├── dist/ # Compiled output (generated)
├── tsconfig.json # TypeScript configuration
└── package.json # Project dependencies and scripts
- Clone this template
- Install dependencies:
pnpm install- Build the project:
pnpm build- Make the CLI executable:
chmod +x bin/cli-apppnpm startOr directly:
./bin/cli-app [arguments]pnpm testpnpm test:watchpnpm test:coveragepnpm lintpnpm typecheck- Update
package.jsonwith your project details - Modify
src/index.tswith your implementation - Update the CLI script in
bin/if needed - Add tests in the
test/directory
ISC