Open source CLI tool to clean your Mac - remove junk files, caches, logs, and more
npm install mac-cleaner-cli
Free & Open Source Mac cleanup tool
Scan and remove junk files, caches, logs, and more โ all from your terminal.
๐ช Also available for Windows: windows-cleaner-cli
---
``bash`
npx mac-cleaner-cli
That's it! No installation needed. The CLI will:
1. ๐ Scan your Mac for cleanable files
2. ๐ Show you what was found with sizes
3. โ
Let you select exactly what to clean
4. ๐๏ธ Clean the selected items safely
`
$ npx mac-cleaner-cli
๐งน Mac Cleaner CLI
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
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)
โโ navigate โข โ back โข โ enter โข space select โข a all โข i invert โข โ submit
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
`
| Feature | Description |
|---------|-------------|
| ๐ One Command | Just run npx mac-cleaner-cli โ no complex flags |โ
| ๐ฏ Interactive | Select exactly what you want to clean with checkboxes |
| ๐ File Explorer | Drill down () into supported categories to select specific folders/files |--risky
| ๐ก๏ธ Safe by Default | Risky items hidden unless you use |
| ๐ Smart Scanning | Finds caches, logs, dev files, browser data, and more |
| ๐ฑ App Uninstaller | Remove apps completely with all associated files |
| ๐ง Maintenance | Flush DNS cache, free purgeable space |
| ๐ Privacy First | 100% offline โ no data ever leaves your machine |
| ๐ฆ Minimal Dependencies | Only 5 runtime deps, all from trusted maintainers |
| Category | What it cleans |
|----------|---------------|
| trash | Files in the Trash bin |temp-files
| | Temporary files in /tmp and /var/folders |browser-cache
| | Chrome, Safari, Firefox, Arc cache |homebrew
| | Homebrew download cache |docker
| | Unused Docker images, containers, volumes |
| Category | What it cleans |
|----------|---------------|
| system-cache | Application caches in ~/Library/Caches |system-logs
| | System and application logs |dev-cache
| | npm, yarn, pip, Xcode DerivedData, CocoaPods |node-modules
| | Orphaned node_modules in old projects |
| Category | What it cleans |
|----------|---------------|
| downloads | Downloads older than 30 days |ios-backups
| | iPhone and iPad backup files |mail-attachments
| | Downloaded email attachments |duplicates
| | Duplicate files (keeps newest) |large-files
| | Files larger than 500MB |language-files
| | Unused language localizations |
`bashInteractive mode โ scan, select, and clean
npx mac-cleaner-cli
$3
In interactive mode, you can drill into some categories and select specific folders/files to delete:
- Controls:
โโ navigate โข โ back โข โ enter โข space select โข a all โข i invert โข โ submit
- Supported categories include: User Cache Files (system-cache), Temporary Files (temp-files), System Log Files (system-logs), Development Cache (dev-cache), Browser Cache (browser-cache), Homebrew Cache (homebrew)$3
Remove applications completely with all their preferences, caches, and support files:
`bash
npx mac-cleaner-cli uninstall
`$3
`bash
Flush DNS cache (may require sudo)
npx mac-cleaner-cli maintenance --dnsFree purgeable space
npx mac-cleaner-cli maintenance --purgeable
`$3
`bash
List all available categories
npx mac-cleaner-cli categoriesManage configuration
npx mac-cleaner-cli config --init
npx mac-cleaner-cli config --showManage backups
npx mac-cleaner-cli backup --list
npx mac-cleaner-cli backup --clean
`$3
`bash
Show help
npx mac-cleaner-cli -h # or --help
Show version
npx mac-cleaner-cli -V # or --version
Directory paths shown in absolute format
npx mac-cleaner-cli -A # or --absolute-paths
`๐ป Global Installation
If you use this tool frequently:
`bash
npm install -g mac-cleaner-cli
mac-cleaner-cli
`๐ Security
| | |
|---|---|
| โ
Open Source | All code publicly available for audit |
| โ
No Network | Operates 100% offline |
| โ
Minimal Deps | Only 5 runtime dependencies |
| โ
CI/CD | Every release tested with TypeScript, ESLint, and automated tests |
| โ
Socket.dev | Dependencies monitored for supply chain attacks |
Found a vulnerability? Report it via GitHub Security Advisories.
๐ ๏ธ Development
`bash
git clone https://github.com/guhcostan/mac-cleaner-cli.git
cd mac-cleaner-cli
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.
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add some amazing feature')
4. Push to the branch (git push origin feature/amazing-feature`)If this tool saved you time or disk space, consider supporting the project!
Your support helps maintain and improve this tool. Thank you! ๐
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 โค๏ธ for Mac users everywhere