> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ooneex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove a module

> Delete an existing module and unregister it from the application, its tsconfig path alias, and its commitlint scope.

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` and its scope from `.commitlintrc.ts`, then deletes the `modules/<name>/` directory. The result is a clean removal with no dangling registrations or aliases left behind.

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.

```bash theme={null}
# Interactive: prompts for the name, then asks you to confirm removal
ooneex module:remove

# Remove a module by name
ooneex module:remove --name=billing

# The name is normalized to kebab-case (Catalog → catalog)
ooneex module:remove --name=Catalog
```

| Option   | Description                                              | Default             |
| -------- | -------------------------------------------------------- | ------------------- |
| `--name` | Name of the module to remove (normalized to kebab-case). | Prompted if omitted |

<Warning>
  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.
</Warning>

## What gets unregistered

When you remove a module, the command unwinds every registration that `module:create` set up:

| Location                     | What is removed                                                          |
| ---------------------------- | ------------------------------------------------------------------------ |
| `AppModule` / `SharedModule` | The module's registration is unregistered so the app no longer loads it. |
| `tsconfig.json`              | The module's path alias is removed from `compilerOptions.paths`.         |
| `.commitlintrc.ts`           | The module's scope is removed from the allowed commit scopes.            |
| `modules/<name>/`            | The entire module directory is deleted from disk.                        |

Because the registrations are removed before the directory is deleted, the project is left in a consistent state — there are 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:

<Tabs>
  <Tab title="Claude">
    ```bash theme={null}
    ooneex claude:init
    ```

    Then ask Claude in natural language — it maps the request to the generator and runs it:

    ```text Prompt icon="terminal" wrap theme={null}
    Remove the billing module from the project.
    ```
  </Tab>

  <Tab title="Codex">
    ```bash theme={null}
    ooneex codex:init
    ```

    Then ask Codex in natural language — it maps the request to the generator and runs it:

    ```text Prompt icon="terminal" wrap theme={null}
    Remove the billing module from the project.
    ```
  </Tab>
</Tabs>

For example, the prompt above maps to `module:remove --name=billing`, unregistering the module and deleting its directory after you confirm.

## Related

* [Module overview](/module/overview) — how modules are structured and registered.
* [Create](/module/create) — scaffold a new module, the mirror of this command.
* [module:remove](/cli/commands/module-remove) — the full command reference.
