Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RajaRakoto/cli-boilerplate
Minimalistic boilerplate to quick-start CLI development with Inquirer.js in TypeScript ๐
https://github.com/RajaRakoto/cli-boilerplate
boilerplate cli inquirer inquirerjs minimalist starter template typescript
Last synced: 3 months ago
JSON representation
Minimalistic boilerplate to quick-start CLI development with Inquirer.js in TypeScript ๐
- Host: GitHub
- URL: https://github.com/RajaRakoto/cli-boilerplate
- Owner: RajaRakoto
- License: mit
- Created: 2024-02-27T14:58:34.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-08-08T14:18:19.000Z (3 months ago)
- Last Synced: 2024-08-09T12:26:57.745Z (3 months ago)
- Topics: boilerplate, cli, inquirer, inquirerjs, minimalist, starter, template, typescript
- Language: TypeScript
- Homepage:
- Size: 404 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cli-boilerplate ๐
[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/for-you.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/open-source.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/uses-git.svg)](https://forthebadge.com) [![forthebadge](https://github.com/RajaRakoto/github-docs/blob/master/badge/build-by.svg?raw=true)](https://forthebadge.com)
![Git](https://img.shields.io/badge/-Git-777?style=flat&logo=git&logoColor=F05032&labelColor=ffffff) ![Gitub](https://img.shields.io/badge/-Gitub-777?style=flat&logo=github&logoColor=777&labelColor=ffffff)
**Developer Ready: A versatile template designed to jumpstart CLI development in TypeScript - Engineered to seamlessly integrate with various CLI projects, ensuring smooth compatibility with a pre-configured environment**
Instant Value - All basic tools included and configured:
- ๐ Typescript >= 5.3
- ๐ง Bun.js >= 1.0.26
- ๐ง Use Bun as package manager
- ๐ ESM
- ๐งช Biome for code formatting and linting
- โ Jest or Bun test for fast unit testing and code coverage
- ๐ Type definitions for Bun.js and Jest
- โ๏ธ EditorConfig for consistent coding style
- ๐ฆ NPM scripts for common operations
- ๐ ๏ธ Example configuration for GitHub Actions
- ๐ Simple example of TypeScript code and unit test
- ๐ Run tasks with Grunt (example for backup)
- ๐ Build faster
- ๐ฅ๏ธ Ungit for version control (git) with a GUI
- ๐งช A lightweight private npm proxy registry with Verdaccio, useful for testing your CLI
- ๐ณ Inquirer.js - A collection of common interactive command line user interfaces
- ๐ณ Execa - A process execution library that supports synchronous and asynchronous execution of child processes
- ๐ณ Figlet - A program that generates text banners, in a variety of typefaces, composed of letters made up of conglomerations of smaller ASCII characters
- ๐ณ Node-emoji - A library that provides a simple way to use emojis in your CLI
- ๐ณ Ora - A terminal spinner library that allows you to add a loading spinner to your CLI
- ๐ณ Chalk - A library for styling terminal strings with colors and text styles---
### ๐ Usage
To use this template, use the following commands:
```bash
bun create github.com/RajaRakoto/cli-boilerplate
cd
bun run pkg-upgrade # to upgrade outdated dependencies in interactive mode
```> NOTE 1: I employ the `MIT license` for this starter kit, which includes my name and GitHub profile. Please remember to adjust or remove it if deemed unnecessary.
> NOTE 2: In order to help you better understand the structure of this boilerplate, there is a `README.md` file in each subdirectory of src.
> NOTE 3: For certain configurations in the `package.json` file, you need to modify them to tailor them to your project (e.g: name, description, author, keywords, main, repository, ...).
---
### ๐ NPM Scripts
**Start**
- ๐ `start` - Run your application with bun.
- ๐ `start:smol` - Run your application with bun and a flag which configures the JavaScriptCore heap size to be smaller and grow slower.
- ๐ `start:bin` - Run your standalone binary app.**Clean**
- ๐ `clean` - Remove coverage data, prod, build.
**Development**
- ๐ `dev` - Launch your application in development mode with bun.
- ๐ `dev:watch` - Interactive watch mode to automatically transpile source files with bun in development.
- ๐ `dev:hot` - Hot reloading of source files with bun in development.
- ๐ `dev:smol:watch` - Interactive watch mode to automatically transpile source files with bun in development, while using --smol flag.
- ๐ `dev:smol:hot` - Hot reloading source files with bun in development, while using --smol flag.**Build**
- ๐ `build` - Transpile and bundle source files with bun.
- ๐ `build:watch` - Interactive watch mode to automatically transpile source files with bun.
- ๐ `build:bin` - bun's bundler implements a --compile flag for generating a standalone binary from a TypeScript or JavaScript file, use this in your production environment to ensure optimal execution of your app.**Testing**
- ๐ `test` - Run bun test.
- ๐ `test:watch` - Interactive watch mode to automatically re-run tests with bun.**Linting and Formatting**
- ๐ `biome:start` - Starts the Biome daemon server. You can specify a custom configuration file path using the `--config-path` option.
- ๐ `biome:stop` - Stops the Biome daemon server.
- ๐ `biome:fix` - Runs a source code check and applies automatic fixes (linter & formatter) according to the defined rules.
- ๐ `biome:unsafe` - Works like `biome:fix`, but may apply more invasive or risky changes.**Backup and Dependency Management**
- ๐ `backup` - Backup files with Grunt.
- ๐ `pkg-check` - Check useless dependencies with depcheck.
- ๐ `pkg-upgrade` - Upgrade outdated dependencies (interactive mode) with npm-check-updates.**Versioning**
- ๐ `versioning` - Start ungit server.
**NPM Commands**
- ๐ `npm-version:major` - Increments the major version number of your project using npm.
- ๐ `npm-version:minor` - Increments the minor version number of your project using npm.
- ๐ `npm-version:patch` - Increments the version patch number of your project using npm.
- ๐ `npm-login` - Login to a registry user account.
- ๐ `npm-publish` - Publish your npm package with public access.
- ๐ `npm-unpublish` - Forcefully unpublish the cli package from npm.
- ๐ `npm-reset:registry` - Delete the custom npm registry.
- ๐ `npm-check:registry` - Get the currently configured registry for npm.
- ๐ `npm-proxy-set:registry` - Set the npm registry to use a local proxy.
- ๐ `npm-proxy:start` - Start a Verdaccio server with a local npm proxy.
- ๐ `npm-proxy:publish` - Publish your npm package via the local proxy.
- ๐ `npm-proxy:unpublish` - Forcefully unpublish the cli package from the npm registry via the local proxy.
- ๐ `npm-proxy:republish` - Republish your npm package by first unpublishing it and then publishing it again via the local proxy.**NVM**
- ๐ `nvm` - Manage multiple node.js versions. Easily switch between node versions per project to ensure compatibility.
---
### ๐ Build
When using the **build.js** file in this boilerplate, it's important to note the significance of the **target** option. By default, if the target option is not specified in the **build.js** file, it will be set to `browser`. However, for projects utilizing the `bun.js` runtime environment, it's imperative to explicitly set the target to `bun`. This guarantees compatibility with the `bun` shell environment and prevents unexpected behavior. Furthermore, it's noteworthy that the `target` supports three possible values: `browser`, `bun`, and `node`, providing flexibility in defining the build target according to specific project requirements.
---
### ๐ Similar
You can also check out my other starter projects:
- ๐ [node-boilerplate](https://github.com/RajaRakoto/node-boilerplate)
- ๐ [bun-boilerplate](https://github.com/RajaRakoto/bun-boilerplate)
- ๐ [react-boilerplate](https://github.com/RajaRakoto/react-boilerplate)
- ๐ [next-boilerplate](https://github.com/RajaRakoto/next-boilerplate)
- ๐ [qwik-boilerplate](https://github.com/RajaRakoto/qwik-boilerplate)
- ๐ [vscode-boilerplate](https://github.com/RajaRakoto/vscode-boilerplate)