> ## 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 spa

> Remove an existing spa module and clean up every reference it left behind.

`ooneex spa:remove` deletes a spa module you created earlier. It finds the module by name, removes it from the rest of your app, and deletes its directory — so you are left with a clean project, not a half-removed module that breaks the build.

It only touches modules that are actually spas: a module whose `<name>.yml` declares `type: "spa"`. Anything else is left alone. The core `app` and `shared` modules are protected and can never be removed, and asking to remove a module that does not exist is reported as an error.

## How it works

Removing a spa is more than deleting a folder — references to it live across the project, and leaving them behind would break compilation. The command unwinds them in order, then deletes the directory:

| Step       | What happens                                                                                        |
| ---------- | --------------------------------------------------------------------------------------------------- |
| Validate   | Confirms the named module exists and is `type: "spa"`. The `app` and `shared` modules are rejected. |
| Unregister | Cleans up any leftover references in `AppModule` and `SharedModule`.                                |
| Path alias | Removes the module's path alias from the root `tsconfig.json`.                                      |
| Commitlint | Removes the module's scope from the commitlint config.                                              |
| Delete     | Deletes the `modules/<kebab-name>/` directory.                                                      |

## CLI command

```bash theme={null}
ooneex spa:remove [options]
```

### Examples

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

```bash theme={null}
# Remove a specific spa by name
ooneex spa:remove --name=admin
```

The name is normalized to PascalCase with a trailing `Module` stripped, and the folder it deletes uses the kebab-case form (so `Admin`, `admin`, and `AdminModule` all resolve to `modules/admin/`).

### Options

| Option     | Description                                 | Default             |
| ---------- | ------------------------------------------- | ------------------- |
| `--name`   | Name of the spa module to remove.           | Prompted if omitted |
| `--cwd`    | Working directory the command runs in.      | Current directory   |
| `--silent` | Skip prompts, confirmation, and log output. | `false`             |

<Warning>
  This is destructive. The command deletes the entire `modules/<name>/` directory and everything in it — commit your work or branch first so you can recover it.

  * Only modules marked `type: "spa"` can be removed; a non-spa module is rejected.
  * The core `app` and `shared` modules are protected and cannot be removed.
  * You will be asked to confirm before anything is deleted — unless you pass `--silent`, which skips the prompt and removes the module without asking.
</Warning>

## What gets cleaned up

When the command finishes, every trace of the module is gone:

* References to the module in `AppModule` and `SharedModule`.
* The module's path alias in the root `tsconfig.json`.
* The module's scope in the commitlint config.
* The `modules/<kebab-name>/` directory and all of its files.

<Note>
  Removing a spa does **not** remove the design module it used. Designs are
  separate modules — if you no longer need the design, remove it on its own with
  [design:remove](/design-system/remove).
</Note>

## Use with Claude and Codex

The `spa:remove` generator ships a matching skill, so you can remove a spa by asking your AI agent in natural language instead of remembering the flags. Initialize the skills once for your agent:

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

    Then ask Claude in plain language — it maps the request to the command and runs it:

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

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

    Then ask Codex in plain language — it maps the request to the command and runs it:

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

The prompt above maps to `ooneex spa:remove --name=admin`, then walks through the confirmation before deleting the module.

## Related

* [Spa overview](/spa/overview) — what a spa module is and how it fits together.
* [Create a spa](/spa/create) — scaffold a new spa module.
* [design:remove](/design-system/remove) — remove a design module a spa used.
* [spa:remove command reference](/cli/commands/spa-remove) — the full command reference.
