Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghpkg

Interactive .NET CLI tool to browse and delete GitHub package versions (NuGet and npm) for your user account or an organization.

Prerequisites

  • .NET 10 SDK (to install the tool)

  • GitHub CLI (gh), authenticated via gh auth login

  • Token scopes: read:packages (list) and delete:packages (delete). Add them with:

    gh auth refresh -s read:packages,delete:packages

Installation

dotnet tool install --global ghpkg

Or from a local build:

dotnet pack src/ghpkg -c Release
dotnet tool install --global --add-source src/ghpkg/bin/Release ghpkg

Usage

Run with no arguments for a fully interactive experience:

ghpkg

You'll be prompted to choose:

  1. Scope — your user account or an organization
  2. Package typenuget or npm
  3. Package — pick from a list of your packages
  4. Versions — multi-select versions to delete (space to toggle, enter to accept)
  5. Confirmation — review the selection before anything is deleted

Options

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

Examples

# 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

Notes

  • 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.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages