Skip to content

devotox/typescript-cli-template

Repository files navigation

TypeScript CLI Template

A template for building command-line interface (CLI) applications with TypeScript.

Features

  • 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

Project Structure

.
├── bin/            # CLI executable scripts
├── src/            # Source code
├── test/           # Test files
├── dist/           # Compiled output (generated)
├── tsconfig.json   # TypeScript configuration
└── package.json    # Project dependencies and scripts

Getting Started

  1. Clone this template
  2. Install dependencies:
pnpm install
  1. Build the project:
pnpm build
  1. Make the CLI executable:
chmod +x bin/cli-app

Development

Running the Application

pnpm start

Or directly:

./bin/cli-app [arguments]

Running Tests

pnpm test

Running Tests in Watch Mode

pnpm test:watch

Checking Code Coverage

pnpm test:coverage

Linting

pnpm lint

Type Checking

pnpm typecheck

Customization

  1. Update package.json with your project details
  2. Modify src/index.ts with your implementation
  3. Update the CLI script in bin/ if needed
  4. Add tests in the test/ directory

License

ISC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published