{"id":31375955,"url":"https://github.com/tw93/mole","last_synced_at":"2026-05-30T02:05:36.292Z","repository":{"id":316187753,"uuid":"1062356571","full_name":"tw93/Mole","owner":"tw93","description":"🐹 Deep clean and optimize your Mac.","archived":false,"fork":false,"pushed_at":"2026-05-21T03:44:20.000Z","size":237185,"stargazers_count":52213,"open_issues_count":31,"forks_count":1649,"subscribers_count":132,"default_branch":"main","last_synced_at":"2026-05-21T09:56:22.003Z","etag":null,"topics":["analyzer","appcleaner","clean","cleaner","cleaner-cli","cleaner-script","command-line","daisydisk","istat","mac","macos","optimize","sensei","shell","uninstall"],"latest_commit_sha":null,"homepage":"https://mole.fit","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tw93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":["tw93"],"custom":["https://cats.tw93.fun?name=Mole"]}},"created_at":"2025-09-23T06:38:40.000Z","updated_at":"2026-05-21T09:40:11.000Z","dependencies_parsed_at":"2025-10-21T14:08:50.209Z","dependency_job_id":"1bf180e7-c577-40b5-89bf-0f7b9b440481","html_url":"https://github.com/tw93/Mole","commit_stats":null,"previous_names":["tw93/clean-mac","tw93/mole"],"tags_count":189,"template":false,"template_full_name":null,"purl":"pkg:github/tw93/Mole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tw93%2FMole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tw93%2FMole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tw93%2FMole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tw93%2FMole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tw93","download_url":"https://codeload.github.com/tw93/Mole/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tw93%2FMole/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33389229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analyzer","appcleaner","clean","cleaner","cleaner-cli","cleaner-script","command-line","daisydisk","istat","mac","macos","optimize","sensei","shell","uninstall"],"created_at":"2025-09-28T02:52:28.329Z","updated_at":"2026-05-30T02:05:36.257Z","avatar_url":"https://github.com/tw93.png","language":"Shell","funding_links":["https://github.com/sponsors/tw93","https://cats.tw93.fun?name=Mole"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eMole\u003c/h1\u003e\n  \u003cp\u003e\u003cem\u003e🐹 Clean, uninstall, analyze, optimize, and monitor your Mac from the terminal.\u003c/em\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tw93/mole/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/tw93/mole?style=flat-square\" alt=\"Stars\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tw93/mole/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/tag/tw93/mole?label=version\u0026style=flat-square\" alt=\"Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tw93/mole/commits\"\u003e\u003cimg src=\"https://img.shields.io/github/commit-activity/m/tw93/mole?style=flat-square\" alt=\"Commits\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://twitter.com/HiTw93\"\u003e\u003cimg src=\"https://img.shields.io/badge/follow-Tw93-red?style=flat-square\u0026logo=Twitter\" alt=\"Twitter\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://t.me/+GclQS9ZnxyI2ODQ1\"\u003e\u003cimg src=\"https://img.shields.io/badge/chat-Telegram-blueviolet?style=flat-square\u0026logo=Telegram\" alt=\"Telegram\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://gw.alipayobjects.com/zos/k/ro/ZzF8e8.png\" alt=\"Mole - 95.50GB freed\" width=\"1000\" /\u003e\n\u003c/p\u003e\n\n\u003e 💡 The CLI is free and open source. Prefer a native Mac app? [Mole for Mac](https://mole.fit) adds visual cleanup review, app updates, uninstall, maintenance, disk maps, live status, and a menu bar HUD. One license covers 2 Macs, with lifetime updates and a 14-day refund.\n\n## Features\n\n- **All-in-one toolkit**: Combines CleanMyMac, AppCleaner, DaisyDisk, and iStat Menus in a **single binary**\n- **Deep cleaning**: Removes caches, logs, browser leftovers, and orphaned app data to **reclaim gigabytes of space**\n- **Smart uninstaller**: Removes apps plus launch agents, preferences, and **hidden remnants**\n- **Disk insights**: Visualizes usage, finds large files, **rebuilds caches**, and refreshes system services\n- **Live monitoring**: Shows real-time CPU, GPU, memory, disk, and network stats\n\n## Quick Start\n\n**Install via Homebrew**\n\n```bash\nbrew install mole\n```\n\n**Or via script**\n\n```bash\n# Optional args: -s latest for main branch code, -s 1.17.0 for specific version\ncurl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash\n```\n\n\u003e Note: Mole is built for macOS. An experimental Windows version is available in the [windows branch](https://github.com/tw93/Mole/tree/windows) for early adopters.\n\n**Run**\n\n```bash\nmo                           # Interactive menu\nmo clean                     # Deep cleanup + already-uninstalled app leftovers\nmo uninstall                 # Remove installed apps + their leftovers\nmo optimize                  # Refresh caches \u0026 services\nmo analyze                   # Visual disk explorer (or 'mo analyse')\nmo status                    # Live system health dashboard\nmo purge                     # Clean project build artifacts\nmo installer                 # Find and remove installer files\n\nmo touchid                   # Configure Touch ID for sudo\nmo completion                # Set up shell tab completion\nmo update                    # Update Mole\nmo update --nightly          # Update to latest unreleased main build, script install only\nmo remove                    # Remove Mole from system\nmo --help                    # Show help\nmo --version                 # Show installed version\n```\n\n**Preview safely**\n\n```bash\nmo clean --dry-run\nmo uninstall --dry-run\nmo history\nmo history --json\nmo purge --dry-run\n\n# Also works with: optimize, installer, remove, completion, touchid enable\nmo clean --dry-run --debug   # Preview + detailed logs\nmo optimize --whitelist      # Manage protected optimization rules\nmo clean --whitelist         # Manage protected caches\nmo purge --paths             # Configure project scan directories\nmo analyze /Volumes          # Analyze external drives only\n```\n\n## Security \u0026 Safety Design\n\nMole is a local system maintenance tool, and some commands can perform destructive local operations.\n\nMole uses safety-first defaults: path validation, protected-directory rules, conservative cleanup boundaries, and explicit confirmation for higher-risk actions. When risk or uncertainty is high, Mole skips, refuses, or requires stronger confirmation rather than broadening deletion scope.\n\n`mo analyze` is safer for ad hoc cleanup because it moves files to Trash through Finder instead of deleting them directly.\n\nReview [SECURITY.md](SECURITY.md) and [SECURITY_AUDIT.md](SECURITY_AUDIT.md) for reporting guidance, safety boundaries, and current limitations.\n\n## Tips\n\n- Video tutorial: Watch the [Mole tutorial video](https://www.youtube.com/watch?v=UEe9-w4CcQ0), thanks to PAPAYA 電腦教室.\n- Safety and logs: `clean`, `uninstall`, `purge`, `installer`, and `remove` are destructive. Review with `--dry-run` first, and add `--debug` when needed. File operations are logged to `~/Library/Logs/mole/operations.log` and can be reviewed with `mo history`. Disable with `MO_NO_OPLOG=1`. Review [SECURITY.md](SECURITY.md) and [SECURITY_AUDIT.md](SECURITY_AUDIT.md).\n- App leftovers: use `mo clean` when the app is already uninstalled, and `mo uninstall` when the app is still installed.\n- Navigation: Mole supports arrow keys and Vim bindings `h/j/k/l`.\n\n## Features in Detail\n\n### Deep System Cleanup\n\n```bash\n$ mo clean\n\nScanning cache directories...\n\n  ✓ User app cache                                           45.2GB\n  ✓ Browser cache (Chrome, Safari, Firefox)                  10.5GB\n  ✓ Developer tools (Xcode, Node.js, npm)                    23.3GB\n  ✓ System logs and temp files                                3.8GB\n  ✓ App-specific cache (Spotify, Dropbox, Slack)              8.4GB\n  ✓ Trash                                                    12.3GB\n\n====================================================================\nSpace freed: 95.5GB | Free space now: 223.5GB\n====================================================================\n```\n\nNote: In `mo clean` -\u003e Developer tools, Mole removes unused CoreSimulator `Volumes/Cryptex` entries and skips `IN_USE` items.\n\n### Smart App Uninstaller\n\n```bash\n$ mo uninstall\n\nSelect Apps to Remove\n═══════════════════════════\n▶ ☑ Photoshop 2024            (4.2G) | Old\n  ☐ IntelliJ IDEA             (2.8G) | Recent\n  ☐ Premiere Pro              (3.4G) | Recent\n\nUninstalling: Photoshop 2024\n\n  ✓ Removed application\n  ✓ Cleaned 52 related files across 12 locations\n    - Application Support, Caches, Preferences\n    - Logs, WebKit storage, Cookies\n    - Extensions, Plugins, Launch daemons\n\nNote: On macOS 15 and later, Local Network permission entries can outlive app removal. Mole warns when an uninstalled app declares Local Network usage, but it does not auto-reset `/Volumes/Data/Library/Preferences/com.apple.networkextension*.plist` because that reset is global and requires Recovery mode.\n\n====================================================================\nSpace freed: 12.8GB\n====================================================================\n```\n\n### System Optimization\n\n```bash\n$ mo optimize\n\nSystem: 5/32 GB RAM | 333/460 GB Disk (72%) | Uptime 6d\n\n  ✓ Rebuild system databases and clear caches\n  ✓ Reset network services\n  ✓ Refresh Finder and Dock\n  ✓ Clean diagnostic and crash logs\n  ✓ Remove swap files and restart dynamic pager\n  ✓ Rebuild launch services and spotlight index\n\n====================================================================\nSystem optimization completed\n====================================================================\n\nUse `mo optimize --whitelist` to exclude specific optimizations. Path patterns work too, so you can keep a long-lived mounted disk image around (for example `/Volumes/mail`) without it showing up as a detach candidate.\n```\n\n### Disk Space Analyzer\n\n\u003e Note: By default, Mole skips external drives under `/Volumes` for faster startup. To inspect them, run `mo analyze /Volumes` or a specific mount path.\n\n```bash\n$ mo analyze\n\nAnalyze Disk  ~/Documents  |  Total: 156.8GB\n\n ▶  1. ███████████████████  48.2%  |  📁 Library                     75.4GB  \u003e6mo\n    2. ██████████░░░░░░░░░  22.1%  |  📁 Downloads                   34.6GB\n    3. ████░░░░░░░░░░░░░░░  14.3%  |  📁 Movies                      22.4GB\n    4. ███░░░░░░░░░░░░░░░░  10.8%  |  📁 Documents                   16.9GB\n    5. ██░░░░░░░░░░░░░░░░░   5.2%  |  📄 backup_2023.zip              8.2GB\n\n  ↑↓←→ Navigate  |  O Open  |  F Show  |  ⌫ Delete  |  L Large files  |  Q Quit\n```\n\n### Live System Status\n\nReal-time dashboard with health score, hardware info, and performance metrics.\n\n```bash\n$ mo status\n\nMole Status  Health ● 92  MacBook Pro · M4 Pro · 32GB · macOS 14.5\n\n⚙ CPU                                    ▦ Memory\nTotal   ████████████░░░░░░░  45.2%       Used    ███████████░░░░░░░  58.4%\nLoad    0.82 / 1.05 / 1.23 (8 cores)     Total   14.2 / 24.0 GB\nCore 1  ███████████████░░░░  78.3%       Free    ████████░░░░░░░░░░  41.6%\nCore 2  ████████████░░░░░░░  62.1%       Avail   9.8 GB\n\n▤ Disk                                   ⚡ Power\nUsed    █████████████░░░░░░  67.2%       Level   ██████████████████  100%\nFree    156.3 GB                         Status  Charged\nRead    ▮▯▯▯▯  2.1 MB/s                  Health  Normal · 423 cycles\nWrite   ▮▮▮▯▯  18.3 MB/s                 Temp    58°C · 1200 RPM\n\n⇅ Network                                ▶ Processes\nDown    ▁▁█▂▁▁▁▁▁▁▁▁▇▆▅▂  0.54 MB/s      Code       ▮▮▮▮▯  42.1%\nUp      ▄▄▄▃▃▃▄▆▆▇█▁▁▁▁▁  0.02 MB/s      Chrome     ▮▮▮▯▯  28.3%\nProxy   HTTP · 192.168.1.100             Terminal   ▮▯▯▯▯  12.5%\n```\n\nHealth score is based on CPU, memory, disk, temperature, and I/O load, with color-coded ranges.\n\nShortcuts: In `mo status`, press `k` to toggle the cat and save the preference, and `q` to quit.\n\nWhen enabled, `mo status` shows a read-only alert banner for processes that stay above the configured CPU threshold for a sustained window. Use `--proc-cpu-threshold`, `--proc-cpu-window`, or `--proc-cpu-alerts=false` to tune or disable it.\n\n#### Machine-Readable Output\n\nBoth `mo analyze` and `mo status` support a `--json` flag for scripting and automation.\n\n`mo status` also auto-detects when its output is piped (not a terminal) and switches to JSON automatically.\n\n```bash\n# Disk analysis as JSON\n$ mo analyze --json ~/Documents\n{\n  \"path\": \"/Users/you/Documents\",\n  \"overview\": false,\n  \"entries\": [\n    { \"name\": \"Library\", \"path\": \"...\", \"size\": 80939438080, \"is_dir\": true },\n    ...\n  ],\n  \"large_files\": [\n    { \"name\": \"backup.zip\", \"path\": \"...\", \"size\": 8796093022 }\n  ],\n  \"total_size\": 168393441280,\n  \"total_files\": 42187\n}\n\n# System status as JSON\n$ mo status --json\n{\n  \"host\": \"MacBook-Pro\",\n  \"health_score\": 92,\n  \"cpu\": { \"usage\": 45.2, \"logical_cpu\": 8, ... },\n  \"memory\": { \"total\": 25769803776, \"used\": 15049334784, \"used_percent\": 58.4 },\n  \"disks\": [ ... ],\n  \"uptime\": \"3d 12h 45m\",\n  ...\n}\n\n# Auto-detected JSON when piped\n$ mo status | jq '.health_score'\n92\n```\n\n### Project Artifact Purge\n\nClean old build artifacts such as `node_modules`, `target`, `.build`, `build`, and `dist` to free up disk space.\n\n```bash\nmo purge\n\nSelect Categories to Clean - 18.5GB (8 selected)\n\n➤ ● my-react-app       3.2GB | node_modules\n  ● old-project        2.8GB | node_modules\n  ● rust-app           4.1GB | target\n  ● next-blog          1.9GB | node_modules\n  ○ current-work       856MB | node_modules  | Recent\n  ● django-api         2.3GB | venv\n  ● vue-dashboard      1.7GB | node_modules\n  ● backend-service    2.5GB | node_modules\n```\n\n\u003e Note: We recommend installing `fd` on macOS.\n\u003e `brew install fd`\n\n\u003e Safety: This permanently deletes selected artifacts. Review carefully before confirming. Projects newer than 7 days are marked and unselected by default.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCustom Scan Paths\u003c/strong\u003e\u003c/summary\u003e\n\nRun `mo purge --paths` to configure scan directories, or edit `~/.config/mole/purge_paths` directly:\n\n```shell\n~/Documents/MyProjects\n~/Work/ClientA\n~/Work/ClientB\n```\n\nWhen custom paths are configured, Mole scans only those directories. Otherwise, it uses defaults like `~/Projects`, `~/GitHub`, and `~/dev`.\n\n\u003c/details\u003e\n\n### Installer Cleanup\n\nFind and remove large installer files across Downloads, Desktop, Homebrew caches, iCloud, and Mail. Each file is labeled by source.\n\n```bash\nmo installer\n\nSelect Installers to Remove - 3.8GB (5 selected)\n\n➤ ● Photoshop_2024.dmg     1.2GB | Downloads\n  ● IntelliJ_IDEA.dmg       850.6MB | Downloads\n  ● Illustrator_Setup.pkg   920.4MB | Downloads\n  ● PyCharm_Pro.dmg         640.5MB | Homebrew\n  ● Acrobat_Reader.dmg      220.4MB | Downloads\n  ○ AppCode_Legacy.zip      410.6MB | Downloads\n```\n\n## Quick Launchers\n\nLaunch Mole commands from Raycast or Alfred:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/tw93/Mole/main/scripts/setup-quick-launchers.sh | bash\n```\n\nAdds 5 commands: `Mole Clean`, `Mole Uninstall`, `Mole Optimize`, `Mole Analyze`, `Mole Status`.\n\n### Raycast Setup\n\nAfter running the script, complete these steps in Raycast:\n\n1. Open Raycast Settings (⌘ + ,)\n2. Go to **Extensions** → **Script Commands**\n3. Click **\"Add Script Directory\"** (or **\"+\"**)\n4. Add path: `~/Library/Application Support/Raycast/script-commands`\n5. Search in Raycast for: **\"Reload Script Directories\"** and run it\n6. Done! Search for `Mole Clean` or `clean`, `Mole Optimize`, or `Mole Status` to use the commands\n\n\u003e **Note**: The script creates the commands, but Raycast still requires a one-time manual script directory setup.\n\n### Terminal Detection\n\nMole auto-detects your terminal app. iTerm2 has known compatibility issues. We highly recommend [Kaku](https://github.com/tw93/Kaku). Other good options are Alacritty, kitty, WezTerm, Ghostty, and Warp. To override, set `MO_LAUNCHER_APP=\u003cname\u003e`.\n\n## Community Love\n\nThanks to everyone who helped build Mole. Go follow them. ❤️\n\n\u003ca href=\"https://github.com/tw93/Mole/graphs/contributors\"\u003e\n  \u003cimg src=\"./CONTRIBUTORS.svg?v=2\" width=\"1000\" /\u003e\n\u003c/a\u003e\n\n\u003cbr/\u003e\u003cbr/\u003e\nReal feedback from users who shared Mole on X.\n\n\u003cimg src=\"https://gw.alipayobjects.com/zos/k/dl/lovemole.jpeg\" alt=\"Community feedback on Mole\" width=\"1000\" /\u003e\n\n## Support\n\n- If Mole helped you, [share it](https://twitter.com/intent/tweet?url=https://github.com/tw93/Mole\u0026text=Mole%20-%20Deep%20clean%20and%20optimize%20your%20Mac.) with friends or give it a star.\n- Got ideas or bugs? Open an issue or PR, feel free to contribute your best AI model.\n- I have two cats, TangYuan and Coke. If you think Mole delights your life, you can feed them \u003ca href=\"https://cats.tw93.fun?name=Mole\" target=\"_blank\"\u003ecanned food 🥩\u003c/a\u003e.\n\n\u003ca href=\"https://cats.tw93.fun?name=Mole\"\u003e\u003cimg src=\"https://cdn.jsdelivr.net/gh/tw93/sponsors@main/assets/sponsors.svg\" width=\"1000\" loading=\"lazy\" /\u003e\u003c/a\u003e\n\n## License\n\nMIT License. Feel free to use Mole and contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftw93%2Fmole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftw93%2Fmole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftw93%2Fmole/lists"}