Bulk-delete GitHub repositories from your terminal — safely, quickly, and with full control.
GitHub's UI forces you to delete repositories one at a time, navigating through multiple confirmation dialogs for each one. If you've ever wanted to clean up old experiments, test repos, or abandoned projects, that process is painfully slow.
GitSweep fixes that. Run the CLI, pick the repos you want gone, type y to confirm — done.
- 🔐 Authenticate with a GitHub Personal Access Token
- 📋 Fetch all repositories from your account
- ☑️ Interactive multi-select via terminal UI
- 🗑️ Bulk delete in a single command
- ✅ Safety confirmation before any deletion
- 📊 Live progress output per repository
$ npm install -g gitsweep-cli
$ gitsweep
GitSweep
──────────────────────────────────────────
Enter your GitHub Personal Access Token: ••••••••••••••••
Fetching your repositories...
Select repositories to delete (space to select, enter to confirm):
○ my-portfolio
● old-project ← selected
● test-repo-2023 ← selected
○ dotfiles
● abandoned-hackathon ← selected
You are about to permanently delete:
• old-project
• test-repo-2023
• abandoned-hackathon
Are you absolutely sure? (y/N): y
Deleting...
✔ Deleted: old-project
✔ Deleted: test-repo-2023
✔ Deleted: abandoned-hackathon
Done. 3 repositories removed.
$ npm install -g gitsweep-cli
$ gitsweep
Clone and install:
git clone https://github.com/YOUR_USERNAME/gitsweep.git
cd gitsweep
npm installRun directly:
node index.jsOr install globally:
npm link
gitsweep| Requirement | Version |
|---|---|
| Node.js | 16 or higher |
| GitHub Personal Access Token | Classic token with repo + delete_repo scopes |
-
Click Generate new token → Classic
-
Give it a name (e.g.
gitsweep) -
Select these scopes:
✅ repo ✅ delete_repo -
Click Generate token and copy it — you'll paste it when prompted by the CLI
These scopes allow GitSweep to list your repositories and delete the ones you select. No other permissions are requested.
| Layer | Technology |
|---|---|
| Runtime | Node.js |
| HTTP client | Axios |
| CLI prompts | Inquirer.js |
| API | GitHub REST API v3 |
Deleting repositories is permanent and irreversible. GitHub does not provide a recovery option.
- Double-check your selections before confirming
- Consider archiving instead of deleting if you're unsure
- The tool will never delete anything without an explicit
yconfirmation
Planned and community-requested features:
-
--dry-runmode — preview what would be deleted without deleting - Filter by language, topic, or last-updated date
- Support for organization repositories
- Pagination for accounts with 100+ repositories
- Colored terminal output
- Progress bars for large deletions
-
.envfile support for token storage - Export deletion log to file
Have a feature request? Open an issue.
MIT — free to use, modify, and distribute.