Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aykansal avatar

Vercel Delete Deployments

  • 1 installs
  • Updated June 8, 2026
  • aykansal/agent-skills

Extract UIDs of failed Vercel deployments from a saved API JSON dump so you can bulk-delete ERROR (and optional CANCELED) deploys safely offline.

About

Vercel Delete Deployments is a small Node script packaged as an agent skill for solo builders who export Vercel deployment lists and need a deterministic list of broken deploy IDs before calling delete APIs or dashboard bulk actions. You point it at a JSON file captured from the Vercel deployments endpoint; it normalizes array or streamed payloads, filters ERROR deployments (and optionally CANCELED), prints a tab-separated audit line per row, and emits vercel-error-ids.txt for the next automation step. It does not call Vercel over the network by itself—reducing accidental mass deletion—so you review the file first. Ideal when ERROR deploys clutter the project history after failed previews or production pushes. Intermediate complexity assumes comfort with Node, API dumps, and Vercel UID semantics.

  • Node ESM script: filter-errors.mjs reads a /v6/deployments API dump
  • Detects ERROR state (and optional --include-canceled) from state or readyState
  • Supports single JSON array or newline-delimited deployment chunks
  • Writes sorted error UIDs to vercel-error-ids.txt in cwd
  • CLI usage: node filter-errors.mjs <api-json-file> [--include-canceled]

Vercel Delete Deployments by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #1,172 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aykansal/agent-skills --skill vercel-delete-deployments

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
Last updatedJune 8, 2026
Repositoryaykansal/agent-skills

What it does

Extract UIDs of failed Vercel deployments from a saved API JSON dump so you can bulk-delete ERROR (and optional CANCELED) deploys safely offline.

Files

SKILL.mdMarkdownGitHub ↗

Delete Vercel Deployments

Requires Vercel CLI, vercel login, and correct team scope (vercel whoami, vercel teams switch <team>).

Scripts: skills/vercel-delete-deployments/scripts/ (or .agents/skills/vercel-delete-deployments/scripts/ after npx skills add).

Choose a workflow first

User intentWorkflow
Delete failed / error deploymentsDelete by status (ERROR)preferred
Delete all deployments between two IDsDelete by ID range
Delete one deploymentSingle delete

Do not rely on vercel ls \| grep Error as the primary method. Output uses ANSI symbols, mixes stderr, and breaks easily on Windows. Use the API + Node scripts instead.

---

Setup (every run)

vercel whoami
# Note team slug, e.g. tryanon — use -S <team> on all commands below

Resolve project name (e.g. aykansal, edutype) from the user. Confirm it is the exact Vercel project, not a sibling (edutypeedutype-frontend).

Get projectId (prj_...)

vercel api "/v6/deployments?project=<project>&limit=1" -S <team> --raw

Read projectId from the first deployment object. Alternatively: vercel project inspect <project> -S <team> if available.

Fetch full deployment history (required for bulk work)

cd <any-writable-dir>
vercel api "/v6/deployments?projectId=prj_xxxxx&limit=100" -S <team> --paginate --raw > vercel-deps.json
  • Never use --silent on vercel api (suppresses all output).
  • On Windows, write to a file in the current directory, not /tmp.
  • Paginated output is usually a JSON array of deployments (not { deployments: [] }).

Set SKILL_SCRIPTS to the scripts directory if not using the default repo layout:

SKILL_SCRIPTS=skills/vercel-delete-deployments/scripts   # repo root
# SKILL_SCRIPTS=.agents/skills/vercel-delete-deployments/scripts   # after npx skills add

---

Delete by status (ERROR)

Use this when the user wants failed deployments removed (most common).

1. Fetch + filter

vercel api "/v6/deployments?projectId=prj_xxxxx&limit=100" -S <team> --paginate --raw > vercel-deps.json
node "${SKILL_SCRIPTS:-skills/vercel-delete-deployments/scripts}/filter-errors.mjs" vercel-deps.json

Optional: include canceled builds: add --include-canceled.

2. Review

Script prints uid, state, target, created, url. Confirm no production deployment you need is listed.

3. Delete

vercel rm $(cat vercel-error-ids.txt | tr '\n' ' ') -y -S <team>

If only one ID: vercel rm dpl_xxxxx -y -S <team>.

4. Verify

node "${SKILL_SCRIPTS:-skills/vercel-delete-deployments/scripts}/filter-errors.mjs" vercel-deps.json
vercel ls <project> -S <team> --non-interactive | head -20

Delete temp files when done: vercel-deps.json, vercel-error-ids.txt, vercel-delete-ids.txt.

---

Delete by ID range (inclusive)

Use when the user gives two boundary deployment IDs (dpl_Adpl_B). IDs are ordered by `created` timestamp, not alphabetically.

1. Confirm boundaries

vercel inspect dpl_START -S <team>
vercel inspect dpl_END -S <team>

2. List range

vercel api "/v6/deployments?projectId=prj_xxxxx&limit=100" -S <team> --paginate --raw > vercel-deps.json
node "${SKILL_SCRIPTS:-skills/vercel-delete-deployments/scripts}/list-range.mjs" dpl_START dpl_END vercel-deps.json

Writes vercel-delete-ids.txt.

3. Delete + verify

vercel rm $(cat vercel-delete-ids.txt | tr '\n' ' ') -y -S <team>
vercel ls <project> -S <team> --non-interactive | head -20

Deployments newer than the start ID or older than the end ID are not removed.

---

Single delete

vercel inspect dpl_xxxxx -S <team>
vercel rm dpl_xxxxx -y -S <team>

Add --safe to skip deployments that still have an active alias.

---

Safety checklist

  • [ ] -S <team> on every command
  • [ ] Exact project name (avoid similarly named projects in the same team)
  • [ ] Inspect ERROR list for unexpected production rows before vercel rm
  • [ ] Use --safe if aliased production must not be removed
  • [ ] Re-fetch API after delete for verification (cached JSON is stale)

Common failures

MistakeFix
`vercel ls \grep Error` misses old failures
vercel api returns emptyRemove --silent; add -S <team>; redirect to vercel-deps.json
Scripts not foundSet SKILL_SCRIPTS or use path under skills/vercel-delete-deployments/scripts/
vercel api /v9/projects/... emptyUse /v6/deployments?project=<name>&limit=1 for projectId
Boundary ID "not found"Increase limit, ensure --paginate, both IDs exist in dump
Windows execSync empty stdoutWrite API output to a file first, then run Node scripts

Quick reference

GoalCommand
One deploymentvercel rm dpl_xxxxx -y -S <team>
All ERROR in projectAPI fetch → filter-errors.mjsvercel rm $(cat vercel-error-ids.txt …)
Range between two IDsAPI fetch → list-range.mjsvercel rm $(cat vercel-delete-ids.txt …)
Skip aliased prodvercel rm … --safe

Install

npx skills add aykansal/aykansal --skill vercel-delete-deployments

Browse: skills.sh

Related skills

DevOps & CI/CDdeployinfra

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.