mac-cleaner-cli
Free macOS CLI to clean disk space — caches, logs, Homebrew, Xcode. Open-source alternative to CleanMyMac
What is mac-cleaner-cli?
Free macOS CLI to clean disk space — caches, logs, Homebrew, Xcode. Open-source alternative to CleanMyMac
Overview of mac-cleaner-cli
What it is
mac-cleaner-cli is a free, open-source command-line tool for macOS that frees up disk space by removing caches, logs, Homebrew leftovers, Xcode DerivedData, and other junk files. It is designed as an alternative to paid tools like CleanMyMac, with no subscription, no telemetry, and no bloatware. The project also offers a menu bar desktop app built on the same scanners.
Key features
- One-command execution via
npx mac-cleaner-cliwith no installation required. - Interactive selection with checkboxes, folder-level drill-down, and safe-by-default behavior (risky items hidden unless
--riskyis used). - Dry-run mode to preview deletions, optional backups to a restore folder, and scriptable JSON output for cron/CI.
- Menu bar app with daily automatic cleaning, Deep Clean mode, and history tracking.
- App uninstaller, DNS cache flush, and purgeable space freeing.
- 100% offline operation with minimal dependencies (5 runtime dependencies).
Use cases
- Quickly reclaiming disk space on a Mac without installing a GUI application.
- Automating disk cleanup in CI/CD pipelines or cron jobs using
scan --jsonandclean --categories … --yes. - Removing development artifacts (npm, yarn, pip, Xcode DerivedData, CocoaPods, Rust, Go, Node build output) from workspaces.
- Managing Homebrew and Docker cleanup (unused images, stopped containers, build cache).
- Uninstalling applications completely with all associated files.
Getting started
bashnpx mac-cleaner-cliThat's it. No installation needed. The CLI will scan, show found items with sizes, let you select what to clean, and clean only what you chose.
License and pricing
License: MIT. Pricing: open-source and free.
Based on the project's public README and repository metadata.