Repository navigation
cargo-cleanme v0.2.10
0.2.10
A bare cargo cleanme now cleans the directory you are standing in. The working directory was a filter over a universe that did not contain it, so from a directory outside the machine's known roots the run proved nothing at all: on the machine that prompted this, cargo cleanme in ~/.codex reported 0 would-clean while cargo cleanme clean ~/.codex reported four workspaces and 107.15 GiB in the same directory at the same moment. The working directory now joins the maintenance scope as an additional root — the workspace that encloses you and the directory itself. The scope only ever grows: the working directory is added to the known roots, never substituted for them, so a target shared with a project outside the scope still stays shared and stays inventory-only.
The working directory joins only when the machine's known roots do not already reach it. Standing inside a known root, or in a directory that contains one — your home directory, for a scheduler — leaves the bounded machine-wide sweep bounded. Sweeping everything under your home would also sweep your Trash and your package caches, whose abandoned manifests cannot be resolved and would block the run: measured on that machine, it turned a nine-second sweep of the known roots into a sixty-five-second sweep of 264,183 directories that ended blocked on 1,357 unresolvable manifests. To sweep a whole directory on purpose, name it: cargo cleanme clean ~.
The read-only cargo cleanme scan --known inventory covers the same universe, so it stays an inventory of what the cleanup would act on. The scope label in the JSON envelope is unchanged (routine), and selected_roots carries the actual roots.
The interactive selection surface is now a compact finder rather than a full-screen list. cargo cleanme -i painted every resolved unit as a row in a frame that occupied the entire terminal, so a scope with hundreds of workspaces was a screenful to scroll rather than a list to read: there was no scroll-position indicator, no paging key, and the absolute path of every row took most of the width while the part that distinguishes one workspace from another sat at its far end. The frame is now a bounded page of at most fifteen rows that never outgrows the terminal, and a row is named by the shortest part of its path that identifies it among the candidates — siblings read project-01, project-19. The reclaimable size is right-aligned so the big ones line up, the ownership annotation is dropped entirely when it would say the same thing on every row, the gutter marks the cursor and the edges of the window, and a key-hint bar names the keys. PgUp, PgDn, Home and End move through the page. The surface is also the first in the crate to render colour; set NO_COLOR (or run with TERM=dumb) to turn it off. The interaction model is unchanged: the NOR/INS modes, the all-toggle row, the published key table, and the selection contract all stand.
A run that cleaned nothing now says so, in one line, and exits 0. The interactive surface refused an empty candidate list as a configuration error (exit 2) while the same scope cleaned without -i exited 0 — two spellings of one scope disagreed, and an unattended caller could not tell "there was nothing to do" from "the command was wrong". Both now print Nothing to clean. and exit 0. The same verdict replaces the scope census and the summary of zeroes for a human cleanup report that has nothing in it. A run that found units and deliberately left them alone still reports every one of them: "nothing was selected" never reads as "nothing was eligible".
The learned-root omission summary is no longer printed for by-design omissions. A learned root that sits at a known-transient origin — an agent worktree, a package cache, a temporary directory — is omitted by design: the tool would never have cleaned it, so omitting it narrows nothing. That summary fired on essentially every Routine invocation, in the tool's error shape, naming paths the operator never asked about. A durable learned root that has vanished, and a root that is no longer a directory, are still reported — those are news.
The JSON envelope, the log line, and every exit code other than the interactive empty case are unchanged.
Five prebuilt targets are attached — x86-64 and aarch64 for Linux, macOS, and Windows x64 — each with a SHA-256 sidecar, alongside the two installers and a release manifest.
See CHANGELOG.md for the full record. Pre-1.0: read the changelog before upgrading.