A CLI tool to generate NestJS Projects, modules, controllers, services, and other components in a single line command.
The motivation is here.
If you have the NestJS CLI installed globally, nest-combo will automatically detect and use it to execute commands. This ensures compatibility with your existing global setup.
If the NestJS CLI is not installed globally, don't worry! nest-combo comes bundled with its own local version of the NestJS CLI. It will seamlessly fall back to this cached version to ensure smooth operation without requiring any additional setup from you.
- Load a full project from a YAML file.
- Create a new project and automatically open VsCode
- Generate NestJS modules, controllers, services, gateways, middleware, and interceptors with a single-line command.
- Support for optional flags like
--no-spec
and--dry-run
. - Colorful and user-friendly output using
chalk
. - Easy-to-use command-line interface.
Install the package globally using npm:
npm install -g nest-combo
Verify the installation by checking the version:
nest-combo --version
Run the CLI tool with the desired module name and options:
nest-combo <<project|module>-name> [options]
nest-combo my-amazing-project -new # "VSCode will open by default once it's done. If you don't want it just add -no-vscode"
nest-combo users -m -c -s -itc -g -mw # if you don't want spcec files, just add -ns or --no-spec
nest-combo -f project.yml
Flag | Description |
---|---|
-m, --module |
Generate a module |
-c, --controller |
Generate a controller |
-s, --service |
Generate a service |
-g, --gateway |
Generate a gateway |
-mw, --middleware |
Generate middleware |
-itc, --interceptor |
Generate an interceptor |
-ns, --no-spec |
Do not generate .spec.ts test files |
-dr, --dry-run |
Report actions that would be taken without writing out results |
-f, --file |
Create a project from a YAML file |
# YML example for loading a full project from scratch
nest-combo:
project-name: my-new-project
open-vscode: true # Open VSCode when the process is finished
package-manager: npm # npm | yarn | pnpm
dependencies:
- '@nestjs/config'
- '@nestjs/bull'
- 'class-transformer'
- 'class-validator'
- 'nestjs-twilio'
modules:
- name: core
resources:
- module
modules:
- name: user
resources:
- module
- controller
- service
options:
- --no-spec
modules:
- name: subUsers
resources:
- module
- controller
- service
options:
- --no-spec
- name: auth
resources:
- module
- controller
- service
- interceptor
- name: product
resources:
- module
- controller
- service
- name: payment
resources:
- module
- controller
- service
We welcome contributions! Here’s how you can help:
- Fork the repository and clone it locally.
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
- Make your changes and ensure everything works as expected.
- Commit your changes with a clear message:
git commit -m "Add feature: description of your changes"
- Push your branch to GitHub:
git push origin feature/your-feature-name
- Open a pull request on GitHub.
- Install dependencies:
npm install
- Test your changes locally:
npm link nest-combo users -m -c -s
This project is licensed under the MIT License. See the LICENSE file for details.
- Built with ❤️ using NestJS and Chalk.
- Inspired by the need for a faster and more efficient way to scaffold NestJS projects.
Feel free to customize this README.md
further to match your project's specific details or add additional sections (e.g., FAQs, roadmap). Let me know if you need any modifications! 🚀