This is a template repository for building Node.js based CLI using TypeScript and esbuild.
- TypeScript: Write your server-side code using TypeScript for better developer experience and static typing.
- esbuild: A fast JavaScript bundler that allows for efficient bundling and building of your TypeScript code.
- Husky & Commitlint: Enforce commit message conventions with Husky and Commitlint to maintain a clean and standardized Git history.
- chalk.js: For better and colorful console message/error.
- @inquirer: For better CLI user experience.
Before you begin, ensure you have the following installed on your machine:
- Node.js(16.17.0+)
-
Clone the repository:
git clone https://github.com/mizok/cli-template.git
-
Install dependencies:
npm install
-
Automatic Setup
The
postinstall.ts
script automates the setup process by performing the following tasks:- Executes
npx husky install
to set up Husky. - Deletes the
postinstall
script from package.json. - Deletes the
postinstall.ts
script itself. - To execute this setup, it is automatically triggered during the installation process.
- Executes
-
To build CLI, use:
npm run build
-
To pack, run:
npm run pack
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, feel free to open an issue on the GitHub Issues page.