@jotafierro/superclean
v1.1.0
Published
Cleaning caches, logs, and trash in macOS
Readme
superclean
Free CleanMyMac replacement — reclaim gigabytes of macOS cache and junk from one command.
What problem does it solve?
macOS quietly hoards gigabytes: app caches that never expire, stale logs, a Trash you forgot,
Xcode DerivedData, months-old Downloads, and package-manager caches (npm/yarn/Homebrew/Docker).
Apps like CleanMyMac charge a subscription to sweep them. superclean does the same cleanup in
one command — --dry-run first so you see every byte before it's touched, per-file error handling
so one protected folder never aborts the run.
Cleans by default:
- User caches (
~/Library/Caches) - User logs (
~/Library/Logs) - Trash (
~/.Trash) - Downloads older than 30 days
- Xcode DerivedData
- Safari's sandboxed cache (
~/Library/Containers/com.apple.Safari/...) — Chrome/Arc/other browsers already get swept by the~/Library/Cacheswipe above, no separate step needed for those - npm, yarn and Homebrew caches (via their own commands)
- Docker: stopped containers, unused networks and images (
docker system prune)
macOS only.
Install
Global:
npm install -g @jotafierro/superclean
supercleanWithout installing:
npx @jotafierro/supercleanLocal dev clone, run it as superclean without publishing:
npm run build
npm link # or: pnpm link --global | yarn link
superclean --dry-runnpm unlink -g @jotafierro/superclean to remove it.
Usage
superclean --dry-run # show what would be deleted, delete nothing
superclean # asks for confirmation, then cleans
superclean -y # skip the confirmation prompt (cron/CI)
superclean --big-files [path] # list files over 100MB (default: $HOME), sorted by size, top 30 — lists only, deletes nothing
superclean --big-files --min-size 500 --limit 10 # adjust threshold (MB) and result countConfig
Optional, in ~/.superclean.json. Any missing field falls back to its default (all true except dockerPruneAll).
{
"userCaches": true,
"userLogs": true,
"trash": true,
"downloads": true,
"xcodeDerivedData": true,
"safariCache": true,
"npmCache": true,
"yarnCache": true,
"homebrewCache": true,
"dockerCleanup": true,
"dockerPruneAll": false,
"downloadsMaxAgeDays": 30
}dockerPruneAll: true adds -a --volumes to the Docker prune: also removes non-dangling images and volumes (can delete container database data). Leave it false unless you know what you're doing.
Old node_modules
superclean doesn't touch project node_modules, that's a different problem. Use npkill for that, interactive and built exactly for it:
npx npkillDevelopment
npm run build # compile cleaner.ts to dist/
npm run start # run dist/cleaner.js
npm test # build + run the node:test suitenpm run start needs -- before flags, otherwise npm swallows them: npm run start -- --big-files, not npm run start --big-files. Or skip npm run and call node dist/cleaner.js --big-files directly.
