Your Mac is full of junk.
One command cleans it.

A free, open-source CLI that frees up gigabytes of disk space — caches, logs, Homebrew leftovers, Xcode DerivedData, orphaned node_modules, and more.

No subscription No telemetry No bloatware MIT licensed
$ npx mac-cleaner-cli

Requires Node.js ≥ 20 · macOS only · nothing is deleted without your confirmation

npm version npm downloads GitHub stars CI status
mac-cleaner-cli — zsh
$ npx mac-cleaner-cli 🧹 Mac Cleaner CLI ────────────────────────────────────────────────── Scanning your Mac for cleanable files... Found 18.4 GB that can be cleaned: ? Select categories to clean (space to toggle, enter to confirm) > Development Cache 14 items 8.2 GB ████████████████████ User Cache Files 118 items 5.1 GB ████████████▌ Node Modules 7 items 2.6 GB ██████▍ Trash 45 items 1.4 GB ███▍ Browser Cache 3 items 581.5 MB █▌ Homebrew Cache 12 items 402.9 MB ✓ Cleaning Complete! ────────────────────────────────────────────────── 🎉 Freed 15.9 GB of disk space!

Built for developers, safe for everyone

You see everything before it happens, and you choose exactly what gets removed.

Interactive selection

Scan first, then pick categories — or drill into individual folders and files with the built-in file picker. Nothing is deleted without confirmation.

Safety levels

Every category is classified safe, moderate, or risky. Risky ones (downloads, iOS backups) are hidden unless you explicitly opt in.

Automation-ready

Non-interactive scan --json and clean --yes commands make it perfect for cron jobs, scripts, and CI.

Dry-run everything

Preview exactly what would be removed with --dry-run before committing to anything.

App uninstaller

Remove applications completely — preferences, caches, launch agents, and support files included. No leftovers.

Maintenance tasks

Flush DNS, free purgeable space, and delete local Time Machine snapshots that can silently eat hundreds of gigabytes.

Hardened by design

Protected-path guards, TOCTOU re-checks before deletion, symlink-safe removal, and command-injection-proof execution.

100% open source

MIT licensed, fully tested TypeScript. Read every line of what runs on your machine — or contribute your own scanner.

What it cleans

16 categories of junk, each with a clear safety rating.

Temporary Files
Trash
Browser Cache
Homebrew Cache
Docker (unused images)
User Cache Files
System Log Files
Development Cache
Orphaned node_modules
Orphaned Launch Agents
Old Downloads
iOS Backups
Mail Attachments
Language Files
Large Files (review)
Duplicate Files
Safe — selected freely Moderate — apps may rebuild Risky — opt-in only

Script it. Schedule it.
Forget about it.

Every scan and clean works without a UI, so your Mac can stay clean on autopilot.

  • scan --json — machine-readable output for scripts and integrations
  • clean --categories trash,browser-cache --yes — perfect for a weekly cron job
  • clean --all --dry-run — see the full report without touching a file
  • Risky categories are always excluded unless you pass --unsafe
# See what's reclaimable, as JSON $ mac-cleaner-cli scan --json | jq .totalSize 19758418935 # Weekly cleanup, no prompts $ mac-cleaner-cli clean \ --categories trash,browser-cache,homebrew \ --yes ✓ Cleaning Complete Freed: 2.4 GB

A free alternative to paid Mac cleaners

Apps like CleanMyMac charge $40+ per year for what your terminal can do for free.

mac-cleaner-cliPaid cleaner apps
PriceFree forever$40+/year
Open source
Telemetry & upsellsNoneBuilt in
Scriptable / automatable
Runs in your terminal
Background daemonsNoneAlways running

Frequently asked questions

Everything you might want to know before running it.

Is mac-cleaner-cli safe to use?
Yes. Nothing is deleted without your explicit confirmation, every category has a clear safety rating, and risky categories are hidden unless you opt in. Protected system paths can never be deleted, and you can preview any operation with --dry-run. The code is fully open source under the MIT license, so you can audit exactly what it does.
Is it really free? What's the catch?
There is no catch. mac-cleaner-cli is MIT-licensed open source software with no subscription, no trial, no telemetry, and no upsells. It exists because paying $40+/year for disk cleanup felt wrong.
How is it different from CleanMyMac and similar apps?
It does the core job — reclaiming disk space from caches, logs, and developer junk — without a paid subscription, background daemons, or telemetry. Being a CLI, it is also fully scriptable: you can automate weekly cleanups with cron or CI using non-interactive commands.
What kind of files does it clean?
16 categories: user and system caches, logs, temporary files, Trash, browser caches, Homebrew cache, Docker leftovers, Xcode DerivedData and other development caches, orphaned node_modules, old downloads, iOS backups, mail attachments, unused language files, large files, duplicates, and orphaned launch agents.
Do I need to install anything?
No permanent install is required — run 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.
How much disk space can I expect to free?
It depends on how you use your Mac. Developers commonly recover 10–30 GB from Xcode DerivedData, npm/yarn caches, Docker images, and orphaned node_modules alone. Regular users typically free several gigabytes of caches, logs, and forgotten files.

Reclaim your disk space now

One command. No install. Gigabytes back in minutes.

$ npx mac-cleaner-cli