CLI · module
cem add module
Scaffold a complete, domain-driven feature module — controller, service, model, route, validation, interface, constants — and auto-wire it into the router.
bash
# Single module
cem add module Task
# Batch — scaffold several at once
cem add module Task Category CommentYou'll be prompted for optional extras for each module:
📌 Include a constants file (ENUMs, search fields)? Yes
🛠️ Include a utils file for helper functions? NoWhat gets generated
src/app/modules/Task/
├── task.constant.ts
├── task.controller.ts
├── task.interface.ts
├── task.model.ts
├── task.route.ts
├── task.service.ts
└── task.validation.tsThe convention
Every file inside a module folder MUST be prefixed with the lowercase module name (e.g. task.controller.ts, not controller.ts). The architecture guard enforces this at build time.
Why this matters
- Searching
task.servicejumps straight to the right file. - No two modules can ever shadow each other's filenames.
- Code reviewers can pinpoint which module a stack trace came from instantly.
Removing modules
bash
cem remove module Task
cem remove module Task Category Review
cem rm module Task CategoryDeletes each module folder AND unwires their router imports from src/app/routes/index.ts. Missing modules are skipped with a warning.