garbageman is a minimal, safe, permission-aware CLI for reclaiming disk space on macOS.
It is dry-run by default, never deletes outside explicit allowlists, and skips protected categories gracefully when Full Disk Access is missing.
- Dry-run by default
- Interactive
--cleanmode with per-group or per-item confirmation - Category filtering with
--onlyand--skip --verbosedry-run output that lists every deletion candidate path- JSON output for scripting
- Hard safety boundary around approved cleanup roots
- Full Disk Access guidance for protected categories
- Universal macOS release packaging for GitHub Releases and Homebrew
brew tap yunusemreyakisan/tap
brew install garbagemanHomebrew installs are binary-only and follow the latest published GitHub release asset.
If another tap or formula named garbageman ever conflicts locally, install it explicitly with:
brew install yunusemreyakisan/tap/garbagemanswift build -c release
cp .build/release/garbageman /usr/local/bin/garbagemangarbageman
garbageman --summary
garbageman --verbose
garbageman --clean
garbageman --clean --only caches,trash,brew
garbageman --clean --skip xcode,docker
garbageman --clean --yes-safe --only caches,npm,brew
garbageman --clean --downloads-older-than 60
garbageman --clean --keep-last-archives 5
garbageman --jsoncaches: user cache directories inside~/Library/Cacheslogs: user-space logs inside~/Library/Logstrash: user Trash contents inside~/.Trashxcode: DerivedData plus old archives, keeping the newest--keep-last-archivesentriessimulators: iOS Simulator devices, grouped and confirmed per runtimebrew:brew --cachenpm:~/.npm/_cacachepip:~/Library/Caches/pipyarn:~/Library/Caches/Yarngradle:~/.gradle/cachespods:~/Library/Caches/CocoaPodsandroid: Android emulator snapshot directories under~/.android/avd/*/snapshotsdocker: untagged dangling Docker images onlydownloads: direct files in~/Downloadsolder than--downloads-older-than, confirmed per fileios-backups: Finder/iTunes backups in~/Library/Application Support/MobileSync/Backup, confirmed per backup
- Full Disk Access is only requested when protected categories such as
ios-backupsneed it. - If access is missing,
garbagemanprints guidance, offers to open System Settings, and continues with accessible categories. - Regular user-owned locations such as caches, logs, Trash, and package-manager caches do not require special permissions.
- No deletion happens unless
--cleanis set. - Every filesystem deletion target must be inside an approved root for its category.
- Category root directories themselves are never deleted; only discovered contents inside them are eligible.
- Protected paths such as
/System,/Applications,~/Documents,~/Desktop,~/Library/Preferences,~/Library/Keychains, and iCloud Drive are always rejected. - Docker cleanup is limited to dangling images; volumes are intentionally out of scope.
git push origin stable
git tag v1.0.2
git push origin v1.0.2- Pushes and pull requests run CI on GitHub Actions.
- Before tagging, make sure the
HOMEBREW_TAP_TOKENrepository secret is configured inyunusemreyakisan/garbagemanwith write access toyunusemreyakisan/homebrew-tap. - A semver tag such as
v1.0.2publishes a universal macOS release asset on GitHub. - Homebrew availability for a version starts only after that release asset exists.
- The release workflow updates
yunusemreyakisan/homebrew-tapafter publishing the GitHub release. - The tap repo validates the formula on pushes and pull requests so Homebrew installs stay healthy.
MIT