Skip to main content
Removing a module does more than delete a folder. The module:remove command tears down every place the module was wired into the project: it unregisters the module from AppModule and SharedModule, removes its path alias from the root tsconfig.json, then deletes the modules/<name>/ directory. Nothing is left dangling, no stale registrations and no orphan aliases. This is the mirror of module:create: whatever creation wired up, removal unwinds.

CLI command

Run the generator and it walks you through the removal. With no flags it prompts for the module name, then asks you to confirm before anything is deleted.
Removal is destructive. It deletes the entire modules/<name>/ directory: controllers, services, tests, and everything else inside it. Commit your work or branch first so the change is recoverable. The core app and shared modules are protected and cannot be removed, and asking to remove a module that does not exist is reported as an error.

What gets unregistered

When you remove a module, the command unwinds every registration that module:create set up: Because the registrations are removed before the directory is deleted, the project is left in a consistent state, with no references to a module that no longer exists.

Use with Claude and Codex

The generator ships a matching module:remove skill. It runs the command and confirms the removal with you before deleting anything. Initialize the skills once for your agent:
Then ask Claude in natural language, and it maps the request to the generator and runs it:
Prompt
For example, the prompt above maps to module:remove --name=billing, unregistering the module and deleting its directory after you confirm.