Delete a package
Delete an entire package — every version it has, in one call.
Warning: destructive, wide blast radius
Section titled “Warning: destructive, wide blast radius”This deletes all versions of the named package at once, not just one. It is restorable only within GitHub’s roughly 30-day retention window, and only if nothing has since been republished under the same package name — a republish in that window permanently forecloses the restore option for what you deleted. Past 30 days, or past a republish, there is no recovery path at all, from this tool or from GitHub’s UI.
If you only mean to remove one bad version and keep the rest, use delete-package-version instead — it is significantly less destructive.
Verify before acting
Section titled “Verify before acting”- Confirm you have the right package: run
get-org-package first and check the
name,packageType, andversionCountmatch what you intend to delete. - If
versionCountis more than 1 and you’re not sure every version should go, stop and usedelete_package_versionper-version instead.
-
Call the tool, passing the package name twice — once as
packageName, once asconfirmPackageName. Both must match exactly, or the tool refuses the call with aconfirmation_mismatcherror before making any API request:delete_package {org: "your-org",packageType: "npm",packageName: "your-package",confirmPackageName: "your-package"} -
On success you get back
{ org, packageType, packageName }. There is no dry-run mode — a successful call has already deleted the package.
If you need it back
Section titled “If you need it back”Within the ~30-day window, and only if nothing has republished under the
same name in the meantime, call
restore-package with the same org, packageType,
and packageName.