MCPInstall

mac-cleaner-cli-disk-cleanup

Free disk space on macOS using an interactive CLI that clears caches, logs, Homebrew, Xcode junk, and more

Installs
222
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/reason-machines/devtools-skills --skill mac-cleaner-cli-disk-cleanup
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads mac-cleaner-cli-disk-cleanup automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

mac-cleaner-cli Skill

Skill by ara.so — Devtools Skills collection.

What It Does

mac-cleaner-cli is a TypeScript-based CLI tool that helps free up disk space on macOS by cleaning:

  • System and user caches
  • Browser caches (Chrome, Safari, Firefox, Arc)
  • Temporary files
  • Development caches (npm, yarn, pip, Xcode DerivedData, CocoaPods)
  • Homebrew downloads and cache
  • Docker images and containers
  • System logs
  • Trash
  • Orphaned node_modules
  • iOS backups, downloads, mail attachments (risky categories)

Key features:

  • Interactive checkbox selection
  • Drill-down file explorer for granular control
  • Safe by default (risky items require --risky flag)
  • App uninstaller with complete cleanup
  • 100% offline, no telemetry
  • Minimal dependencies

Installation

One-Time Usage (Recommended)

npx mac-cleaner-cli

Global Installation

npm install -g mac-cleaner-cli
mac-cleaner-cli

For Development

git clone https://github.com/guhcostan/mac-cleaner-cli.git
cd mac-cleaner-cli
bun install
bun run dev

Key Commands

Interactive Cleanup (Main Command)

# 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

Interactive controls:

  • ↑↓ navigate items
  • ← go back
  • → drill into category (file explorer)
  • space toggle selection
  • a select all
  • i invert selection
  • ⏎ submit/confirm

App Uninstaller

# Uninstall apps completely with preferences and support files
npx mac-cleaner-cli uninstall

Maintenance Tasks

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

# Free purgeable space
npx mac-cleaner-cli maintenance --purgeable

Category Management

# List all available cleaning categories
npx mac-cleaner-cli categories

Configuration

# Initialize configuration file
npx mac-cleaner-cli config --init

# Show current configuration
npx mac-cleaner-cli config --show

Backup Management

# List all backups
npx mac-cleaner-cli backup --list

# Clean old backups
npx mac-cleaner-cli backup --clean

Help and Version

# Show version
npx mac-cleaner-cli --version
npx mac-cleaner-cli -V

# Show help
npx mac-cleaner-cli --help
npx mac-cleaner-cli -h

Categories

Safe Categories (Always Safe)

CategoryDescription
trashFiles in 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 Categories (Generally Safe)

CategoryDescription
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 Categories (Requires --risky Flag)

CategoryDescription
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

Common Usage Patterns

Quick Disk Cleanup

# Run interactively, select common safe categories
npx mac-cleaner-cli
# Select: Trash, Browser Cache, Temporary Files, User Cache Files, Development Cache

Developer Cleanup

# Clean development caches and orphaned node_modules
npx mac-cleaner-cli
# Focus on: Development Cache, node_modules folders

Deep Clean with Risky Categories

# Include all categories including risky ones
npx mac-cleaner-cli --risky
# Review carefully before cleaning downloads, iOS backups, etc.

Drill Down into Specific Folders

# 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

CI/CD Usage

# Non-interactive cleanup (future feature)
# Currently, the tool is interactive-first
# For automated scripts, consider using with expect or similar tools

Complete App Removal

# Remove app with all associated files
npx mac-cleaner-cli uninstall
# Select app from list
# Confirms removal of .app, preferences, caches, support files

Configuration

The tool supports a configuration file for customizing behavior.

Initialize Config

npx mac-cleaner-cli config --init

This creates a config file at ~/.mac-cleaner-cli/config.json (exact location may vary).

View Current Config

npx mac-cleaner-cli config --show

Configuration Options

While the exact schema isn't fully documented in the README, typical options might include:

{
  "defaultCategories": ["trash", "temp-files", "browser-cache"],
  "excludePaths": [
    "/Users/username/important-cache"
  ],
  "backupBeforeClean": true,
  "showAbsolutePaths": false
}

Troubleshooting

Permission Errors

Problem: "Permission denied" when cleaning certain files.

Solution:

# Some system files may require elevated permissions
# The tool generally runs as current user
# For DNS flush:
sudo npx mac-cleaner-cli maintenance --dns

Categories Not Showing

Problem: Risky categories aren't visible.

Solution:

# Use the --risky flag
npx mac-cleaner-cli --risky

File Picker Not Available

Problem: Can't drill down into a category.

Solution:

# 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

Large Scan Times

Problem: Scanning takes a long time.

Solution:

  • This is normal for Macs with many files
  • Consider excluding large directories if you have custom config
  • The tool scans common locations efficiently

Accidental Deletion

Problem: Deleted something important.

Solution:

# 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

Docker Cleanup Issues

Problem: Docker containers still running after cleanup attempt.

Solution:

# Stop all containers first
docker stop $(docker ps -aq)

# Then run cleaner
npx mac-cleaner-cli

Tool Not Found After Global Install

Problem: mac-cleaner-cli: command not found

Solution:

# 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

Development Integration

Using in Scripts

// 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 availability

Building from Source

git 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 build

Project Structure

mac-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

Best Practices

  1. Always review before cleaning: Use the interactive checkboxes to verify what will be deleted
  2. Start with safe categories: Run without --risky first
  3. Use file explorer: Press → on categories to select specific folders
  4. Keep backups: Enable backup settings in config for critical data
  5. Regular maintenance: Run weekly/monthly to prevent disk space issues
  6. Check app uninstaller: Use built-in uninstaller instead of dragging to Trash
  7. Monitor freed space: Note the summary after cleanup to track effectiveness

Security Notes

  • 100% offline: No network requests, no telemetry
  • Open source: All code available for audit at https://github.com/guhcostan/mac-cleaner-cli
  • No root required: Runs as current user (except DNS flush with sudo)
  • Minimal dependencies: Only 5 runtime dependencies, monitored by Socket.dev
  • Safe defaults: Risky operations hidden behind --risky flag

Platform Support

  • macOS only: Designed specifically for macOS
  • Node.js required: Check compatibility with package.json (typically Node.js 16+)
  • Windows alternative: See windows-cleaner-cli for Windows support

Related Commands

# 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 /

Additional Resources

FAQ

What does the mac-cleaner-cli-disk-cleanup skill do?

Free disk space on macOS using an interactive CLI that clears caches, logs, Homebrew, Xcode junk, and more

How do I install mac-cleaner-cli-disk-cleanup?

Run npx skills add https://github.com/reason-machines/devtools-skills --skill mac-cleaner-cli-disk-cleanup in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/mac-cleaner-cli-disk-cleanup/ (personal) or .claude/skills/mac-cleaner-cli-disk-cleanup/ (project).

Which AI agents can use mac-cleaner-cli-disk-cleanup?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is mac-cleaner-cli-disk-cleanup safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains mac-cleaner-cli-disk-cleanup?

It is published by reason-machines in reason-machines/devtools-skills. It has 222 recorded installs.

More from reason-machines/devtools-skills

View all →

cc-switch-cli

reason-machines/devtools-skills

Cross-platform CLI tool for managing Claude Code, Codex, Gemini, OpenCode & OpenClaw providers, MCP servers, prompts, skills, and proxies.

AI & Agents316 installs

wx-cli-wechat-local-data

reason-machines/devtools-skills

Open the skill to read its SKILL.md instructions.

284 installs

chrome-devtools-mcp-automation

reason-machines/devtools-skills

Open the skill to read its SKILL.md instructions.

AI & Agents263 installs

officecli-office-automation

reason-machines/devtools-skills

Open the skill to read its SKILL.md instructions.

cli-anything-agent-native-software

reason-machines/devtools-skills

Generate and use command-line interfaces that make any software controllable by AI agents with structured JSON output

AI & Agents258 installs

autocli-web-scraping

reason-machines/devtools-skills

Open the skill to read its SKILL.md instructions.

Popular mobile skills

View category →

design-mobile-apps

designed-by-ai/skills

Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.

Mobile1.1M installs

ios-design

uizze.sh

Design and review iOS UI/UX for iPhone apps in SwiftUI, UIKit, or React Native. Use for mobile app design, screen redesigns, navigation flows, typography, forms, keyboard and safe-area layout, and accessibility checks. Apply Apple Human Interface Guidelines and consult real product references through the optional Uizze connection.

Mobile416.5K installs

vercel-react-native-skills

vercel-labs/agent-skills

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

OfficialMobile256.7K installs

animate-expo

emilkowalski/skills

Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use animate.

Mobile140.1K installs

xcode-project-setup

firebase/agent-skills

Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).

OfficialMobile131.2K installs

firebase-remote-config-basics

firebase/agent-skills

Manages Firebase Remote Config templates, feature flags, loading strategies, and SDKs (Android, iOS). Use when downloading/deploying remoteconfig JSON templates, managing version history/feature flags, setting in-app defaults, fetchAndActivate(), real-time listeners, or SDK setup. Don't use for Firebase Hosting, Auth, Firestore, Data Connect, Crashlytics, or App Hosting.

OfficialMobile121.7K installs