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-cli with no installation required.
  • Interactive selection with checkboxes, folder-level drill-down, and safe-by-default behavior (risky items hidden unless --risky is 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 --json and clean --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.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/guhcostanmac-cleaner-cli.svg)](https://yunodb.com/tools/guhcostanmac-cleaner-cli?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/guhcostanmac-cleaner-cli?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/guhcostanmac-cleaner-cli.svg" alt="Featured on YunoDB" height="20"></a>