clean-nestjs-cli
v2.2.1
Published
A command-line interface tool designed to streamline the creation and management of Nest projects following Clean Architecture principles.
Downloads
143
Readme
Description
A command-line interface tool designed to streamline the creation and management of Nest projects following Clean Architecture principles.
Installation
npm install -g clean-nestjs-cliOr
yarn global add clean-nestjs-cliOr
pnpm add -g clean-nestjs-cliGlobal Options
-v, --version: Outputs the current version of the CLI.
Example:
clean-nest -v-h, --help: Displays help with all available commands and their options.
Example:
clean-nest -hUsage
After installation, you can access the CLI using the clean-nest or cnest command.
cnest <command> [options]Available Commands
new <project-name> [options]
Creates a new project with a clean and structured setup.
Alias: n
cnest new my-new-projectOptions:
--no-linters: Disables linters (enabled by default).Example:
cnest new my-new-project --no-linters
generate <schematics> <module> [resource] [options]
Generates a new element in your project, such as modules or resources.
Alias: g
cnest generate module userAvailable schematics: [module|mo, repository|rp, use-case|uc]
Options:
--path <path>: Specifies the destination directory inside the/src/modulesfolder. The default path is the module root (/).Example:
cnest generate module user --path auth--no-spec: Do not generate a spec filesExample:
cnest generate use-case user find-all --no-spec
Folder Structure
When using the new command, a Nest project with the following clean structure will be created:
my-new-project/
├──src/
│ ├── modules/
│ │ ├── module-example/
│ │ │ ├── models/
│ │ │ │ ├── dtos/
│ │ │ │ ├── entities/
│ │ │ │ ├── interfaces/
│ │ │ │ ├── enums/
│ │ │ ├── repositories/
│ │ │ ├── use-cases/
│ │ │ │ ├── use-case-example-1/
│ │ │ │ └── use-case-example-2/
│ ├── app.module.ts
│ ├── main.ts
│ ├── shared/
│ │ ├── databases/
└── ...Contribution
Contributions are welcome! Feel free to open issues and pull requests on the official repository.
Author
Jheison Novak
License
Copyright © 2024, Jheison Novak. Released under the MIT License.
