macleanup
com.aoneahsan.macleanup
MacLeanup is a safe-by-default macOS cleanup & maintenance CLI โ one ~3,600-line Bash engine with 28 targeted sections, a real --dry-run, per-section confirmations, and zero-install delivery via npx macleanup, plus an in-repo native macOS GUI (Tauri) wrapper.
At a glance
- Category
- other
- Status
- Live
- Started
- Jan 2025
- Last updated
- 35 minutes ago
Identifier
com.aoneahsan.macleanupPreview
Take a look before you go
The still below is painted first, then the running site loads behind it โ so the dialog is never an empty rectangle waiting on a network round trip. Where a site allows framing the live app takes over; where it refuses, the still stays and says so. Nothing is requested until you press.
About
What this actually is
A full Mac does not tell you what can go.
Caches, old build output, logs and personal files sit close together on the same disk. A broad delete command cannot explain the difference between them, and most cleanup apps ask you to approve a deletion you have not seen.
macleanup splits the work into named, numbered sections, so you look at one consequence at a time. You choose a section, preview its paths, then decide whether to run it. It asks before destructive work by default.
The first run can stay entirely in preview.
npx macleanup --dry-run --all shows the safe batch without deleting a file. It can still write the tool's own logs and reports, and the page says so rather than calling a dry run "harmless". The safe batch is a selection rule, not a promise, so the paths are there to read before anything runs.
The recovery path changes by section, and the documentation says which is which.
Many caches rebuild on their own the next time the tool that owns them runs. Orphaned app data, selected apps and large stale files go to the Trash, where they can be restored until the Trash is emptied. Backups, archives, snapshots, build directories and Trash contents are removed directly, and for those your own backup is the only way back. macleanup has no undo command, and it says that up front.
The deeper sections need two deliberate flags.
For unattended batch use, the high-risk sections require both flags together, and the interactive menu asks you to pick items. If Finder cannot move an item to the Trash, it stays where it is and the failure is reported.
Developer work leaves its own kind of residue: Xcode caches and simulators, package-manager caches for npm, yarn, pnpm and Homebrew, and stale build directories. Each has its own section, so you clean the tool you actually use.
The cleanup runs on your Mac. By default the script makes no network calls, and its logs and reports stay on the machine. An optional version check contacts npm, and npx itself may download the package before the script starts; both are written on the site rather than left to be discovered.
Profiles are lists of sections. minimal, for example, covers user caches, logs, old top-level temp files and update caches, and leaves the Trash alone. Choose a profile by what it includes, then preview the whole list. A profile name does not make an action reversible.
The same sections, in a window.
The macleanup desktop app runs the same script and adds three things a terminal cannot show well: a disk gauge that includes space held by snapshots, a dry-run ledger you can read path by path, and a receipt for every run. Previews are free and unlimited in the app; a Pro plan removes its monthly limit on real runs.
How much space comes back depends on the files on your Mac. The tool shows a dry-run estimate and a disk-usage report. It does not promise a number.
Version 5 gave the command, the script, the data folder and the config file one shared name. The first 5.x run copies earlier logs and reports into the new folder and leaves the originals in place, and every safety limit from 4.7 is unchanged. A rename that quietly dropped a guard would be the worst kind of upgrade for a tool like this.
The command line is MIT-licensed and published on npm, so the script can be read in full before it is trusted.
It is plain bash in short files: one entry script and a lib/ folder of modules, small enough to read before running. Version 5.3.1 runs on macOS 11 Big Sur or later, on Apple Silicon and Intel, and the packed npm install is about 79 kB. Node is needed only for the npx and npm install paths; the cleanup itself is shell.
The documentation is blunt about what cannot come back. Most sections remove caches that rebuild themselves and some move items to the Trash, but a few delete permanently: emptying the Trash itself, removing Time Machine local snapshots, iOS device backups and Xcode archives. That list sits above the first command on purpose, with the advice to run --dry-run first and to back up before any cleanup tool, this one included.
There is no telemetry. The --check-update flag contacts npm only when it is asked to.
Worth knowing
- Two files, everything else is documentation โ the entire tool is `mac-cleanup.sh` (~3,593 lines of bash) + a ~104-line Node spawner. You can read every line before you run it, which is the whole point.
- Zero-install, zero-trust delivery โ `npx macleanup` avoids curl-pipe-bash, a Homebrew tap, and any signing-key surface; npm fetches it, runs it, reclaims the cache, and your reports survive in `~/.mac-cleanup/`.
- `atime` AND `mtime`, not just `mtime` โ a Gradle distribution you invoke monthly, or a `node_modules` your IDE reads for autocomplete, keeps recent atime and survives every pass. This two-clock rule is the safety insight most cleaners miss.
- Honest license framing โ README explicitly states it is source-available, NOT OSI open source: read, run, learn โ but no redistribute/modify.
- Ships a built-in recovery guide โ the README documents how a 4.3.0 bug could break global toolchains and exactly how to restore bun/pnpm/yarn/nvm/Volta/brew, then explains the 4.3.1 allowlist fix. Owning and documenting a regression is rare.
- Deep sections are opt-in even when unattended โ `--yes` alone never enables the irreversible sections; you must add `--i-understand-deep`.
- Same flags everywhere โ identical interface across `npx`, the global `mac-cleanup` bin, and a raw `./mac-cleanup.sh` checkout.
- The GUI reimplements nothing โ the Tauri desktop app runs the bundled script in `--json` mode, so safety rules and dry-run guarantees come straight from the one source of truth.
Built with
- Bash
- Node.js
- npm / npx
- macOS
- Tauri
- Rust
- React
- TypeScript
- Vite
- Supabase
Key features
What it does, and what that costs to build
Each of these is a capability the stack genuinely provides. None of them is an outcome nobody measured โ there is no "cut onboarding by 40%" on this page, because no one measured onboarding.
- Numbered cleanup sections, each previewed before it runs
- A dry run that deletes no files
- Confirmation before destructive work by default
- Deep sections gated behind two deliberate flags
- Trash for selected app data and large files; direct removal only where stated
- Profiles such as minimal, chosen by what they include
- No network calls from the script by default
- Desktop app with a disk gauge, a dry-run ledger and a receipt per run
Screenshots
5 slots, none of them filled in yet
These are designed frames, not pictures. Each one records what belongs in the slot and at what width; the capture itself is taken from the running app. Drawing a fake screenshot here would put an image on the site that no build has ever produced.
Timeline
Still being worked on
Jan 2025
Work started
The earliest month on record for macleanup.
Nov 2026
Last change
Status is completed โ 35 minutes ago. Ongoing, so this row moves whenever something lands.
Questions
Common questions
The questions that actually arrive, answered in the first sentence.
- Will a dry run change my files?
- No. A dry run deletes no files. It can still write macleanup's own logs and reports.
- Can I undo a cleanup?
- Only for the sections that use the Trash. Sections that move selected items to the Trash can be undone until the Trash is emptied; direct removal needs your own backup, and macleanup has no undo command.
- Does it clear saved browser passwords?
- No. The browser-cache section targets cache subdirectories, not saved passwords, bookmarks or history. Review the section list before running it.
- How much disk space will I get back?
- It depends on the files on your Mac. Read the dry-run estimate and the disk-usage report; there is no promised amount.
- Does it send my data anywhere?
- Not by default. The cleanup script makes no network calls, and its logs and reports stay on your Mac. An optional version check contacts npm, and npx may download the package before the script starts.
- Which Macs does it support?
- macOS 11 Big Sur or later, on Apple Silicon and Intel. The command line is bash; Node is only needed to install or run it through npm or npx.
Keep looking
More tools and experiments
- NA
Native Update
com.aoneahsan.nativeupdate
Over-the-air updates for Capacitor apps โ bundle signing, staged rollout, and automatic rollback when a bundle fails to boot twice.
- ST
Strata Storage
com.aoneahsan.stratastorage
One storage API across localStorage, IndexedDB, cookies, the URL, native Keychain and Keystore, SQLite and the filesystem. Zero dependencies.
- CA
Capacitor Auth Manager
com.aoneahsan.capacitorauthmanager
Framework-agnostic TypeScript authentication library unifying 15 OAuth, passwordless, credential, and biometric sign-in flows behind one provider-less API.