Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

RepoRemover: Bulk GitHub Repository Deletion Script

Overview

RepoRemover is a Python script that helps you delete multiple repositories from your GitHub account quickly and safely. It uses the GitHub CLI (gh) for authentication and API access, supporting both interactive and preconfigured modes.

Features

  • Interactive Mode: Browse and select repositories or GitHub Lists to delete.
  • Preconfigured Mode: Delete repositories listed in the script.
  • Safety Checks: Requires confirmation before deletion. Validates repository ownership and existence.
  • GitHub Lists Support: Select repositories from your GitHub Lists for bulk deletion.

Prerequisites

  • GitHub CLI: Install via Homebrew: brew install gh
  • Authentication: Run gh auth login and ensure you have the delete_repo scope. If missing, the script will prompt you to refresh your authentication.
  • Python 3.7+

Usage

  1. Clone or download this repo.
  2. Install prerequisites (see above).
  3. Run the script:
    • Interactive mode (default):
      python delete_repos.py
      # or
      python delete_repos.py --mode interactive
    • Preconfigured mode:
      • Edit the REPOS_TO_DELETE list in delete_repos.py.
      • Run:
      python delete_repos.py --mode preconfigured
    • List-only mode (no deletion):
      python delete_repos.py --list-only
    • Show GitHub Lists:
      python delete_repos.py --show-lists
    • Delete from a specific GitHub List:
      python delete_repos.py --from-list "List Name"

Important Notes

  • Deletion is PERMANENT and cannot be undone!
  • The script only deletes repositories you own or have admin rights to.
  • Always double-check your selections before confirming deletion.

Troubleshooting

  • If you see errors about missing gh or authentication, follow the prompts to install or log in.
  • If you lack the delete_repo scope, the script will help you refresh your authentication.

Testing

A comprehensive and SAFE test suite is included to ensure reliability and security.

🔒 Safe Testing (Recommended)

./run_tests.sh

Runs completely isolated tests with NO external interactions - safe for any environment.

Manual Test Execution

python3 test_safe.py     # 🔒 SAFE: No external interactions

The safe test suite includes:

  • Complete Coverage: All functionality tested with mocks
  • Zero Risk: No external calls, API interactions, or real repository access
  • Fast Execution: Runs in under 1 second
  • CI/CD Ready: Perfect for automated testing

For detailed testing information, see TESTING.md.

Contributing

Pull requests and suggestions are welcome! Please:

  1. Run the safe test suite: ./run_tests.sh
  2. Add tests for new functionality
  3. Never commit tests that interact with real GitHub CLI
  4. Open an issue for bugs or feature requests

License

MIT License


For questions or help, open an issue or contact the maintainer.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages