Interactive .NET CLI tool to browse and delete GitHub package versions (NuGet and npm) for your user account or an organization.
-
.NET 10 SDK (to install the tool)
-
GitHub CLI (
gh), authenticated viagh auth login -
Token scopes:
read:packages(list) anddelete:packages(delete). Add them with:gh auth refresh -s read:packages,delete:packages
dotnet tool install --global ghpkgOr from a local build:
dotnet pack src/ghpkg -c Release
dotnet tool install --global --add-source src/ghpkg/bin/Release ghpkgRun with no arguments for a fully interactive experience:
ghpkgYou'll be prompted to choose:
- Scope — your user account or an organization
- Package type —
nugetornpm - Package — pick from a list of your packages
- Versions — multi-select versions to delete (space to toggle, enter to accept)
- Confirmation — review the selection before anything is deleted
| Option | Description |
|---|---|
-o, --owner <owner> |
Org name, or user for your personal account |
-t, --type <nuget|npm> |
Package type |
-p, --package <name> |
Package name to manage |
--dry-run |
Preview which versions would be deleted without deleting |
# Interactively clean up NuGet packages in an org
ghpkg --owner my-org --type nuget
# Preview deletion of versions of a specific personal npm package
ghpkg --owner user --type npm --package my-package --dry-run- Deleting all versions of a package removes the package entirely (the tool warns you).
- Deletion is permanent. GitHub only supports restoring deleted versions within 30 days, and only under certain conditions.