Skip to content

Commands

Nat edited this page Jul 17, 2026 · 1 revision

Commands

CleanMyMac CLI can be used through the interactive menu or by running commands directly.

Both aliases launch the same tool:

cleanmymac
cmm

This documentation uses cleanmymac in all examples.

Command overview

Command What it does
cleanmymac Opens the interactive menu
cleanmymac clean Scans all cleanup categories
cleanmymac clean junk Scans system and Xcode-related junk
cleanmymac clean dev Scans caches and files left by developer tools
cleanmymac clean ai Scans junk created by AI tools
cleanmymac clean trash Scans the system and mounted-volume Trash
cleanmymac purge Finds removable artifacts in common project folders
cleanmymac purge <path> Scans a specific folder for project artifacts
cleanmymac analyze Explores disk usage
cleanmymac analyze <path> Explores disk usage inside a specific folder
cleanmymac optimize Frees RAM and releases purgeable disk space
cleanmymac optimize ram Releases inactive memory
cleanmymac optimize purgeable Releases purgeable disk space
cleanmymac config Opens CLI preferences
cleanmymac ignore list Shows protected paths
cleanmymac ignore add <path> Adds a path to the ignore list
cleanmymac ignore remove <path> Removes a path from the ignore list
cleanmymac --help Shows available commands and options
cleanmymac --version Shows the installed version

Clean

Use clean for caches and other tool-generated files stored outside individual project folders.

Run all cleanup categories:

cleanmymac clean

Or scan one category:

cleanmymac clean junk
cleanmymac clean dev
cleanmymac clean ai
cleanmymac clean trash

CleanMyMac CLI scans first and shows the detected items before anything is removed.

Developer tools

cleanmymac clean dev detects cached packages and build files left by tools such as:

  • Homebrew
  • npm, Yarn, and pnpm
  • pip, Poetry, and uv
  • Cargo and Go
  • CocoaPods
  • Docker
  • VS Code and JetBrains
  • Maven and Gradle
  • Bun, Deno, and mise

Purge

Use purge for generated artifacts stored inside development projects, including dependencies, virtual environments, and build directories.

Scan common project folders:

cleanmymac purge

By default, the command checks:

~/Projects
~/Code
~/dev
~/GitHub
~/Workspace

Scan a specific location:

cleanmymac purge ~/Work

Results are grouped by project. Artifacts older than seven days are preselected, while newer artifacts remain visible but unchecked.

purge targets generated artifacts, not project source code. Always review the selected paths before confirming.

Analyze

Explore disk usage in your home directory:

cleanmymac analyze

Start from a specific folder:

cleanmymac analyze ~/Projects

Use the arrow keys to navigate through folders and press O to reveal the selected item in Finder.

Browsing is read-only. Removing an item requires an explicit selection and confirmation.

Not sure where to begin? Start with cleanmymac analyze to understand what is consuming your storage.

Optimize

Run all available optimization tasks:

cleanmymac optimize

Or run them separately:

cleanmymac optimize ram
cleanmymac optimize purgeable
  • optimize ram releases inactive memory
  • optimize purgeable asks macOS to release disk space already marked as purgeable

These commands do not remove project source code or personal documents.

Protect important paths

Add a file or folder to the ignore list:

cleanmymac ignore add ~/Projects/important-project

Review protected paths:

cleanmymac ignore list

Remove a path from the ignore list:

cleanmymac ignore remove ~/Projects/important-project

Ignored paths remain excluded from clean, purge, and analyze until you remove them from the list.

Configuration

Open CLI preferences:

cleanmymac config

Configuration changes persist between sessions.

Skip confirmation

Supported cleanup commands can be run with --force:

cleanmymac clean --force
cleanmymac purge --force

⚠️ --force skips interactive confirmation and removes detected items immediately. Run the command without this option first and review what it finds.

Help

View all commands and options:

cleanmymac --help

Check the installed version:

cleanmymac --version

Next steps

Clone this wiki locally