node-ts-cli
Generate new Node.js CLI tool projects using TypeScript with ESM modules, tsc for building, tsx for development, Biome for linting/formatting, and Node's built-in test runner. Use this skill when the user requests to create a new Node TypeScript CLI project or CLI tool.
When & Why to Use This Skill
The Node TypeScript CLI Generator is a specialized Claude skill designed to accelerate software development by scaffolding complete, production-grade Node.js command-line tool projects. It automates the entire setup process—including Git initialization, ESM configuration, and dependency management—using a modern tech stack featuring TypeScript, Biome, and Node's native test runner. This skill ensures developers can bypass repetitive boilerplate tasks and start building core CLI logic with best practices already in place.
Use Cases
- Rapidly bootstrapping a new TypeScript-based command-line interface (CLI) with pre-configured build and development scripts.
- Setting up a standardized Node.js project environment that utilizes ESM modules and modern tooling like Biome for linting and formatting.
- Creating interactive CLI tools with integrated UI components using the @clack/prompts library for better user experiences.
- Developing test-driven CLI applications leveraging Node.js's built-in testing framework to ensure code reliability without extra overhead.
| name | node-ts-cli |
|---|---|
| description | Generate new Node.js CLI tool projects using TypeScript with ESM modules, tsc for building, tsx for development, Biome for linting/formatting, and Node's built-in test runner. Use this skill when the user requests to create a new Node TypeScript CLI project or CLI tool. |
Node TypeScript CLI Generator
Overview
Generate production-ready Node.js CLI tool projects configured with TypeScript, ESM modules, and modern tooling. Each generated project includes a complete setup with build scripts, development workflow, testing, and linting.
When to Use This Skill
Use this skill when the user requests:
- "Create a new Node TypeScript CLI tool"
- "Generate a CLI project in TypeScript"
- "Set up a new TypeScript CLI"
- "Make me a Node.js command-line tool"
Project Setup
Quick Start
To generate a new CLI project:
- Specify the project name and desired CLI command name.
- The skill will create a new directory unless specified otherwise.
- Inside the directory, the skill will perform the following steps:
- Initialize a new Git repository.
- Run
npm init -yto initialize a new npm project. - Run
npm i -D typescript @types/node @biomejs/biometo install dev dependencies. - Run
npm i @clack/promptsto install runtime dependencies. - Run
npx tsc --initto create atsconfig.jsonfile. - Run
npx biome initto create abiome.jsonfile. - Set up the
package.json,tsconfig.json, andbiome.jsonfiles with the appropriate configurations. - Create the necessary source files in
src/includingindex.tswith a basic CLI structure using the@clack/promptslibrary. - Create example test files in
src/to demonstrate testing with Node's built-in test runner. - Add npm scripts for building, developing, testing, linting, and formatting.
- Inform the user about the available npm scripts
Technology Stack
The generated project uses:
- TypeScript with strict mode enabled
- ESM modules (type: "module")
- tsc for building production builds to
./dist - tsx for running TypeScript directly in development
- Biome for fast linting and formatting
- Node's built-in test runner with TypeScript support via
--experimental-strip-types
Available NPM Scripts
Each generated project includes these scripts:
npm run build- Compile TypeScript to JavaScript in./distnpm run dev- Run the CLI in development mode with tsxnpm run test- Run tests with Node's built-in test runnernpm run lint- Check code with Biomenpm run lint:fix- Fix linting issues automaticallynpm run format- Format code with Biome
Project Configuration
package.json
- Configured as ESM with
"type": "module" - Includes
binfield for CLI installation - Main entry points to
./dist/index.js
tsconfig.json
- Target: ES2022
- Module: ESNext with bundler resolution
- Outputs to
./dist, sources from./src - Strict mode enabled
- Generates declaration files and source maps
biome.json
- Enables linting with recommended rules
- Configured to format code on save
CLI Entry Point Structure
The template src/index.ts includes:
- Shebang for executable scripts (
#!/usr/bin/env node) - Argument parsing with help and version flags for non-interactive use
- Interactive prompts using
@clack/prompts - Async main function with error handling
- Process exit codes for proper CLI behavior
Customization After Generation
After generating a project, users should:
- Update
nameanddescriptioninpackage.json - Update the
bincommand name inpackage.json - Set the
authorandlicensefields - Update version number in both
package.jsonandsrc/index.tsshowVersion() - Modify
src/index.tswith their CLI logic - Update the README with specific usage instructions
Installation for Users
After building the project, users can:
- Run locally:
node dist/index.js - Install globally:
npm install -g .then use the bin command - Publish to npm and install:
npm install -g package-name
Example Usage
When a user says: "Create a new TypeScript CLI tool called todo-manager"
- Run the project generation steps outlined above
- Update
package.json:- Change
"name"to"todo-manager" - Update
"description"appropriately - Change
binto"todo-manager": "./dist/index.js"
- Change
- Update README.md with the project name
- Run
npm installin the project directory - Inform the user: "Project created! Run
npm run devto start developing, ornpm run buildto compile."