A free, open-source CLI that frees up gigabytes of disk space — caches, logs, Homebrew leftovers, Xcode DerivedData, orphaned node_modules, and more.
npx mac-cleaner-cli
Requires Node.js ≥ 20 · macOS only · nothing is deleted without your confirmation
You see everything before it happens, and you choose exactly what gets removed.
Scan first, then pick categories — or drill into individual folders and files with the built-in file picker. Nothing is deleted without confirmation.
Every category is classified safe, moderate, or risky. Risky ones (downloads, iOS backups) are hidden unless you explicitly opt in.
Non-interactive scan --json and clean --yes commands make it perfect for cron jobs, scripts, and CI.
Preview exactly what would be removed with --dry-run before committing to anything.
Remove applications completely — preferences, caches, launch agents, and support files included. No leftovers.
Flush DNS, free purgeable space, and delete local Time Machine snapshots that can silently eat hundreds of gigabytes.
Protected-path guards, TOCTOU re-checks before deletion, symlink-safe removal, and command-injection-proof execution.
MIT licensed, fully tested TypeScript. Read every line of what runs on your machine — or contribute your own scanner.
16 categories of junk, each with a clear safety rating.
Every scan and clean works without a UI, so your Mac can stay clean on autopilot.
scan --json — machine-readable output for scripts and integrationsclean --categories trash,browser-cache --yes — perfect for a weekly cron jobclean --all --dry-run — see the full report without touching a file--unsafeApps like CleanMyMac charge $40+ per year for what your terminal can do for free.
| mac-cleaner-cli | Paid cleaner apps | |
|---|---|---|
| Price | Free forever | $40+/year |
| Open source | ✓ | ✗ |
| Telemetry & upsells | None | Built in |
| Scriptable / automatable | ✓ | ✗ |
| Runs in your terminal | ✓ | ✗ |
| Background daemons | None | Always running |
Everything you might want to know before running it.
--dry-run. The code is fully open source under the MIT license, so you can audit exactly what it does.npx mac-cleaner-cli with Node.js 20 or newer and it just works. You can also install it globally with npm install -g mac-cleaner-cli.One command. No install. Gigabytes back in minutes.
npx mac-cleaner-cli