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
cem add module TaskYou'll be prompted for optional extras:
📌 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 a module
bash
cem remove module TaskPrompts for confirmation, then deletes the entire module folder AND unwires its router from src/app/routes/index.ts.