advanced-nestjs-cli

CLI tool simplifies work with Nest.js

๐Ÿ› ๏ธ Advanced Nest.js CLI (ANC)

A powerful command-line tool to boost your productivity when working with NestJS projects.
Generate boilerplate code for DTOs and more โ€” cleanly, consistently, and fast.

Resources for CRUD controllers: controllers, services, DTOs and tests are usually very similar. This tool should help speed up the creation of the new CRUD controller in existing Nest.js project.

๐Ÿ“ฆ Installation

npm install -g advanced-nestjs-cli

๐Ÿš€ Usage

anc [command] [...args]

๐Ÿ“š Available Commands

Command Description
anc generate dto <name> [path] Generates DTO files for all CRUD operations
anc generate controller <name> [path] Generated Controller file with methods for all CRUD operations

๐Ÿ“ฆ Example

anc g dto user

This will generate:

create-user-request-body.dto.ts
create-user-response.dto.ts
delete-user-request-params.dto.ts
edit-user-request-body.dto.ts
edit-user-request-params.dto.ts
edit-user-response.dto.ts
get-user-request-params.dto.ts
get-user-response.dto.ts
user.dto.ts

You can also specify a custom path:

anc g dto product ./app/dtos/user

Note: path must lead to the existing folder

๐Ÿ’ก Features

  • ๐Ÿ”ง Fast and consistent DTO boilerplate generation
  • ๐Ÿงผ Follows NestJS file naming and structure conventions
  • ๐Ÿ’ผ CLI-first developer experience

๐Ÿ›  Roadmap

  • [ ] controller boilerplate generation for CRUD
  • [ ] Automatic annotations with @nestjs/swagger decorators of controller boilerplate
  • [ ] service boilerplate generation for CRUD
  • [ ] Support controller + service + dto generation (connected)
  • [ ] logger boilerplate generation
  • [ ] test boilerplate generation for CRUD
  • [ ] Migrate to typescript
  • [ ] Add linter
  • [ ] Full coverage with tests

๐Ÿค Contributing

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

๐Ÿ“„ License

MIT