A CLI tool to generate starter project templates for various programming environments (e.g., Node.js, NestJS, Deno). It supports custom project configurations via flags, with an optional interactive mode for guided setup.
- Generate project templates for multiple types of projects (Node.js, NestJS, Rust, Deno etc.).
- Configure project options through command-line flags.
- Use an interactive mode for step-by-step guided setup.
- Optionally include linters (e.g., ESLint, Biome) for project configurations.
To install and use this CLI tool, you can either compile it from source or install it via a package manager (if available).
# Clone the repository
git clone https://github.com/tduyng/starterkit-cli.git
# Navigate to the project directory
cd starterkit
# Build the project using Cargo
cargo build --release
# The binary will be located in target/release/starterkit
To build the project directly from a Git repository, you can use the following steps:
cargo install --git https://github.com/tduyng/starterkit-cli.git
The CLI supports several flags for creating projects with different configurations. You can use it in two modes:
- Non-Interactive Mode: Specify options through flags and generate the project immediately.
- Interactive Mode: Use the
--interactive
flag for a guided, step-by-step project generation.
starterkit [OPTIONS]
Flag | Description | Example |
---|---|---|
-n, --project-name <NAME> |
Set the name of the project. Default: new_project . |
--project-name my_project |
-t, --project-type <TYPE> |
Specify the type of project to generate. Options include nodejs , nestjs , rust . |
--project-type nodejs |
--output-path <PATH> |
Set the directory where the project should be created. Default is the current directory (. ). |
--output-path /path/to/projects |
--linter <LINTER> |
Include a linter in the project. Available linters: eslint, , biome . |
--linter eslint |
-i, --interactive |
Enable interactive mode for guided setup. | --interactive |
-h, --help |
Display help information about the CLI. | starterkit -h |
-V, --version |
Display the version of the CLI. | starterkit -V |
Generate a Node.js project with the name my_node_project
in the current directory:
starterkit --project-name my_node_project --project-type nodejs
This will create a project named my_node_project
using the default settings for a Node.js project (Typescript + Eslint)
Generate a Rust project with the name my_rust_project
, including the Biome
linter, and specify the output directory as /projects/rust
:
starterkit --project-name my_rust_project --project-type rust --linter biome --output-path /projects/rust
This will create a Rust project with biome
configured as the linter in the specified directory.
If you prefer a guided setup, you can use the interactive mode. This will prompt you for the project name, type, and additional settings:
starterkit --interactive
You will be prompted with a series of questions like:
- Enter the project name (default:
new_project
) - Select the project type (e.g.,
nodejs
,nestjs
,rust
,deno
) - Select a linter (optional)
Defines the name of the project to generate. If not provided, the default value is new_project
.
Specifies the directory where the project should be generated. By default, it creates the project in the current directory (.
).
This flag defines the type of project to create. Supported types include:
nodejs
: Node.js project templatenestjs
: NestJS project templaterust
: Rust project template
This flag allows you to specify which linter to include in the project. Supported linters are:
eslint
: A configuration combining ESLint and Prettier for JavaScript/TypeScript projects.biome
: A newer, faster linter with support for JavaScript and TypeScript projects.
If not specified, no linter is added to the project.
If this flag is passed, the tool will enter interactive mode, where you will be prompted for the necessary information to create the project. This mode is useful if you are unsure about the project configuration or want step-by-step guidance.
Displays a help message describing the available flags and how to use them.
Displays the current version of the CLI tool.
If you would like to contribute to the development of this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear messages.
- Push your changes to your fork and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
When using --interactive
, the CLI will guide you through a series of questions, like so:
$ starterkit --interactive
Welcome to the project generator!
Welcome to the project generator!
✔ Enter the project name · new_project
? Select project type:
◯ nodejs
◯ nestjs
◉ rust
◯ deno
? Select linter:
◯ eslint
◉ biome
? Enter the output path (default: current directory): .
Project details:
Project Name: new_project
Selected Project Type: rust
Selected Linter: Biome
Output Path: .
Creating your project...