Skip to content

[wrangler] feat: add pages deployment delete command#12474

Merged
petebacondarwin merged 2 commits intomainfrom
fix/2438-delete-preview-deployments
Feb 9, 2026
Merged

[wrangler] feat: add pages deployment delete command#12474
petebacondarwin merged 2 commits intomainfrom
fix/2438-delete-preview-deployments

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin commented Feb 7, 2026

Fixes #2438.

Adds a new CLI command wrangler pages deployment delete that allows users to delete Pages deployments directly from the command line. This is particularly useful for CI/CD pipelines that need to programmatically clean up old preview deployments.

Usage

# Interactive (with confirmation prompt)
wrangler pages deployment delete <deployment-id> --project-name <name>

# Skip confirmation (for CI/CD automation)
wrangler pages deployment delete <deployment-id> --project-name <name> --force
wrangler pages deployment delete <deployment-id> --project-name <name> -f

Implementation Details

  • Follows existing patterns from pagesDeploymentListCommand and pagesProjectDeleteCommand
  • Requires confirmation by default to prevent accidental deletions
  • Supports --force / -f flag to skip confirmation for automation
  • Adds metrics event tracking for the new command

A picture of a cute animal (not mandatory, but encouraged)

🦝


Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 7, 2026

🦋 Changeset detected

Latest commit: 92f08b4

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Feb 7, 2026

Claude finished @petebacondarwin's task —— View job


Changeset Review

  • Read changeset guidelines
  • Review changeset file
  • Validate against criteria
  • Post findings

All changesets look good

The changeset .changeset/delete-pages-deployment.md is well-formatted and follows all guidelines:

  • ✅ Version type: minor is correct for a new CLI command
  • ✅ Changelog quality: Clear description with usage example
  • ✅ Markdown headers: No h1/h2/h3 headers used
  • ✅ Analytics: N/A for this change
  • ✅ Format: Follows the recommended structure with title and body

Cuteness Report

This is Darwin's raccoon. He's a trash panda in markdown form and represents this deployment delete feature perfectly—cleaning up after everyone. Excellent choice for a cleanup command. 13/10 would delete deployments with.


@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 7, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12474

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12474

miniflare

npm i https://pkg.pr.new/miniflare@12474

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12474

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12474

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12474

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12474

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12474

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12474

wrangler

npm i https://pkg.pr.new/wrangler@12474

commit: 92f08b4

@petebacondarwin petebacondarwin marked this pull request as ready for review February 7, 2026 18:04
@petebacondarwin petebacondarwin requested review from a team as code owners February 7, 2026 18:04
@petebacondarwin
Copy link
Copy Markdown
Contributor Author

Tested manually with the PR preview to prove that the backend APIs are actually there and work as expected.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/wrangler/src/pages/deployments.ts
@petebacondarwin petebacondarwin force-pushed the fix/2438-delete-preview-deployments branch from 9ba1967 to 481d45f Compare February 7, 2026 18:20
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Feb 7, 2026
Add `wrangler pages deployment delete` command to allow users to delete
Pages deployments via CLI. This is useful for CI/CD pipelines that need
to clean up old preview deployments programmatically.

Fixes #2438
@petebacondarwin petebacondarwin force-pushed the fix/2438-delete-preview-deployments branch from 481d45f to 3f95765 Compare February 8, 2026 14:11
vicb
vicb previously requested changes Feb 8, 2026
Copy link
Copy Markdown
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments

Comment thread packages/wrangler/src/pages/deployments.ts Outdated
Comment thread packages/wrangler/src/pages/deployments.ts
@github-project-automation github-project-automation bot moved this from Approved to In Review in workers-sdk Feb 8, 2026
@petebacondarwin petebacondarwin requested a review from vicb February 8, 2026 15:36
@petebacondarwin petebacondarwin dismissed vicb’s stale review February 9, 2026 10:31

Comments have been addressed.

@petebacondarwin petebacondarwin merged commit 8ba1d11 into main Feb 9, 2026
35 of 36 checks passed
@petebacondarwin petebacondarwin deleted the fix/2438-delete-preview-deployments branch February 9, 2026 10:31
@github-project-automation github-project-automation bot moved this from In Review to Done in workers-sdk Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🚀 Feature Request: Support cli delete of preview deployments

4 participants