Awesome
<h1 align="center">♨️ Node CLI Boilerplate</h1> <div align="center"> <p> A Node.js boilerplate with opinionated setup to help you kickstart your own CLI. </p> <img src="https://img.shields.io/github/license/boilertown/node-cli-boilerplate?style=flat-square" alt="MIT license" > </div>The Setup
- TypeScript
- Linting with Eslint and code formatting with Prettier
- Conventional commit messages with Commitlint
- Build with tsup
- Vitest for Unit test
- Automated release with changesets
Get Started
-
Use Boilertown CLI.
# npm npm create boilertown@latest -- -b node-cli-boilerplate # yarn yarn create boilertown -b node-cli-boilerplate # pnpm pnpm create boilertown -b node-cli-boilerplate # bun bun create boilertown/node-cli-boilerplate [cli-name]
-
Click the green "Use this template" button to generate a new repository with the same structure and files.
<img src="https://docs.github.com/assets/cb-36544/images/help/repository/use-this-template-button.png" alt="Use this template button" width="500">
Development
-
Run the app in development mode:
pnpm dev
-
Build the app:
pnpm build
-
Create changeset:
pnpm changeset
Release & Publish app
This boilerplate uses changesets to automatically generate CHANGELOG
, create releases and publish to NPM registry via GitHub Actions. You can see action details at release.yml.
To automating publish your app, follow these steps:
-
Create a
NPM_TOKEN
. See this article for more details. Make sure the type of access token is Automation. -
Follow this instruction to add the created token to your GitHub Actions secrets. Name of the secret is
NPM_TOKEN
. -
Install changeset bot.
P/S: Remember to check the Allow GitHub Actions to create and approve pull requests
in your repo Settings > Actions > General & scroll to Workflow permissions.
Contributing
node-cli-boilerplate ❤️ your contributions. If you have any ideas, suggestions, fixes, feel free to contribute.