You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP β†’
Socket
Book a DemoSign in
Socket

clean-my-mac-cli

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-my-mac-cli

Open source CLI tool to clean your Mac - similar to CleanMyMac

latest
Source
npmnpm
Version
1.1.5
Version published
Maintainers
1
Created
Source

🧹 Clean My Mac CLI

Free & Open Source alternative to CleanMyMac

Scan and remove junk files, caches, logs, and more β€” all from your terminal.

npm version npm downloads CI License: MIT

Node.js Version Platform: macOS TypeScript Socket Badge

GitHub Stars

Save $90+

⚑ Quick Start

npx clean-my-mac-cli

That's it! No installation needed. The CLI will:

  • πŸ” Scan your Mac for cleanable files
  • πŸ“‹ Show you what was found with sizes
  • βœ… Let you select exactly what to clean
  • πŸ—‘οΈ Clean the selected items safely

🎬 See It In Action

$ npx clean-my-mac-cli

🧹 Clean My Mac
──────────────────────────────────────────────────────

Scanning your Mac for cleanable files...

Found 44.8 GB that can be cleaned:

? Select categories to clean (space to toggle, enter to confirm):
  β—‰ 🟒 Trash                            2.1 GB (45 items)
  β—‰ 🟒 Browser Cache                    1.5 GB (3 items)
  β—‰ 🟒 Temporary Files                549.2 MB (622 items)
  β—‰ 🟑 User Cache Files                15.5 GB (118 items)
  β—‰ 🟑 Development Cache               21.9 GB (14 items)

Summary:
  Items to delete: 802
  Space to free: 41.5 GB

? Proceed with cleaning? (Y/n)

βœ“ Cleaning Complete!
──────────────────────────────────────────────────────
  Trash                          βœ“ 2.1 GB freed
  Browser Cache                  βœ“ 1.5 GB freed
  Temporary Files                βœ“ 549.2 MB freed
  User Cache Files               βœ“ 15.5 GB freed
  Development Cache              βœ“ 21.9 GB freed

──────────────────────────────────────────────────────
πŸŽ‰ Freed 41.5 GB of disk space!
   Cleaned 802 items

✨ Features

FeatureDescription
πŸš€ One CommandJust run npx clean-my-mac-cli β€” no complex flags
🎯 InteractiveSelect exactly what you want to clean with checkboxes
πŸ›‘οΈ Safe by DefaultRisky items hidden unless you use --risky
πŸ” Smart ScanningFinds caches, logs, dev files, browser data, and more
πŸ“± App UninstallerRemove apps completely with all associated files
πŸ”§ MaintenanceFlush DNS cache, free purgeable space
πŸ”’ Privacy First100% offline β€” no data ever leaves your machine
πŸ“¦ Minimal DependenciesOnly 5 runtime deps, all from trusted maintainers

🎯 What It Cleans

🟒 Safe (always safe to delete)

CategoryWhat it cleans
trashFiles in the Trash bin
temp-filesTemporary files in /tmp and /var/folders
browser-cacheChrome, Safari, Firefox, Arc cache
homebrewHomebrew download cache
dockerUnused Docker images, containers, volumes

🟑 Moderate (generally safe)

CategoryWhat it cleans
system-cacheApplication caches in ~/Library/Caches
system-logsSystem and application logs
dev-cachenpm, yarn, pip, Xcode DerivedData, CocoaPods
node-modulesOrphaned node_modules in old projects

πŸ”΄ Risky (use --risky flag)

CategoryWhat it cleans
downloadsDownloads older than 30 days
ios-backupsiPhone and iPad backup files
mail-attachmentsDownloaded email attachments
duplicatesDuplicate files (keeps newest)
large-filesFiles larger than 500MB
language-filesUnused language localizations

πŸ“– Usage

Basic Usage

# Interactive mode β€” scan, select, and clean
npx clean-my-mac-cli

# Include risky categories
npx clean-my-mac-cli --risky

Uninstall Apps

Remove applications completely with all their preferences, caches, and support files:

npx clean-my-mac-cli uninstall

Maintenance Tasks

# Flush DNS cache (may require sudo)
npx clean-my-mac-cli maintenance --dns

# Free purgeable space
npx clean-my-mac-cli maintenance --purgeable

Other Commands

# List all available categories
npx clean-my-mac-cli categories

# Manage configuration
npx clean-my-mac-cli config --init
npx clean-my-mac-cli config --show

# Manage backups
npx clean-my-mac-cli backup --list
npx clean-my-mac-cli backup --clean

πŸ’» Global Installation

If you use this tool frequently:

npm install -g clean-my-mac-cli
clean-my-mac-cli

πŸ”’ Security

βœ… Open SourceAll code publicly available for audit
βœ… No NetworkOperates 100% offline
βœ… Minimal DepsOnly 5 runtime dependencies
βœ… CI/CDEvery release tested with TypeScript, ESLint, and automated tests
βœ… Socket.devDependencies monitored for supply chain attacks

Found a vulnerability? Report it via GitHub Security Advisories.

πŸ› οΈ Development

git clone https://github.com/guhcostan/clean-my-mac.git
cd clean-my-mac
npm install
npm run dev      # Run in dev mode
npm test         # Run tests
npm run lint     # Run linter
npm run build    # Build for production

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

πŸ“„ License

MIT License β€” see LICENSE for details.

⚠️ Disclaimer
This tool deletes files from your system. While we've implemented safety measures, always ensure you have backups of important data.

Made with ❀️ by developers who were tired of paying $90 for CleanMyMac

Keywords

mac

FAQs

Package last updated on 04 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts