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
Examples
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 |
What gets cleaned up
When the command finishes, every trace of the module is gone:- References to the module in
AppModuleandSharedModule. - 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.
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.
Use with Claude and Codex
Thespa: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:
- Claude
- Codex
Prompt
ooneex spa:remove --name=admin, then walks through the confirmation before deleting the module.
Related
- Spa overview — what a spa module is and how it fits together.
- Create a spa — scaffold a new spa module.
- design:remove — remove a design module a spa used.
- spa:remove command reference — the full command reference.