Skip to content

destroy

Terminal window
alchemy destroy [file] [options]

destroy deletes every resource in a stack. It computes a plan where all existing resources are marked for deletion, asks for approval, and removes them in dependency order.

Under the hood, destroy is deploy with the desired state zeroed out — every resource in state plans as a deletion.

Plan: 2 to delete

- Worker (Cloudflare.Worker)
- Bucket (Cloudflare.R2.Bucket)

Proceed?
◉ Yes ○ No
 Worker (Cloudflare.Worker) deleted
 Bucket (Cloudflare.R2.Bucket) deleted
OptionDescription
[file]Stack file to destroy (defaults to alchemy.run.ts)
--stage <name>Stage to destroy (defaults to dev_$USER)
--yesSkip the approval prompt
--dry-runShow what would be deleted without actually deleting
--profile <name>Auth profile to use (defaults to default or $ALCHEMY_PROFILE)
--env-file <path>Load environment variables from a file
Terminal window
# Destroy a PR preview environment
alchemy destroy --stage pr-42 --yes
# Destroy your personal dev stage
alchemy destroy --stage dev_sam

destroy is scoped to one stack + stage and driven by the state store; to enumerate and delete everything a set of providers can see in the live account, see nuke.

  • deploy — bring the stack back
  • nuke — account-wide teardown, not scoped to a stack
  • state — inspect and clear the state the plan is driven by
  • Stages — how environments are isolated