advanced-nestjs-cli
CLI tool simplifies work with Nest.js
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.
npm install -g advanced-nestjs-cli
anc [command] [...args]
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 |
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
- ๐ง Fast and consistent DTO boilerplate generation
- ๐งผ Follows NestJS file naming and structure conventions
- ๐ผ CLI-first developer experience
- [ ]
controller
boilerplate generation for CRUD - [ ] Automatic annotations with
@nestjs/swagger
decorators ofcontroller
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
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.
MIT