mole-mac-cleaner by aradotso/trending-skills
npx skills add https://github.com/aradotso/trending-skills --skill mole-mac-cleaner技能来自 ara.so — Daily 2026 技能合集。
Mole (mo) 是一款一体化的 macOS 维护 CLI 工具,将深度清理、智能应用卸载、磁盘分析、系统优化、实时监控和项目构建产物清除功能集成于单个二进制文件中。
# 通过 Homebrew 安装(推荐)
brew install mole
# 通过安装脚本安装(支持版本锁定)
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash
# 安装特定版本
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash -s 1.17.0
# 安装最新的 main 分支版本(每日构建版)
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash -s latest
mo # 交互式菜单(使用方向键或 vim 的 h/j/k/l 键)
mo clean # 深度系统缓存 + 浏览器 + 开发工具清理
mo uninstall # 移除应用及其所有隐藏残留文件
mo optimize # 重建缓存、重置网络、刷新 Finder/Dock
mo analyze # 可视化磁盘空间分析器
mo status # 实时系统健康状态仪表盘
mo purge # 移除项目构建产物(node_modules, target, dist)
mo installer # 查找并移除安装程序文件(.dmg/.pkg)
mo touchid # 为 sudo 命令配置 Touch ID
mo completion # 设置 Shell 标签页自动补全
mo update # 更新 Mole
mo update --nightly # 更新到最新的未发布版本(仅限脚本安装方式)
mo remove # 卸载 Mole 本身
mo --help
mo --version
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
在执行破坏性命令前,务必先进行试运行:
mo clean --dry-run
mo uninstall --dry-run
mo purge --dry-run
# 结合调试模式以获取详细输出
mo clean --dry-run --debug
mo optimize --dry-run --debug
mo clean — 深度清理清理用户应用缓存、浏览器缓存(Chrome、Safari、Firefox)、开发工具缓存(Xcode、Node.js、npm)、系统日志、临时文件、特定应用缓存(Spotify、Dropbox、Slack)以及废纸篓。
mo clean # 交互式清理
mo clean --dry-run # 预览将被移除的内容
mo clean --whitelist # 管理受保护的缓存(从清理中排除)
白名单配置文件位于 ~/.config/mole/。编辑此文件以保护你希望保留的路径。
mo uninstall — 智能应用移除查找应用,显示其大小和最后使用日期,然后移除应用包及其所有相关文件:
应用程序支持、缓存、偏好设置
日志、WebKit 存储、Cookies
扩展、插件、启动守护程序
mo uninstall # 交互式多选列表 mo uninstall --dry-run # 预览将被移除的内容
mo optimize — 系统刷新mo optimize # 运行所有优化
mo optimize --dry-run # 预览优化操作
mo optimize --whitelist # 排除特定的优化步骤
优化内容包括:
mo analyze — 磁盘分析器mo analyze # 分析主目录(默认跳过 /Volumes)
mo analyze ~/Downloads # 分析特定路径
mo analyze /Volumes # 明确包含外部驱动器
# 用于脚本编写的机器可读输出
mo analyze --json ~/Documents
JSON 输出示例:
{
"path": "/Users/you/Documents",
"entries": [
{ "name": "Library", "path": "...", "size": 80939438080, "is_dir": true }
],
"total_size": 168393441280,
"total_files": 42187
}
mo analyze 内部导航快捷键:
| 按键 | 操作 |
|---|---|
↑↓ 或 j/k | 在列表中导航 |
←→ 或 h/l | 返回 / 进入目录 |
O | 在 Finder 中打开 |
F | 在 Finder 中显示 |
⌫ | 移动到废纸篓(通过 Finder,比直接删除更安全) |
L | 显示大文件 |
Q | 退出 |
mo status — 实时仪表盘mo status # 实时 CPU、GPU、内存、磁盘、网络、进程信息
mo status --json # 用于脚本编写的 JSON 输出
mo status | jq '.health_score' # 自动检测管道 → 输出 JSON
JSON 输出示例:
{
"host": "MacBook-Pro",
"health_score": 92,
"cpu": { "usage": 45.2, "logical_cpu": 8 },
"memory": { "total": 25769803776, "used": 15049334784, "used_percent": 58.4 },
"disks": [],
"uptime": "3d 12h 45m"
}
mo status 内部快捷键:k 切换吉祥物小猫显示,q 退出。
mo purge — 项目构建产物清理扫描 node_modules、target、build、dist、venv 及类似目录。默认情况下,7 天内新建的项目不会被选中。
mo purge # 交互式多选
mo purge --dry-run # 预览将被清理的内容
mo purge --paths # 配置自定义扫描目录
配置自定义扫描路径 (~/.config/mole/purge_paths):
~/Documents/MyProjects
~/Work/ClientA
~/Work/ClientB
当此文件存在时,Mole 仅使用这些路径。否则,它默认扫描 ~/Projects、~/GitHub、~/dev。
安装
fd以获得更快的扫描速度:brew install fd
mo installer — 安装程序文件清理mo installer # 在 Downloads、Desktop、Homebrew 缓存、iCloud、Mail 中查找 .dmg/.pkg 文件
mo installer --dry-run # 预览将被移除的内容
所有配置都位于 ~/.config/mole/ 目录下:
| 文件 | 用途 |
|---|---|
purge_paths | mo purge 扫描的自定义目录 |
operations.log | 所有文件操作日志 |
禁用操作日志记录:
export MO_NO_OPLOG=1
mo clean
mo completion # 为 bash/zsh/fish 进行交互式设置
mo touchid # 为 sudo 命令启用 Touch ID 身份验证
mo touchid enable --dry-run
#!/bin/bash
health=$(mo status --json | jq -r '.health_score')
if [ "$health" -lt 70 ]; then
echo "健康度评分较低:$health — 正在运行清理"
mo clean --dry-run # 准备就绪后,可替换为 `mo clean`
fi
mo analyze --json ~/Downloads | jq '.entries | sort_by(-.size) | .[0:5] | .[] | {name, size_gb: (.size / 1073741824 | . * 100 | round / 100)}'
#!/bin/bash
# 在 CI 后非交互式地清理构建产物
MO_NO_OPLOG=1 mo purge --dry-run # 在脚本中始终先预览
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash
# 然后在 Raycast 中将 `mo clean`、`mo status`、`mo analyze` 绑定为脚本命令
mo analyze 通过 Finder 将文件移至废纸篓(可恢复),而非直接删除 — 建议用于临时清理clean、uninstall、purge、installer 和 remove 命令是永久性破坏操作 — 务必先使用 --dry-run~/.config/mole/operations.log — 使用 MO_NO_OPLOG=1 禁用| 问题 | 解决方案 |
|---|---|
mo: command not found | 运行 brew install mole 或重新运行安装脚本;检查 $PATH |
| Purge 扫描缓慢 | 安装 fd:brew install fd |
| 外部驱动器未出现在 analyze 中 | 显式运行 mo analyze /Volumes |
| 希望保护某个缓存不被清理 | 运行 mo clean --whitelist 将其加入白名单 |
| 需要排除某个优化步骤 | 运行 mo optimize --whitelist |
| 脚本遇到交互式提示 | 使用 --dry-run 标志;检查 MO_NO_OPLOG=1 环境变量 |
| Nightly 更新无效 | Nightly 更新 (--nightly) 仅适用于脚本安装方式,不适用于 Homebrew |
mo update # 更新到最新稳定版
mo update --nightly # 更新到最新的 main 分支版本(仅限脚本安装方式)
mo remove # 完全卸载 Mole
mo remove --dry-run # 预览移除操作将删除的内容
每周安装量
263
代码仓库
GitHub 星标数
10
首次出现
6 天前
安全审计
安装于
github-copilot262
codex262
kimi-cli262
amp262
cline262
gemini-cli262
Skill by ara.so — Daily 2026 Skills collection.
Mole (mo) is an all-in-one macOS maintenance CLI that combines deep cleaning, smart app uninstallation, disk analysis, system optimization, live monitoring, and project artifact purging into a single binary.
# Via Homebrew (recommended)
brew install mole
# Via install script (supports version pinning)
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash
# Specific version
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash -s 1.17.0
# Latest main branch (nightly)
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash -s latest
mo # Interactive menu (arrow keys or vim h/j/k/l)
mo clean # Deep system cache + browser + dev tool cleanup
mo uninstall # Remove apps plus all hidden remnants
mo optimize # Rebuild caches, reset network, refresh Finder/Dock
mo analyze # Visual disk space explorer
mo status # Live real-time system health dashboard
mo purge # Remove project build artifacts (node_modules, target, dist)
mo installer # Find and remove installer .dmg/.pkg files
mo touchid # Configure Touch ID for sudo
mo completion # Set up shell tab completion
mo update # Update Mole
mo update --nightly # Update to latest unreleased build (script install only)
mo remove # Uninstall Mole itself
mo --help
mo --version
Always dry-run destructive commands first:
mo clean --dry-run
mo uninstall --dry-run
mo purge --dry-run
# Combine with debug for detailed output
mo clean --dry-run --debug
mo optimize --dry-run --debug
mo clean — Deep CleanupCleans user app caches, browser caches (Chrome, Safari, Firefox), developer tool caches (Xcode, Node.js, npm), system logs, temp files, app-specific caches (Spotify, Dropbox, Slack), and Trash.
mo clean # Interactive cleanup
mo clean --dry-run # Preview what would be removed
mo clean --whitelist # Manage protected caches (exclude from cleanup)
Whitelist config lives at ~/.config/mole/. Edit it to protect paths you want to keep.
mo uninstall — Smart App RemovalFinds apps, shows size and last-used date, then removes the app bundle plus all related files:
Application Support, Caches, Preferences
Logs, WebKit storage, Cookies
Extensions, Plugins, Launch Daemons
mo uninstall # Interactive multi-select list mo uninstall --dry-run # Preview removals
mo optimize — System Refreshmo optimize # Run all optimizations
mo optimize --dry-run # Preview
mo optimize --whitelist # Exclude specific optimizations
Optimizations include:
mo analyze — Disk Explorermo analyze # Analyze home directory (skips /Volumes by default)
mo analyze ~/Downloads # Analyze specific path
mo analyze /Volumes # Include external drives explicitly
# Machine-readable output for scripting
mo analyze --json ~/Documents
JSON output example:
{
"path": "/Users/you/Documents",
"entries": [
{ "name": "Library", "path": "...", "size": 80939438080, "is_dir": true }
],
"total_size": 168393441280,
"total_files": 42187
}
Navigator shortcuts insidemo analyze:
| Key | Action |
|---|---|
↑↓ or j/k | Navigate list |
←→ or h/l | Go back / Enter directory |
O | Open in Finder |
F | Reveal in Finder |
⌫ | Move to Trash (via Finder, safer than direct delete) |
mo status — Live Dashboardmo status # Real-time CPU, GPU, memory, disk, network, processes
mo status --json # JSON output for scripting
mo status | jq '.health_score' # Auto-detects pipe → outputs JSON
JSON output example:
{
"host": "MacBook-Pro",
"health_score": 92,
"cpu": { "usage": 45.2, "logical_cpu": 8 },
"memory": { "total": 25769803776, "used": 15049334784, "used_percent": 58.4 },
"disks": [],
"uptime": "3d 12h 45m"
}
Shortcuts inside mo status: k toggles the cat mascot, q quits.
mo purge — Project Artifact CleanupScans for node_modules, target, build, dist, venv, and similar directories. Projects newer than 7 days are unselected by default.
mo purge # Interactive multi-select
mo purge --dry-run # Preview
mo purge --paths # Configure custom scan directories
Configure custom scan paths (~/.config/mole/purge_paths):
~/Documents/MyProjects
~/Work/ClientA
~/Work/ClientB
When this file exists, Mole uses only those paths. Otherwise it defaults to ~/Projects, ~/GitHub, ~/dev.
Install
fdfor faster scanning:brew install fd
mo installer — Installer File Cleanupmo installer # Find .dmg/.pkg files in Downloads, Desktop, Homebrew cache, iCloud, Mail
mo installer --dry-run # Preview removals
All config lives in ~/.config/mole/:
| File | Purpose |
|---|---|
purge_paths | Custom directories for mo purge to scan |
operations.log | Log of all file operations |
Disable operation logging:
export MO_NO_OPLOG=1
mo clean
mo completion # Interactive setup for bash/zsh/fish
mo touchid # Enable Touch ID authentication for sudo commands
mo touchid enable --dry-run
#!/bin/bash
health=$(mo status --json | jq -r '.health_score')
if [ "$health" -lt 70 ]; then
echo "Health score low: $health — running cleanup"
mo clean --dry-run # swap to `mo clean` when ready
fi
mo analyze --json ~/Downloads | jq '.entries | sort_by(-.size) | .[0:5] | .[] | {name, size_gb: (.size / 1073741824 | . * 100 | round / 100)}'
#!/bin/bash
# Non-interactive purge of build artifacts after CI
MO_NO_OPLOG=1 mo purge --dry-run # always preview first in scripts
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash
# Then bind `mo clean`, `mo status`, `mo analyze` as script commands in Raycast
mo analyze moves files to Trash via Finder (recoverable) instead of direct deletion — prefer it for ad hoc cleanupclean, uninstall, purge, installer, and remove are permanently destructive — always --dry-run first~/.config/mole/operations.log — disable with MO_NO_OPLOG=1| Problem | Solution |
|---|---|
mo: command not found | Run brew install mole or re-run install script; check $PATH |
| Purge scan is slow | Install fd: brew install fd |
| External drives not appearing in analyze | Run mo analyze /Volumes explicitly |
| Want to protect a cache from being cleaned | Run mo clean --whitelist to add it |
mo update # Update to latest stable
mo update --nightly # Update to latest main (script install only)
mo remove # Uninstall Mole completely
mo remove --dry-run # Preview what remove would delete
Weekly Installs
263
Repository
GitHub Stars
10
First Seen
6 days ago
Security Audits
Gen Agent Trust HubFailSocketPassSnykFail
Installed on
github-copilot262
codex262
kimi-cli262
amp262
cline262
gemini-cli262
macOS磁盘清理工具 - 安全智能分析回收存储空间 | macOS Cleaner
257 周安装
PPT模板创建器:将PowerPoint模板转化为可复用技能,自动化演示文稿生成
257 周安装
商务邮件草拟助手:AI智能生成专业邮件模板,提升办公沟通效率
257 周安装
Docassemble 表单构建器技能 - 创建智能动态问卷与文档生成工具
257 周安装
Fastify TypeScript 生产级后端框架指南:高性能 Node.js Web 开发与 JSON 模式验证
257 周安装
AI 演示文稿生成器 | 一键创建专业幻灯片,支持 Marp 格式输出
257 周安装
L |
| Show large files |
Q | Quit |
| Need to exclude an optimization step | Run mo optimize --whitelist |
| Script getting interactive prompts | Use --dry-run flag; check for MO_NO_OPLOG=1 env var |
| Nightly update not working | Nightly updates (--nightly) only work with script install, not Homebrew |