@trapar-waves/cli-template

中文 | 日本語 | Русский язык
A CLI development template powered by modern tooling, integrating TypeScript, tsup for builds, consola for logging, and other core components to accelerate high-quality CLI project setup.
✨ Features
- CLI Toolchain: Integrates
ts-node
(for direct TypeScript execution during development) and tsup
(for production-grade builds), supporting the full workflow from debugging to deployment.
- TypeScript Support: Full TypeScript configuration (including
tsconfig.json
) with type checking and auto-completion to ensure code maintainability.
- Structured Logging: Implements leveled logging (info/warn/error), custom formatting, and context-aware messages via
consola
to enhance debugging efficiency.
- Data Parsing: Built-in
destr
for safe parsing of JSON-like data (e.g., CLI arguments, config files), preventing exceptions from JSON.parse
.
- Terminal Styling: Uses lightweight
picocolors
for cross-platform terminal color support (160+ color codes) and styles (bold/underline) to improve CLI interactivity.
- Code Quality: Integrated ESLint (based on
@antfu/eslint-config
) for automated code style checks, error detection, and best practice enforcement.
- Rapid Builds:
tsup
default configuration supports ESM output, source maps, and type declaration generation, with 30%+ faster build times compared to traditional tools.
💻 Tech Stack
- Language:
TypeScript
: Typed superset of JavaScript with static type checking and modern syntax.
- Build Tool:
tsup
: Fast bundler based on esbuild, supporting ESM, CommonJS, and type declaration outputs.
- Logging:
consola
: Structured logging library with leveled messages, custom themes, and context support.
- Data Handling:
destr
: Safe parser for JSON-like strings (e.g., CLI arguments) to prevent JSON.parse
errors.
- Terminal Styling:
picocolors
: Lightweight cross-platform terminal color library with 160+ color codes and styles (bold/underline).
- Code Linting:
ESLint
+ @antfu/eslint-config
: Modern JavaScript/TypeScript linting rules with auto-fix for style and error issues.
- Package Manager:
pnpm
: Content-addressable package manager with faster installs and reduced disk usage (see pnpm-lock.yaml
).
See the package.json for a full list of dependencies.
🚀 Getting Started
Follow these instructions to get the project running locally.
Prerequisites
Ensure you have the following installed:
- Node.js (>= 18.x recommended)
- Package manager (npm, yarn, or pnpm)
node -v
npm -v
Installation
Run script
pnpm create trapar-waves
Install dependencies
npm install
yarn install
pnpm install
🤝 Contributing
Contributions are welcome and greatly appreciated! Please follow these steps to contribute:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add some amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
👤 Author
🔗 Links