Loading...
Loading...
Free disk space on macOS using an interactive CLI that clears caches, logs, Homebrew, Xcode junk, and more
npx skill4agent add aradotso/devtools-skills mac-cleaner-cli-disk-cleanupSkill by ara.so — Devtools Skills collection.
mac-cleaner-cli--riskynpx mac-cleaner-clinpm install -g mac-cleaner-cli
mac-cleaner-cligit clone https://github.com/guhcostan/mac-cleaner-cli.git
cd mac-cleaner-cli
bun install
bun run dev# Basic interactive mode - scan and clean
npx mac-cleaner-cli
# Include risky categories (downloads, iOS backups, duplicates, large files)
npx mac-cleaner-cli --risky
# Force file picker for ALL categories
npx mac-cleaner-cli --risky -f
# Show absolute paths
npx mac-cleaner-cli -A
# Disable progress bars
npx mac-cleaner-cli --no-progress↑↓←→spaceai⏎# Uninstall apps completely with preferences and support files
npx mac-cleaner-cli uninstall# Flush DNS cache (may require sudo)
npx mac-cleaner-cli maintenance --dns
# Free purgeable space
npx mac-cleaner-cli maintenance --purgeable# List all available cleaning categories
npx mac-cleaner-cli categories# Initialize configuration file
npx mac-cleaner-cli config --init
# Show current configuration
npx mac-cleaner-cli config --show# List all backups
npx mac-cleaner-cli backup --list
# Clean old backups
npx mac-cleaner-cli backup --clean# Show version
npx mac-cleaner-cli --version
npx mac-cleaner-cli -V
# Show help
npx mac-cleaner-cli --help
npx mac-cleaner-cli -h| Category | Description |
|---|---|
| Files in Trash bin |
| Temporary files in /tmp and /var/folders |
| Chrome, Safari, Firefox, Arc cache |
| Homebrew download cache |
| Unused Docker images, containers, volumes |
| Category | Description |
|---|---|
| Application caches in ~/Library/Caches |
| System and application logs |
| npm, yarn, pip, Xcode DerivedData, CocoaPods |
| Orphaned node_modules in old projects |
--risky| Category | Description |
|---|---|
| Downloads older than 30 days |
| iPhone and iPad backup files |
| Downloaded email attachments |
| Duplicate files (keeps newest) |
| Files larger than 500MB |
| Unused language localizations |
# Run interactively, select common safe categories
npx mac-cleaner-cli
# Select: Trash, Browser Cache, Temporary Files, User Cache Files, Development Cache# Clean development caches and orphaned node_modules
npx mac-cleaner-cli
# Focus on: Development Cache, node_modules folders# Include all categories including risky ones
npx mac-cleaner-cli --risky
# Review carefully before cleaning downloads, iOS backups, etc.# Run interactive mode
npx mac-cleaner-cli
# Navigate to a category like "User Cache Files"
# Press → to open file explorer
# Select specific app caches to remove
# Press ← to go back, space to toggle, ⏎ to confirm# Non-interactive cleanup (future feature)
# Currently, the tool is interactive-first
# For automated scripts, consider using with expect or similar tools# Remove app with all associated files
npx mac-cleaner-cli uninstall
# Select app from list
# Confirms removal of .app, preferences, caches, support filesnpx mac-cleaner-cli config --init~/.mac-cleaner-cli/config.jsonnpx mac-cleaner-cli config --show{
"defaultCategories": ["trash", "temp-files", "browser-cache"],
"excludePaths": [
"/Users/username/important-cache"
],
"backupBeforeClean": true,
"showAbsolutePaths": false
}# Some system files may require elevated permissions
# The tool generally runs as current user
# For DNS flush:
sudo npx mac-cleaner-cli maintenance --dns# Use the --risky flag
npx mac-cleaner-cli --risky# Not all categories support file-level selection
# Supported: User Cache Files, Temporary Files, System Log Files,
# Development Cache, Browser Cache, Homebrew Cache
# Use -f to force file picker for all categories
npx mac-cleaner-cli -f# Check if backups are enabled in config
npx mac-cleaner-cli backup --list
# Restore from Time Machine or system backups
# Always verify selections before confirming cleanup# Stop all containers first
docker stop $(docker ps -aq)
# Then run cleaner
npx mac-cleaner-climac-cleaner-cli: command not found# Ensure npm global bin is in PATH
npm config get prefix
# Add to PATH: export PATH="$PATH:$(npm config get prefix)/bin"
# Or use npx
npx mac-cleaner-cli// Example: Potential programmatic usage (check actual API)
import { scan, clean } from 'mac-cleaner-cli';
// Note: The tool is primarily CLI-focused
// Check package exports for programmatic API availabilitygit clone https://github.com/guhcostan/mac-cleaner-cli.git
cd mac-cleaner-cli
# Install dependencies
bun install
# Run in development
bun run dev
# Run tests
bun run test
# Lint code
bun run lint
# Build for production
bun run buildmac-cleaner-cli/
├── src/ # TypeScript source code
├── tests/ # Test files
├── assets/ # Banner images, assets
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── README.md # Documentation--risky→--riskypackage.jsonwindows-cleaner-cli# Check disk usage before cleanup
df -h
# Check specific directory sizes
du -sh ~/Library/Caches/*
# Manual cleanup alternatives
brew cleanup --prune=all
docker system prune -a
rm -rf ~/Library/Developer/Xcode/DerivedData
# Check what's using disk space
ncdu /