A comprehensive, Mole-inspired cleanup tool for Python environments. Discover, analyze, and clean up Python installations, virtual environments, and individual packages across your system with an interactive TUI or powerful CLI.
- List Mode: Browse and explore environments (read-only)
- Delete Mode: Remove unwanted environments and packages
- Analyze Mode: Deep analysis of packages and duplicates
- Package Manager: Manage packages within environments
- Mode Selection Screen: Beautiful startup screen with mode chooser
- Smart Scrolling: Automatic scroll management for long lists
- Help Overlay: Press 'h' or '?' for contextual help
- Search Function: Press '/' to filter items in real-time
- Progress Indicators: See deletion/uninstall progress
- Breadcrumb Navigation: Always know where you are
- Package-Level Deletion: Drill down into venvs and uninstall specific packages
- Modern Tool Support: Full support for uv, ruff, piptools, and all latest Python tools
- Enhanced Path Navigation: Project-relative paths and shortened display
- Recursive .venv Detection: Finds project venvs deep in your directory tree (configurable depth)
- Discover All Python Interpreters: System, Homebrew, pyenv, asdf, conda, uv
- Virtual Environment Detection: venv, virtualenv, poetry, pipenv, pipx, conda, hatch, pdm, uv
- Project Venv Discovery: Recursively finds .venv directories in your projects
- Drill-Down Interface: Navigate into venvs to see and manage individual packages
- Package Uninstallation: Remove specific packages from any venv
- Duplicate Detection: Find packages installed across multiple environments
- Version Conflict Analysis: Identify packages with different versions
- Arrow Key Navigation: Browse hierarchically with ↑↓
- Breadcrumb Trails: Always know where you are
- Multi-Select: Mark items with Space
- Drill Down: Enter venvs to see packages, then delete specific ones
- Search Mode: Press '/' to search
- System Path Protection: Never deletes system Python
- Dry-Run Mode: Preview deletions before executing
- Confirmation Prompts: Always asks before deleting
- Size Previews: See how much space you'll free
- Targeted Scanning: Smart path detection, no full filesystem walks
- Parallel Package Probing: Fast package discovery
- macOS mdfind Support: Lightning-fast scanning with Spotlight
- Depth-Limited Recursion: Configurable search depth
# Install directly from formula
brew install https://raw.githubusercontent.com/haydenso/broomstick/main/broomstick.rb
# Or add the tap (after tap is created)
brew tap haydenso/broomstick
brew install broomstickSee INSTALL.md for pip installation instructions and development setup.
# Clone and run
git clone https://github.com/haydenso/broomstick.git
cd broomstick
chmod +x broomstick
./broomstickSee INSTALL.md for detailed installation instructions and HOMEBREW.md for Homebrew tap setup.
./broomstickMode Selection: When you launch Broomstick, you'll see a beautiful mode selection screen:
- List Mode - Browse and explore environments (read-only, safe for exploration)
- Delete Mode - Remove unwanted environments and packages (with confirmations)
- Analyze Mode - Deep analysis of packages, duplicates, and conflicts
- Package Manager - Manage packages within specific environments
Navigation:
↑/↓- Move cursorEnter- Select mode / drill down into itemSpace- Mark/unmark for deletion (in Delete/Package modes)d- Delete marked items (in Delete mode)u- Uninstall marked packages (in Package Manager mode)hor?- Show help overlay/- Search/filter current listESC- Go back to previous screenq- Quit (or go back from mode selection)
Below is a demo screenshot showing the mode selection screen and example environment list. The same image is included in the repository at assets/demo-screenshot.png.
Workflow Example:
- Start Broomstick → See mode selection screen
- Choose "Delete Mode" → See category selection (Interpreters/Venvs)
- Choose "Virtual Environments" → See list of all venvs
- Press Space to mark old venvs → Press 'd' to delete
- Confirm deletion → See progress indicators
- Press ESC to go back → Choose different mode or quit
List Python Interpreters
./broomstick interpretersList Virtual Environments
# All venvs
./broomstick venvs
# Scan specific path
./broomstick venvs --path ~/Projects
# Fast scanning on macOS
./broomstick --mdfind venvsView Packages in a Venv
./broomstick packages --venv /path/to/.venvUninstall Package from Venv
# Dry run
./broomstick uninstall numpy --from /path/to/.venv --dry-run
# Actually uninstall
./broomstick uninstall numpy --from /path/to/.venvAnalyze Package Duplicates
./broomstick packagesSearch for Venvs or Packages
./broomstick search flask
./broomstick search myprojectDelete Environment
# Dry run
./broomstick clean --target ~/.cache/pypoetry/virtualenvs/old-project --dry-run
# Actually delete
./broomstick clean --target ~/.cache/pypoetry/virtualenvs/old-project --yes# List all venvs with age
./broomstick venvs
# Output shows:
# [venv] 436.2MB 3y ago old-project /path/to/old-project/.venv
# Remove it
./broomstick clean --target /path/to/old-project/.venv# Find where numpy is installed
./broomstick search numpy
# Uninstall from specific venv
./broomstick uninstall numpy --from ~/project1/.venv
./broomstick uninstall numpy --from ~/project2/.venv- Run
./broomstick - Select "Virtual Environments"
- Navigate to a venv and press Enter
- See all packages in that venv
- Mark unwanted packages with Space
- Press
dto uninstall marked packages
./broomstick packages
# Output shows:
# numpy: 12 copies
# Versions: 1.21.0, 1.23.5, 1.24.0
# requests: 11 copies
# Versions: 2.28.0, 2.31.0- System Python (
/usr/bin/python*) - Homebrew (
/opt/homebrew,/usr/local/Cellar) - pyenv (
~/.pyenv/versions) - asdf (
~/.asdf/installs/python) - conda/miniconda/anaconda environments
- uv-managed Pythons
- Custom PATH entries
- Manager-based: poetry, pipenv, pipx, conda, hatch, pdm, uv
- Project-based: Recursively finds
.venv,venv,envin project folders - All standard markers:
pyvenv.cfg,bin/activate,Scripts/activate.bat
- ✅ uv (ultra-fast package installer)
- ✅ ruff (Python linter)
- ✅ piptools (pip-compile, pip-sync)
- ✅ All standard tools (pip, poetry, pipenv, etc.)
Remove a package from a specific venv:
# Syntax
broomstick uninstall PACKAGE --from VENV_PATH [--dry-run]
# Examples
broomstick uninstall pandas --from ~/myproject/.venv
broomstick uninstall numpy --from ~/.cache/pypoetry/virtualenvs/proj-abc --dry-runSearch for venvs or packages:
# Search for venvs containing "flask"
broomstick search flask
# Search for venvs in path containing "myproject"
broomstick search myprojectScan a specific directory:
# Scan only your Projects folder
broomstick venvs --path ~/Projects
# Scan current directory
broomstick venvs --path .BROOMSTICK - Python Environment Cleaner
1. Python Interpreters (3 found)
2. Virtual Environments (21 found)
3. Package Analysis
4. Search
5. Quit
Virtual Environments
------------------------------------------------------------
[ ] [conda] 6.8GB 10mo ago anaconda3
[ ] [venv] 436.2MB 3y ago old-project
[X] [venv] 106.4MB 1y ago test-app <- Marked
Total: 7.5GB | Marked: 106.4MB | Space: mark | Enter: detail
Home > Virtual Environments > myproject
Virtual Environment: myproject
------------------------------------------------------------
Path: /Users/you/myproject/.venv
Manager: venv
Size: 106.4MB
Modified: 1y ago
Python: 3.11.5
Packages (145):
------------------------------------------------------------
[ ] numpy 1.24.3
[X] pandas 2.0.0 <- Marked for removal
[ ] requests 2.31.0
[ ] flask 2.3.0
Space: mark | d: uninstall marked | ESC: back
Virtual Environments (Enhanced)
$ ./broomstick venvs --path ~/Projects
Found 21 virtual environments:
Manager Size Age Project Path
---------------------------------------------------------------------------
[venv] 106.4MB 1y ago myapp ~/Projects/myapp/.venv
[poetry] 85.2MB 2mo ago web-scraper ~/.cache/pypoetry/...
[uv] 45.1MB today fast-project ~/.local/share/uv/venvs/...
Total size: 7.5GBPackage Uninstall
$ ./broomstick uninstall pandas --from ~/myproject/.venv
Uninstalling pandas from myproject...
✓ Successfully uninstalled pandas- Recursive Project Detection: Finds
.venvin nested project folders - Depth Control: Configurable
max_depthto balance speed vs coverage - Skip Lists: Automatically skips
node_modules,.git, etc.
- Breadcrumb Navigation:
Home > Virtual Environments > myproject - Project Names: Shows project name instead of just venv path
- Age Display: Human-readable age (3y ago, 2mo ago, today)
- Path Shortening: Intelligent path truncation for display
- Lazy Loading: Packages loaded only when needed
- Force Refresh: Reload packages after uninstall
- Individual Deletion: Uninstall specific packages, not whole venv
- Python 3.8+
- macOS, Linux, or Windows
- No external dependencies (stdlib only)
- ✅ Never deletes system paths
- ✅ Dry-run by default for
cleancommand - ✅ Confirmation prompts unless
--yes - ✅ System interpreters shown in red (TUI)
- ✅ Size calculations before deletion
- ✅ Error handling for permission issues
- Smart Scanning: Only searches known manager paths + project dirs
- Parallel Probing: Concurrent package discovery
- mdfind Support: ~20x faster on macOS
- Depth Limiting: Prevents excessive recursion
| Feature | v1 | v2 (Current) |
|---|---|---|
| Venv detection | Manager paths only | + Recursive project scanning |
| Package management | View only | Uninstall individual packages |
| Navigation | Flat lists | Hierarchical drill-down |
| Path display | Full paths | Project names + breadcrumbs |
| Modern tools | Basic | uv, ruff, piptools support |
| Search | None | Built-in search command |
| Uninstall CLI | None | Full uninstall subcommand |
Contributions welcome! Please ensure:
- Code follows existing style
- Safety features remain intact
- Documentation is updated
- New features include examples
MIT
Inspired by Mole - the excellent macOS cleanup tool.
