sdxc
SearchCtrlK

[ The sdxc command ]

Undo a make

Remove a file sdxc make wrote, its test, the mapping that loads it and the declaration it names, with sdxc destroy, after one look at the plan.

Last updated 2026-10-19

After reading this guide, you will know

  • How to remove a controller, job, tool, command, email or model and everything make wired for it
  • What sdxc destroy leaves for you, and why
  • How to run it from a script or an agent

sdxc destroy <kind> <name> takes out what sdxc make <kind> <name> put in: the file, its test, the mapping in its initializer and the declaration that mapping names. A make followed by a destroy gives you back every declaration and initializer it edited, as it was.

sdxc destroy controller about
Removes:
  app/http/controllers/about.tsx
  app/http/controllers/about.test.tsx
Edits:
  routes/web.ts
  app/http/controllers/sitemap.ts
  app/initializers/router.tsx
Remove 2 files and edit 3? › No

What it removes

KindFilesEdits
controllerthe controller and its testthe route in its contract, its sitemap decision, its router.map(…)
jobthe job and its testits declaration in app/jobs/index.ts, its dispatcher.map(…), its trigger
mcpthe tool, or --resource a resourceits declaration, its mcp.tools.map(…) or mcp.resources.map(…)
commandthe command and its testits declaration in app/commands/index.ts, its cli.map(…)
emailthe template and its testits declaration in app/emails/index.ts, its mail.map(…) in the mail registry
modelthe model, its test and its factoryits entry in app/models/index.ts
any other kindthe file and its testnone

destroy finds the mapping by the import that loads the file, and reads the declaration from the mapping itself, jobs.trials.expire in dispatcher.map(jobs.trials.expire, …). A group the removal leaves empty, such as trials: {}, goes too, and so does an import whose last use was the mapping or the declaration. Every other import stays.

A scheduled job's trigger leaves cloudflare.config.ts with it once no other job runs on the same schedule, so the Worker stops waking for a job it no longer has. A cron in wrangler.jsonc is listed for you to remove.

Every make kind but migration and policy is accepted. A file that does not exist stops the command before it edits anything:

app/jobs/digset.ts does not exist; sdxc destroy removes what sdxc make wrote

What it leaves for you

Code you wrote that uses the file is yours to change, so destroy lists every line that still names the file or its declaration, after everything else it prints:

Still referenced, to remove by hand:
  app/jobs/charge-all.ts:1: import { charge } from "~/app/services/billing/charge";

The packages make added to package.json stay too, since other code may import them.

Flags

FlagWhat it does
-y, --yesremove without asking; required without a terminal
--dry-runprint the plan and the diff of every edit, and change nothing
--resourcewith mcp, a resource in app/mcp/resources/ instead of a tool

Nothing changes without a yes: on a terminal the command asks once, after the plan, and No is the default. A script or an agent passes --yes; without a terminal and without it, the command is a usage error. Once it writes, the format command from your configuration runs over the edited files.

sdxc destroy job digest --dry-run
sdxc destroy model post --yes

Where to go next

  • Generate files — what sdxc make writes and edits for each kind.

  • List routes — check that a removed controller left no route behind.

Written by Sergio Xalambrí. Follow @sergiodxa for new packages, or sponsor the work.