GitHub Repository Remover
A CLI tool for bulk-deleting GitHub repositories with an interactive interface. Built with .NET 9 and Spectre.Console for a clean terminal experience.
What it does
- Interactive repository selection with a clean multi-select interface
- Secure authentication using GitHub Personal Access Tokens
- Batch deletion of multiple repositories
- Multiple confirmation prompts to prevent accidents
- Real-time progress feedback
- Handles GitHub API rate limits gracefully
Installation
Download Pre-built Executable
Download a pre-built executable for your platform:
- Go to the Releases page
- Download the appropriate executable for your platform:
- Windows:
github-repo-remover-win-x64.exe - macOS:
github-repo-remover-osx-x64(Intel) orgithub-repo-remover-osx-arm64(Apple Silicon) - Linux:
github-repo-remover-linux-x64
- Windows:
- Make the file executable (macOS/Linux):
chmod +x github-repo-remover-*
Prerequisites:
- .NET 9.0 runtime (download here)
Build from Source
If you prefer to build from source:
Prerequisites:
- .NET 9.0 SDK
git clone https://github.com/mtfarkas/GithubRepoRemover.git
cd GithubRepoRemover
dotnet build -c Release
How to use it
Basic usage
github-repo-remover --token YOUR_GITHUB_TOKEN
| Option | Short | What it does | Required |
|---|---|---|---|
--token |
-t |
Your GitHub Personal Access Token | Yes |
Example
github-repo-remover --token ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Here's what happens when you run it:
- Authenticates with GitHub using your token
- Fetches all your repositories
- Shows you an interactive list to choose from
- Displays your selected repos for review
- Asks for confirmation (twice!)
- Deletes the selected repositories with progress updates
Setting up your GitHub token
You'll need a GitHub Personal Access Token with the right permissions.
Creating the token
-
Go to GitHub Settings
- Visit GitHub.com
- Click your profile picture → Settings
-
Navigate to Developer Settings
- Scroll down and click Developer settings
- Click Personal access tokens → Tokens (classic)
-
Create a new token
- Click Generate new token → Generate new token (classic)
- Give it a name like "GitHub Repo Remover CLI"
-
Set expiration
- Pick an expiration date that makes sense
- Avoid "No expiration" unless you really need it
-
Choose the right permissions
Important: Your token needs these scopes:
- ✅
repo- Full control of private repositories - ✅
delete_repo- Delete repositories
Without both of these, the tool won't work. The
reposcope lets it read your repository list, anddelete_repodoes what it says on the tin. - ✅
-
Generate and save the token
- Click Generate token
- Copy it immediately - GitHub won't show it again!
- Store it somewhere safe (password manager recommended)
Token security tips
- Never commit tokens to git repositories
- Use a password manager to store them
- Set reasonable expiration dates
- Revoke tokens when you're done with them
- Consider using environment variables for scripts
Using environment variables
If you don't want to type the token every time:
# Windows (PowerShell)
$env:GITHUB_TOKEN = "your_token_here"
github-repo-remover --token $env:GITHUB_TOKEN
# Linux/macOS
export GITHUB_TOKEN="your_token_here"
github-repo-remover --token $GITHUB_TOKEN
Safety features
This tool tries really hard not to let you accidentally delete things:
- Two separate confirmation prompts before any deletion
- Shows you exactly which repositories will be deleted
- You have to manually select each repository
- Real-time feedback so you know what's happening
Error handling
The tool handles common problems gracefully:
- Invalid or expired tokens get clear error messages
- GitHub rate limiting is handled automatically
- Network problems are reported clearly
- Missing permissions get specific guidance
Building from source
git clone https://github.com/mtfarkas/GithubRepoRemover.git
cd GithubRepoRemover
dotnet restore
dotnet build -c Release
# To run it
dotnet run --project src/GithubRepoRemover -- --token YOUR_TOKEN
Contributing
Pull requests welcome! For big changes, please open an issue first so we can discuss it.
Development setup
You'll need .NET 9.0 SDK installed, then:
- Clone the repo
- Run
dotnet restore - Start hacking!
Building Self-Contained Executables
To create executables for distribution:
# Windows x64
dotnet publish -c Release -r win-x64 -p:PublishSingleFile=true
# macOS x64 (Intel)
dotnet publish -c Release -r osx-x64 -p:PublishSingleFile=true
# macOS ARM64 (Apple Silicon)
dotcom publish -c Release -r osx-arm64 -p:PublishSingleFile=true
# Linux x64
dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true
The executables will be generated in src/GithubRepoRemover/bin/Release/net9.0/{runtime}/publish/
Note: These are framework-dependent executables that require .NET 9.0 runtime to be installed on the target machine.
License
MIT License
Important warning
This tool permanently deletes GitHub repositories. Once they're gone, they're gone (unless you have backups). Make sure you know what you're doing and have backups of anything important.
I'm not responsible if you accidentally delete something you needed.
Getting help
Run into problems or have ideas?
- Open an issue for bugs or feature requests
- Start a discussion for questions
Made with ❤️ by mtfarkas