deploy
alchemy deploy [file] [options]deploy computes a plan, asks for approval, and creates/updates/deletes resources to match the desired state.
Plan: 2 to create + Bucket (Cloudflare.R2.Bucket) + Worker (Cloudflare.Worker) (1 bindings) + Bucket Proceed? ◉ Yes ○ No ✓ Bucket (Cloudflare.R2.Bucket) created ✓ Worker (Cloudflare.Worker) created • Uploading worker (14.20 KB) ... • Enabling workers.dev subdomain... { url: "https://myapp-worker-dev-you-abc123.workers.dev", }
On subsequent deploys, only changed resources are updated:
Plan: 1 to update ~ Worker (Cloudflare.Worker) Proceed? ◉ Yes ○ No ✓ Worker (Cloudflare.Worker) updated • Uploading worker (15.10 KB) ... { url: "https://myapp-worker-dev-you-abc123.workers.dev", }
When the plan contains no changes, the approval prompt is skipped automatically.
| Option | Description |
|---|---|
[file] | Stack file to deploy (defaults to alchemy.run.ts) |
--stage <name> | Stage to deploy to (defaults to dev_$USER) |
--yes | Skip the approval prompt |
--dry-run | Show the plan without applying (same as alchemy plan) |
--force | Force updates for resources that would otherwise no-op |
--adopt | Adopt pre-existing cloud resources that conflict with this stack instead of failing. Useful for re-importing into a fresh state store. |
--profile <name> | Auth profile to use (defaults to default or $ALCHEMY_PROFILE) |
--env-file <path> | Load environment variables from a file |
How --adopt decides what to take over is covered in Adopting Resources.
--dry-run runs the exact same code path as alchemy plan — see that page for the plan output format.
Examples
Section titled “Examples”# Deploy to production, skip the promptalchemy deploy --stage prod --yes
# Deploy a PR preview environmentalchemy deploy --stage pr-42
# Deploy a different stack filealchemy deploy stacks/github.ts
# Preview what would changealchemy deploy --dry-run
# Re-import existing cloud resources into a fresh state storealchemy deploy --adoptWhere next
Section titled “Where next”- plan — preview changes without applying
- destroy — delete everything in a stack
- Adopting Resources — take over pre-existing infrastructure
- Resource Lifecycle — what happens inside a deploy