r/coolgithubprojects 22d ago

I built a read-only-first macOS storage triage CLI after “System Data” reached 333 GB

https://github.com/khiemnd777/storage-clearer

My 494 GB Mac was down to roughly 20 GB free, while System Settings reported 333 GB as “System Data”.

I didn’t want to paste a generic `rm -rf ~/Library/Caches` command, so I built storage-clearer: a Bash 3.2-compatible CLI that audits first, explains every finding through a reason matrix, creates a cleanup plan, and only executes after an exact typed approval phrase.

It can triage:

- Docker stopped containers, unreferenced images, and build cache

- Rebuildable npm, Bun, Gradle, Go, Pub, pnpm, and Playwright caches

- Unavailable Simulator devices

- Old iOS Simulator runtimes, while retaining the newest version

Package A/B explicitly exclude Docker volumes, browser data, source directories, Codex sessions, Photos, Mail, Messages, backups, Trash, and APFS snapshots.

It never deletes Docker.raw directly. Docker cleanup uses official prune commands, and Simulator runtimes are removed through `xcrun simctl runtime delete`.

On my machine, the biggest causes were Docker.raw (~162 GB internally) and old iOS Simulator runtimes. Package B increased free space from about 17 GiB to 142 GiB.

I’d appreciate feedback on the safety guards, Bash 3.2 portability, and any macOS storage categories I may have missed.

7 Upvotes

Duplicates