Skip to content
Mute-404Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

cleanup

CI

A terminal tool that finds the build artifacts and dependency caches piling up across your projects — node_modules, target, __pycache__, .venv and friends — and lets you review and delete them safely.

Works on Windows, macOS and Linux.

Install

go install github.com/Mute-404/Cleanup/cmd/cleanup@latest

Requires Go 1.24 or newer.

Usage

cleanup              # scan the current directory
cleanup ~/code       # scan one or more paths

Scanning opens an interactive picker. Nothing is deleted until you press d and confirm.

Key Action
↑/↓ Navigate
space Select
a Select all
s Sort (size / oldest / path)
/ Filter by path, type or pattern
d Delete selection (asks for confirmation)
q Quit

Flags

Flag Description
-min-size 100M Only show targets of at least this size
-category py,js Only show matching categories (py matches python)
-older-than 6mo Only show targets untouched for this long (h, d, w, mo, y)
-depth N Limit recursion depth
-dry-run Print what would be deleted and exit
-json Print results as JSON and exit
-config path TOML file with custom patterns
-workers N Concurrent filesystem operations (default: number of CPUs)
-version Print version and exit
# Preview the biggest offenders
cleanup -min-size 100M -dry-run ~/code

# Python junk untouched for two years
cleanup -category py -older-than 2y ~/code

# Scriptable
cleanup -json . | jq -r '.total_size_human'

What it finds

Category Patterns
js node_modules, .next, dist, .turbo, .parcel-cache
python __pycache__, .venv, venv, .pytest_cache, .mypy_cache, *.egg-info
rust / maven target
js / gradle build
java .gradle
general .cache, coverage, tmp

Patterns match directory names only, and matched directories are never descended into. .git, .hg and .svn are never entered.

Add your own with a TOML file:

# ignore = ["vendor"]        # directories never entered
# replace_defaults = true    # drop the built-in patterns

[[patterns]]
name = "zig-cache"
category = "zig"

Safety

  • Nothing is deleted without an explicit confirmation screen. -dry-run and -json never delete.
  • Symlinks are never followed, matched or deleted through. Windows junctions fail closed.
  • Every deletion is re-verified at delete time: the path must be a real directory, match a pattern, and resolve to a location strictly inside a scanned root.
  • Scan roots themselves are never deletable, and filesystem roots (/, C:\) are refused outright.
  • Read-only files are handled; failures are reported with the reason, never swallowed.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages