1 unstable release
| 0.1.0-alpha.1 | Jun 3, 2025 |
|---|
#2096 in Development tools
59KB
1K
SLoC
BrewSweep
A fast, terminal-based tool for managing your Homebrew packages by tracking their usage and helping you identify packages that can be safely removed. Built with Rust and ratatui for a responsive TUI experience.
What is it?
BrewSweep scans your installed Homebrew packages (both formulas and casks) and displays them sorted by last access time. This makes it easy to identify:
- Never-used packages - Installed but never accessed
- Rarely-used packages - Haven't been used in months or years
- Recently-used packages - Actively used packages to keep
The tool provides a clean, interactive interface for viewing package details and safely removing unused packages to free up disk space. Sweep away the clutter and keep only what you actually use!
Features
๐ Smart Package Analysis
- Real-time scanning of all Homebrew formulas and casks
- Last access time tracking using filesystem metadata
- Automatic sorting by usage (least recently used first)
- Detailed package information including installation paths
๐ฏ Easy Package Management
- Interactive table view with keyboard navigation
- Package details screen showing comprehensive information
- Safe deletion workflow with confirmation dialogs
- Real-time uninstall output showing brew command progress
๐ฅ๏ธ Terminal UI
- Responsive interface built with ratatui
- Color-coded display with multiple themes
- Keyboard shortcuts for efficient navigation
- Progress indicators for all operations
โก Performance
- Fast scanning using parallel processing
- Non-blocking UI - responsive during operations
- Memory efficient handling of large package lists
- Background operations for deletions
Installation
Prerequisites
- Rust (1.70 or later) - Install Rust
- Homebrew installed and in PATH - Install Homebrew
- macOS (primary platform)
Using Cargo (Recommended)
cargo install brewsweep
From Source
# Clone the repository
git clone https://github.com/DrudgeRajen/brewsweep.git
cd brewsweep
# Build and install
cargo build --release
# Run the application
./target/release/brewsweep
Using Cargo from Git
# Install directly from git
cargo install --git https://github.com/DrudgeRajen/brewsweep.git
Usage
Basic Workflow
-
Start the application
brewsweep -
Scan packages
- Press
Spaceto start scanning your Homebrew installation - Watch real-time progress as packages are discovered
- Press
-
Browse packages
- Use
โ/โarrow keys to navigate the package list - Packages are automatically sorted with least-used first
- Use
-
View details
- Press
Enteron any package to see detailed information - View last access time, type, and installation path
- Press
-
Delete packages
- Press
dto delete a selected package - Confirm with
yor cancel withn - Watch real-time output from the
brew uninstallcommand
- Press
Keyboard Controls
Main Table
| Key | Action |
|---|---|
Space |
Start package scan |
โ/โ |
Navigate up/down |
โ/โ |
Navigate left/right |
Enter |
View package details |
d |
Delete selected package |
r |
Refresh (re-scan packages) |
Shift + โ |
Next color theme |
Shift + โ |
Previous color theme |
Esc |
Quit application |
Package Details
| Key | Action |
|---|---|
Enter/Space |
Back to table |
d |
Delete this package |
Esc |
Quit application |
Deletion Confirmation
| Key | Action |
|---|---|
y/Enter |
Confirm deletion |
n/Space |
Cancel deletion |
Esc |
Quit application |
Package Information Display
The tool displays packages with the following information:
- Package Name - The Homebrew package identifier
- Type - Formula (command-line tool) or Cask (GUI application)
- Last Accessed - Human-readable time since last use:
- "Never accessed" - Package never used
- "2 hours ago" - Recently used
- "3 months ago" - Moderately old
- "1 year ago" - Very old, candidate for removal
- Path - Installation location on your system
Sorting Logic
Packages are automatically sorted by usage to prioritize cleanup candidates:
-
Never accessed packages (top of list)
- Easiest to identify for removal
- Safe to delete if you don't recognize them
-
Oldest accessed packages
- Haven't been used in months/years
- Good candidates for cleanup
-
Recently accessed packages (bottom of list)
- Actively used, probably should keep
- Latest access times
Development
Building from Source
git clone https://github.com/DrudgeRajen/brewsweep.git
cd brewsweep
cargo build --release
Dependencies
This project uses the following Rust crates:
ratatui- Terminal user interfacecrossterm- Cross-platform terminal handlingcolor-eyre- Error handling and reportingunicode-width- Text width calculation
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
Development Setup
git clone https://github.com/DrudgeRajen/brewsweep.git
cd brewsweep
cargo build
cargo run
Running Tests
cargo test
Code Style
This project uses standard Rust formatting:
cargo fmt
cargo clippy
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built with ratatui for the excellent terminal UI framework
- Uses crossterm for cross-platform terminal support
- Error handling powered by color-eyre
- Inspired by the need to manage ever-growing Homebrew installations efficiently
Support
If you find this tool useful, please consider:
- โญ Starring the repository
- ๐ Reporting bugs and issues
- ๐ก Suggesting new features
- ๐ค Contributing code improvements
Happy Homebrew sweeping! ๐งนโจ
Keep your system lean and your packages meaningful.
Dependencies
~17โ32MB
~392K SLoC