
Clean Xcode, Docker, Homebrew, and developer caches, remove project and AI artifacts, analyze storag
Clean Xcode, Docker, Homebrew, and developer caches, remove project and AI artifacts, analyze storag
Built and used daily by the CleanMyMac team on our own Macs
Developer storage builds up across Docker, Xcode, package managers, project folders, and AI tools. CleanMyMac CLI brings those leftovers into one place, shows what can be removed, and leaves the final decision to you.
CleanMyMac CLI is currently in public beta. Commands and behavior may evolve as we improve the experience.
The formula lives in our tap — MacPaw/homebrew-taps
brew install --cask cleanmymac-cli
Verify the installation:
cleanmymac --version
Then launch the interactive interface:
cleanmymac
Or start by analyzing what is taking up space:
cleanmymac analyze
! Both cleanmymac and cmm run the same tool.
Getting Started · Commands · Safety & Privacy · FAQ
Find removable files created by developer tools, package managers, Xcode, AI tools, and macOS:
cleanmymac clean
Scan a specific cleanup category:
cleanmymac clean dev
cleanmymac clean junk
cleanmymac clean ai
cleanmymac clean trash
CleanMyMac CLI can detect caches and generated files from tools including: Homebrew, npm, Yarn, and pnpm, pip, Poetry, and uv, Xcode DerivedData, Device Support, Module Cache, and other Xcode-related files, supported AI-tool artifacts etc
You review detected items before cleanup.
Development projects accumulate generated files that can take gigabytes of disk space: node_modules, .next, .turbo, target, .build etc
Find them across common project folders:
cleanmymac purge
Or scan a specific directory:
cleanmymac purge ~/Projects
Results are grouped by project so you know what each artifact belongs to.
Artifacts older than seven days are preselected. Newer artifacts remain visible but unchecked for manual review.
[!TIP] Use
cleanfor shared caches and tool-generated junk.
Usepurgefor removable dependencies and build artifacts stored inside project folders.
Not sure where your disk space went?
Open the interactive storage analyzer:
cleanmymac analyze
Or start from a specific folder:
cleanmymac analyze ~/Projects
Navigate through directories by size, explore what is consuming storage, and reveal items in Finder.
Browsing through the analyzer does not modify your files. Any removal action requires an explicit selection and confirmation.
[!TIP] If your Mac is running out of storage and you are not sure what is safe to remove, start with
cleanmymac analyze.
Run lightweight maintenance tasks directly from Terminal:
cleanmymac optimize
Or run them separately:
cleanmymac optimize ram
cleanmymac optimize purgeable
optimize ram releases inactive memoryoptimize purgeable asks macOS to release disk space already marked as purgeableThese commands do not remove project source code or personal documents.
CleanMyMac CLI is designed around transparency and control.
Before cleanup, you can inspect what was detected and decide what should be removed.
Safety features include:
Protect a path permanently:
cleanmymac ignore add ~/Projects/important-project
View protected paths:
cleanmymac ignore list
Remove a path from the ignore list:
cleanmymac ignore remove ~/Projects/important-project
[!WARNING]
--forceskips interactive confirmation for supported cleanup commands and removes detected items immediately. Run the command without--forcefirst and review what it finds.
Learn more: Safety and Privacy
| Command | Description |
|---|---|
clean |
Runs all clean categories at once: system junk, dev-tools junk, and trash |
clean ai |
Scans for junk created by AI tools, shows what can be safely removed, and cleans it after your confirmation |
clean dev |
Clears cached packages and build files left by developer tools: Homebrew, npm, Yarn, pnpm, pip, Cargo, Go, CocoaPods, Docker, VS Code, JetBrains, Maven, Gradle, Poetry, uv, Bun, Deno, and mise |
clean junk |
Clears user logs, Xcode DerivedData, Device Support, Module Cache, Documentation Cache, and other Xcode-related junk |
clean trash |
Empties the system trash and mounted-volume trash bins |
clean --force |
Deletes immediately, skipping the confirmation prompt |
purge |
Scans developer folders (~/Projects, ~/Code, ~/dev, ~/GitHub, ~/Workspace) and lists removable build artifacts grouped by project for review. Detects node_modules, .next, .turbo, target, .build, .venv, venv, pycache, Pods, DerivedData, vendor, and cmake-build-*. Artifacts older than 7 days are preselected; newer ones are shown unchecked |
purge |
Scans a specific folder for removable project artifacts |
analyze |
Opens an interactive disk usage explorer |
analyze |
Explores disk usage within a specific folder |
optimize |
Frees RAM and purgeable disk space in one command |
optimize ram |
Releases inactive memory (no sudo required) |
optimize purgeable |
Clears space macOS has marked as purgeable but not yet released |
config |
Opens CLI settings, including the analytics toggle |
ignore add |
Adds a path to the ignore list so it never appears in clean, purge, or analyze results |
For detailed examples, see the Commands documentation.
Solve common developer storage problems with practical step-by-step guides:
A typical cleanup takes three steps:
cleanmymac clean/purge
CleanMyMac CLI scans supported locations and groups what it finds.
Inspect categories and paths, then select or deselect what you want to remove.
After cleanup, CleanMyMac CLI shows what was removed and how much disk space was recovered.
Open the interactive interface or run exactly what you need. This makes CleanMyMac CLI useful both as an interactive cleanup tool and as part of command-line workflows.
cleanmymac
…
Run:
M
cleanmymac clean Scan and review junk on your Mac
cleanmymac clean junk Scan and review system junk only
cleanmymac clean dev Scan and review developer-tool junk only
cleanmymac clean ai Scan and review ai-tool junk only
cleanmymac clean trash Scan and review items in Trash only
--force Skip confirmation and clean immediately
cleanmymac purge Find project artifacts in common developer folders
cleanmymac purge Scan a specific directory for project artifacts
--force Skip confirmation and clean immediately
cleanmymac analyze Explore storage usage in your home directory
cleanmymac analyze Explore storage usage inside a specific directory
cleanmymac optimize Free RAM and release purgeable disk space
cleanmymac optimize ram Release inactive memory
cleanmymac optimize purgeable Release purgeable disk space
cleanmymac config Manage CLI preferences
cleanmymac ignore list Show ignored paths
cleanmymac ignore add Add a path to the ignore list
cleanmymac ignore remove Remove a path from the ignore list
cleanmymac --help Show all commands and options
cleanmymac --version Show the installed version
cleanmymac cat Summon a friend
Esc Back to menu · Q Quit
beta · cleanmymac.com · lovingly crafted by MacPaw
> ⚠️ The `--force` flag skips interactive confirmation for supported cleanup commands. Use it only after reviewing what the command detects without the flag.
---
### Clean developer, system, and AI junk
Use `clean` for leftovers created outside individual project folders: package-manager caches, Xcode files, developer-tool data, AI-tool artifacts, user logs, and Trash.
CleanMyMac CLI scans first and groups the results by category:
```text
$ cleanmymac clean
← Back to menu
23.79 GB of items found
Scan results
Select items you'd like to remove
▸ ■ System Junk 631 KB →
■ Dev Tools 23.43 GB →
□ AI Junk 358.7 MB →
40 items selected (23.43 GB)
↑↓←→ Navigate · Enter Confirm · Space Toggle · A Select all
Esc Back to menu · Q Quit
beta · cleanmymac.com · lovingly crafted by MacPaw
Press → to open a category and inspect its contents. Use Space to select or deselect individual items. Nothing is removed until you review the selection and confirm the cleanup.
After cleanup, CleanMyMac CLI shows exactly what was removed and how much space was recovered:
Cleanup complete!
Dev Tools
✓ Homebrew 6.61 GB
✓ npm 5.03 GB
✓ Yarn 3.3 GB
✓ pnpm 4.72 GB
✓ pip 3.77 GB
AI J
No open issues yet, or sync has not completed.