Mole

Mole

WHAT IS IT?

Mole is an open source macOS CLI (command mo) that bundles disk cleanup, app uninstalling, disk usage analysis and system monitoring. It covers what people usually do with CleanMyMac, AppCleaner, DaisyDisk and iStat Menus, from a single terminal tool. It runs on macOS 12 or newer, on both Intel and Apple Silicon, and installs with brew install mole. A paid native Mac app (Mole for Mac) is a separate download: the repo only covers the free CLI.

WHY IS IT INTERESTING?

  • Targeted cleanup: mo clean goes through user and browser caches, logs, temporary files, developer tool caches (npm, Xcode) and leftovers from apps that are already gone. Caches you want to keep can be protected with a whitelist stored in ~/.config/mole/whitelist.
  • Uninstalls without remnants: mo uninstall removes the app along with its launch agents, preferences and hidden files in ~/Library. If another installed copy still uses shared data, Mole leaves it in place.
  • Build artifact purge: mo purge finds node_modules, target, .build, build and dist folders, grouped by project. Artifacts touched in the last 7 days are unselected by default, and directories containing Git-tracked files or nested Git repositories are protected.
  • Disk explorer and dashboard: mo analyze is a terminal disk explorer with Vim navigation, filtering, multi-selection and confirmed moves to Trash. mo status is a read-only view of CPU, memory, disk, network, power and processes, with an overall health score.
  • Explicit safety rails: clean, uninstall, optimize, purge and installer all accept --dry-run. Mole runs without sudo and only asks for admin rights when a task needs them. Every cleanup is logged and can be reviewed with mo history. When Mole cannot prove an item is safe to change, it skips it.
  • JSON output: mo status --json, mo analyze --json and mo history --json return script-friendly data, and mo status --watch streams newline-delimited JSON.

USE CASES

  • Free up space on a cluttered dev Mac by purging old node_modules and target folders from inactive projects.
  • Uninstall a large app (Adobe suite, JetBrains IDE) without leaving orphaned files in ~/Library.
  • Remove forgotten DMG, PKG and ISO files from Downloads, the Desktop or the Homebrew cache with mo installer.
  • Monitor a machine from a script or monitoring tool through mo status --json.
  • Trigger cleanup or the dashboard from Raycast or Alfred using the launchers installed by the setup-quick-launchers.sh script.