Rusty Sweeper
A fast, interactive disk usage analyzer and cleaner for Linux.
Current Status
rusty-sweeper [PATH]launches the interactive TUI.rusty-sweeper --cli [PATH]prints a disk-usage report and exits.- Add
--jsonfor machine-readable output or--depth Nto limit text display depth. rusty-sweeper --cli --clean [PATH]previews project cleanup and asks for confirmation.- The monitor binary and service have been removed.
Features
- Interactive TUI: Browse disk usage and clean directly from the terminal
- CLI reports: Print disk usage as a tree or JSON for scripts
Installation
From crates.io
From Source
Usage
Interactive TUI
# Launch TUI in the current working directory
# Scan a specific directory instead of the current working directory
Non-interactive CLI
# Print a full disk-usage tree (defaults to the current directory)
# Show the root and its immediate children; totals still include all descendants
# Export the full scan as JSON
Reports include hidden entries and use the scanner configuration below. Text output
marks entries with scan errors as [!]; JSON includes their error details.
Diagnostics go to stderr, leaving stdout suitable for piping. --json and --depth
require --cli and cannot be combined.
CLI project cleanup
# Discover projects, report artifacts and sizes, then ask for confirmation
# Print the same report and clean automatically
The scan includes the root project and nested projects, using [cleaner] settings
for project types, exclusions, maximum depth, minimum age, and parallel jobs.
Cleanup deletes the listed local artifact directories directly. It does not run
project scripts or clean global caches. Enter y or yes to confirm; any other
response, an empty line, or end-of-input cancels. -y / --yes skips confirmation.
The final report includes successes, failures, and space freed; any cleanup failure
returns a nonzero exit status. --clean cannot be combined with --json or --depth.
Configuration
Configuration file: ~/.config/rusty-sweeper/config.toml
Scanner and TUI cleaner behavior is driven by the corresponding values.
Scanner parallelism, filesystem-boundary behavior, and the persistent metadata cache are active. Cached files are validated by device/inode, size, allocated blocks, and nanosecond modification/change times before their accounting is reused.
[]
= 0 # 0 = auto
= false
= true
= 3600
[]
= ["cargo", "gradle", "maven", "npm", "go", "cmake", "python", "bazel", "dotnet"]
= ["**/.git", "**/vendor"]
= 0
= 10
= 4
[]
= "auto"
= false
= "size"
= 1073741824
TUI Keybindings
Scanning and cleanup run in background workers. The UI processes queued scan
results in batches and redraws changed frames at most 60 times per second;
keyboard input and terminal resizing are handled independently. Deleting an
entry updates the in-memory tree without rescanning the root. Press r to
refresh changes made outside the application.
If a deletion fails with a permission error, the TUI offers to retry that path
with sudo. Accepting temporarily opens sudo's terminal password prompt, then
returns to the TUI. Press n or Esc to leave the remaining files in place.
| Key | Action |
|---|---|
j / Down |
Move down |
k / Up |
Move up |
Enter / l / Right |
Expand/enter directory |
h / Left / Backspace |
Collapse/go up |
d / Delete |
Delete selected |
c |
Clean project |
C |
Clean all eligible projects under selected directory |
/ |
Search |
s |
Cycle sort order |
. |
Hide/show hidden files (shown by default) |
r |
Rescan |
? |
Help |
Esc |
Cancel active work, otherwise quit |
q |
Quit |
Cleanup Support
The TUI can identify and clean common local build artifacts for Cargo, npm, Python, CMake, Gradle, Maven, and .NET projects. Docker system resources are also surfaced when available.
License
MIT