modules/<name>/ and then unwinds every registration that brought it into the app — the app module, the shared module, the app config, the env config, docker-compose, the tsconfig path aliases, and the commitlint config. When it finishes, no trace of the microservice is left in the project.
This is a one-command operation. You name the microservice, confirm, and the generator does the rest.
What it does
The command works against an existing microservice. It will not create anything, and it refuses to touch the two built-in modules:- The
appandsharedmodules cannot be removed — they are part of every project. - A name that does not match an existing microservice is reported as an error.
- You are asked to confirm before anything is deleted, unless you pass
--silent.
modules/<kebab-name>/ directory.
CLI command
Run the generator from your project. With no flags it prompts for the name and then asks you to confirm.| Option | Description | Default |
|---|---|---|
--name | Microservice name to remove. Normalized to PascalCase with any trailing Module stripped; the module folder uses its kebab-case form. | Prompted if omitted |
--cwd | Project directory the microservice is removed from. | Current working directory |
--silent | Suppress the confirmation prompt and output. | false |
What gets unregistered
Every wiring step that create performs is reversed:- App module (
AppModule) — the microservice’s module registration is removed. - Shared module (
SharedModule) — the microservice is unregistered. - App config (
modules/app/app.yml) — the entry is removed from themicroservices:list. - Env config (
.env.yml) — themicroservices:entry is removed. - Docker Compose (
docker-compose.yml) — the app’s service block for the microservice is deleted. - TypeScript config (root
tsconfig.json) — the microservice’s path aliases are removed. - Commitlint config — the microservice is dropped from the allowed scopes.
modules/<kebab-name>/ directory itself is deleted.
Use with Claude and Codex
The generator ships a matchingmicroservice:remove skill. It runs the command and walks your AI agent through confirming the removal and verifying that the wiring is gone. Initialize the skills once for your agent:
- Claude
- Codex
Prompt
microservice:remove --name=billing, then confirms the deletion when asked.
Related
- Microservices overview — what a microservice is and how it fits the project.
- Create — scaffold a new microservice and wire it in.
- Networking — how microservices reach each other at runtime.
- microservice:remove — the full command reference.