mole-mac-cleanup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mole - Mac Cleanup & Optimization Tool

Mole - Mac 清理与优化工具

Repo: https://github.com/tw93/Mole Command:
mo
(not
mole
!) Install:
brew install mole
Note for humans:
mo
without params opens an interactive TUI mode. Not useful for agents, but you might wanna try it manually! 😉
代码仓库: https://github.com/tw93/Mole 命令:
mo
(不是
mole
!) 安装:
brew install mole
温馨提示: 不带参数运行
mo
会打开交互式TUI模式。对Agent来说没什么用,但你可以手动试试哦!😉

What It Does

功能介绍

All-in-one toolkit combining CleanMyMac, AppCleaner, DaisyDisk, and iStat Menus:
  • Deep cleaning — removes caches, logs, browser leftovers
  • Smart uninstaller — removes apps + hidden remnants
  • Disk insights — visualizes usage, manages large files
  • Live monitoring — real-time system stats
  • Project artifact purge — cleans
    node_modules
    ,
    target
    ,
    build
    , etc.

集CleanMyMac、AppCleaner、DaisyDisk和iStat Menus功能于一体的全能工具包:
  • 深度清理 —— 移除缓存、日志、浏览器残留文件
  • 智能卸载 —— 卸载应用及其隐藏的残留文件
  • 磁盘分析 —— 可视化磁盘使用情况,管理大文件
  • 实时监控 —— 实时查看系统状态
  • 项目构建产物清理 —— 清理
    node_modules
    target
    build
    等目录

Non-Interactive Commands (Clawd-friendly)

非交互式命令(适合自动化操作)

Preview / Dry Run (ALWAYS USE FIRST)

预览/模拟运行(务必先执行)

bash
mo clean --dry-run              # Preview cleanup plan
mo clean --dry-run --debug      # Detailed preview with risk levels & file info
mo optimize --dry-run           # Preview optimization actions
mo optimize --dry-run --debug   # Detailed optimization preview
bash
mo clean --dry-run              # 预览清理计划
mo clean --dry-run --debug      # 带风险等级和文件信息的详细预览
mo optimize --dry-run           # 预览优化操作
mo optimize --dry-run --debug   # 详细的优化预览

Execute Cleanup

执行清理

bash
mo clean                        # Run deep cleanup (caches, logs, browser data, trash)
mo clean --debug                # Cleanup with detailed logs
bash
mo clean                        # 执行深度清理(缓存、日志、浏览器数据、回收站)
mo clean --debug                # 带详细日志的清理

System Optimization

系统优化

bash
mo optimize                     # Rebuild caches, reset services, refresh Finder/Dock
mo optimize --debug             # With detailed operation logs
What
mo optimize
does:
  • Rebuild system databases and clear caches
  • Reset network services
  • Refresh Finder and Dock
  • Clean diagnostic and crash logs
  • Remove swap files and restart dynamic pager
  • Rebuild launch services and Spotlight index
bash
mo optimize                     # 重建缓存、重置服务、刷新Finder/Dock
mo optimize --debug             # 带详细操作日志的优化
mo optimize
的具体操作:
  • 重建系统数据库并清理缓存
  • 重置网络服务
  • 刷新Finder和Dock
  • 清理诊断和崩溃日志
  • 移除交换文件并重启动态分页器
  • 重建启动服务和Spotlight索引

Whitelist Management

白名单管理

bash
mo clean --whitelist            # Manage protected cache paths
mo optimize --whitelist         # Manage protected optimization rules
bash
mo clean --whitelist            # 管理受保护的缓存路径
mo optimize --whitelist         # 管理受保护的优化规则

Project Artifact Purge

项目构建产物清理

bash
mo purge                        # Clean old build artifacts (node_modules, target, venv, etc.)
mo purge --paths                # Configure which directories to scan
Config file:
~/.config/mole/purge_paths
bash
mo purge                        # 清理旧构建产物(node_modules、target、venv等)
mo purge --paths                # 配置要扫描的目录
配置文件路径:
~/.config/mole/purge_paths

Installer Cleanup

安装包清理

bash
mo installer                    # Find/remove .dmg, .pkg, .zip installers
Scans: Downloads, Desktop, Homebrew caches, iCloud, Mail attachments
bash
mo installer                    # 查找并移除.dmg、.pkg、.zip安装包
扫描路径:下载文件夹、桌面、Homebrew缓存、iCloud、邮件附件

Setup & Maintenance

设置与维护

bash
mo touchid                      # Configure Touch ID for sudo
mo completion                   # Set up shell tab completion
mo update                       # Update Mole itself
mo remove                       # Uninstall Mole from system
mo --version                    # Show installed version
mo --help                       # Show help

bash
mo touchid                      # 配置Touch ID用于sudo验证
mo completion                   # 设置Shell自动补全
mo update                       # 更新Mole本身
mo remove                       # 从系统卸载Mole
mo --version                    # 显示已安装版本
mo --help                       # 显示帮助信息

Typical Workflow

典型使用流程

  1. Check what would be cleaned:
    bash
    mo clean --dry-run --debug
  2. If looks good, run cleanup:
    bash
    mo clean
  3. Optimize system (after cleanup):
    bash
    mo optimize --dry-run
    mo optimize
  4. Clean dev project artifacts:
    bash
    mo purge

  1. 查看将被清理的内容:
    bash
    mo clean --dry-run --debug
  2. 确认无误后执行清理:
    bash
    mo clean
  3. 清理完成后优化系统:
    bash
    mo optimize --dry-run
    mo optimize
  4. 清理开发项目产物:
    bash
    mo purge

What Gets Cleaned (
mo clean
)

mo clean
的清理范围

  • User app cache
  • Browser cache (Chrome, Safari, Firefox)
  • Developer tools (Xcode, Node.js, npm)
  • System logs and temp files
  • App-specific cache (Spotify, Dropbox, Slack)
  • Trash
  • 用户应用缓存
  • 浏览器缓存(Chrome、Safari、Firefox)
  • 开发工具缓存(Xcode、Node.js、npm)
  • 系统日志和临时文件
  • 特定应用缓存(Spotify、Dropbox、Slack)
  • 回收站

Notes

注意事项

  • Terminal: Best with Ghostty, Alacritty, kitty, WezTerm. iTerm2 has issues.
  • Safety: Use
    --dry-run
    first. Built with strict protections.
  • Debug: Add
    --debug
    for detailed logs.
  • 终端兼容性: 推荐使用Ghostty、Alacritty、kitty、WezTerm。iTerm2存在兼容性问题。
  • 安全性: 请先使用
    --dry-run
    预览清理内容。工具内置严格的保护机制。
  • 调试: 添加
    --debug
    参数可查看详细日志。