A modern CLI tool that creates production-ready TypeScript projects with opinionated but flexible configuration. Generate complete project boilerplates with modern tooling and best practices in seconds.
# Install globally
npm i -g typescript-project-generator
# Generate a new project
tpg
- Test Framework Choice: Interactive selection between Jest and Vitest
- Modern Standards: ES2022 target with strict TypeScript configuration
- Enhanced Validation: Strict project name validation (lowercase, numbers, hyphens)
- Node.js v18+: Required for optimal performance and modern features
- Biome Integration: Ultra-fast linting and formatting out of the box
- TypeScript: ES2022 target with strict configuration
- Test Framework: Choose between Jest or Vitest during setup
- Biome: Modern linter and formatter (replaces ESLint + Prettier)
- Docker: Production-ready Dockerfile with dynamic Node.js version
- GitHub Actions: Complete CI/CD workflows
Your generated project includes all essential files:
.env
- Environment variables templatebiome.json
- Modern linter and formatter configuration.biomeignore
- Files to exclude from Biome processing.gitignore
- Git ignore patternsCHANGELOG.md
- Project changelog templateDockerfile
- Production-ready container configurationjest.config.ts
orvitest.config.mts
- Test framework configurationLICENSE
- Your chosen license filepackage.json
- Project dependencies and scriptsREADME.md
- Comprehensive project documentationtsconfig.base.json
- Base TypeScript configurationtsconfig.json
- Main TypeScript configurationsrc/index.ts
- Main application entry pointtest/index.test.ts
- Initial test file.github/workflows/
- Complete CI/CD pipeline
The generator guides you through a comprehensive setup with the following prompts:
- Project name - Validates lowercase, numbers, and hyphens only
- Description - Brief project description
- Keywords - Tags for package.json discoverability
- Author name - Your name for package.json and LICENSE
- GitHub username - For repository URLs and package.json
- License type - Choose from popular licenses (MIT, Apache-2.0, GPL-3.0, etc.)
- Package manager - npm, yarn, or pnpm support
- Test framework - NEW! Choose between Jest or Vitest
- Default port - For server applications (optional)
- GitHub repository - Repository name for CI/CD integration
- Heroku deployment - Optional CD workflow for Heroku
Jest (Traditional)
- Mature and stable testing framework
- Extensive ecosystem and community support
- Zero-config setup for most TypeScript projects
- Built-in code coverage and mocking
Vitest (Modern)
- Ultra-fast test execution with native ES modules
- Vite-powered with instant HMR during testing
- TypeScript-first design and configuration
- Modern API with Jest-compatible assertions
After completing setup, your project will have this structure:
📂.github
┣ 📂workflows
┣ 📜lint.yml
┗ 📜test.yml
📂src
┗ 📜index.ts
📂test
┗ 📜index.test.ts
📜.biomeignore
📜.dockerignore
📜.env
📜.gitignore
📜biome.json
📜CHANGELOG.md
📜Dockerfile
📜jest.config.ts OR vitest.config.mts
📜LICENSE
📜package.json
📜README.md
📜tsconfig.base.json
📜tsconfig.json
📜pnpm-lock.yaml (or package-lock.json or yarn.lock)
After generation, git
will be initialized and dependencies will be installed based on your chosen package manager.
- Node.js v18 or higher - Required for optimal performance and modern features
- Internet connection - For installing packages and fetching license content
- Git - For repository initialization
This tool is designed to be installed globally to create new projects anywhere on your system.
npm i -g typescript-project-generator
Run the generator from any directory where you want to create your new project:
tpg
The interactive CLI will guide you through the complete setup process with modern validation and helpful prompts.
@biomejs/biome
- Modern linter and formatter@types/node
- Node.js type definitionsdotenv
- Environment variable managementnodemon
- Development file watcherts-node
- TypeScript execution for Node.jstsconfig-paths
- Path mapping supporttypescript
- TypeScript compiler
When choosing Jest:
When choosing Vitest:
If you're upgrading from a previous version of TPG:
- ESLint → Biome: Projects now use Biome for faster linting and formatting
- Jest vs Vitest: New projects can choose their preferred test framework
- ES2022: Updated TypeScript target for modern JavaScript features
- Node.js v18+: Minimum version requirement for security and performance
Yes, it used to. But that approach has been deprecated in favor of my new backend framework, Simba.js.
- Anthony Luzquiños - Initial Work - Documentation - AnthonyLzq.
- Andree Anchi - Bug reports - andreewaD.