Scripts2026年7月17日·1 分钟阅读

Mole — Terminal Cleanup and Optimization Toolkit for macOS

Open-source macOS maintenance CLI that cleans, uninstalls, analyzes, optimizes, and monitors your Mac from the terminal.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Mole Overview
直接安装命令
npx -y tokrepo@latest install 6f7d42b5-81fb-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Mole is an open-source command-line tool by tw93 that brings macOS system maintenance into the terminal. It replaces GUI utilities like CleanMyMac, DaisyDisk, and iStat Menus with a single lightweight binary, giving developers full control over cleanup, monitoring, and optimization without leaving their workflow.

What Mole Does

  • Scans and removes system junk, caches, logs, and leftover files to reclaim disk space
  • Fully uninstalls applications including preferences, containers, and support files
  • Analyzes disk usage with an interactive visual breakdown in the terminal
  • Monitors CPU, memory, disk, and network usage in real time
  • Optimizes system performance by clearing inactive memory and DNS caches

Architecture Overview

Mole is written as a collection of shell scripts orchestrated by a central dispatcher. Each subcommand (clean, uninstall, analyze, optimize, monitor) is a standalone module that uses native macOS utilities like mdfind, lsof, and system_profiler under the hood. This keeps the binary small and dependency-free while leveraging the operating system's own APIs for accurate results.

Self-Hosting & Configuration

  • Install via Homebrew with brew install tw93/tap/mole
  • Alternatively clone the repo and run make install for manual setup
  • Configuration is stored in ~/.config/mole/config.toml for custom scan paths
  • Supports exclusion lists to skip specific directories or apps during cleanup
  • Works on macOS 12 Monterey and later with both Intel and Apple Silicon

Key Features

  • Single binary with zero external dependencies beyond macOS system tools
  • Interactive terminal UI for disk analysis with color-coded size indicators
  • Safe uninstall mode that previews files before deletion
  • Real-time system monitor as a lightweight alternative to Activity Monitor
  • Extensible subcommand architecture for adding custom maintenance scripts

Comparison with Similar Tools

  • CleanMyMac — commercial GUI app with subscription pricing; Mole is free and terminal-native
  • DaisyDisk — excellent disk visualizer but GUI-only; Mole provides terminal-based analysis
  • AppCleaner — uninstalls apps but limited to drag-and-drop; Mole handles CLI batch operations
  • iStat Menus — system monitor in the menu bar; Mole provides similar data in the terminal
  • ncdu — disk usage analyzer for any Unix; Mole adds macOS-specific cleanup and uninstall

FAQ

Q: Does Mole work on Linux? A: No, Mole is designed specifically for macOS and relies on macOS-native system APIs and utilities.

Q: Is it safe to run mole clean on a production machine? A: Mole targets caches, logs, and temporary files that are safe to remove. It always shows a preview before deleting, and you can add exclusions for sensitive paths.

Q: How does Mole compare to running manual terminal commands? A: Mole aggregates dozens of cleanup and analysis commands into simple subcommands, saving time and reducing the chance of accidentally deleting important files.

Q: Can Mole schedule automated cleanups? A: Mole itself does not include a scheduler, but you can invoke it from cron or launchd for recurring maintenance.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产