Python env cleanup · v0.1.2

Sweep stale venvs. Keep your code.

A keyboard-first CLI that finds forgotten .venv, venv, and custom Python environments — then removes only what you explicitly select.

$ npx venvsweep
zero runtime dependencies validates pyvenv.cfg keyboard-first TUI
01 / The sweep

See what is disposable before deleting it.

Scroll through the workflow. The terminal preview follows the same mental model as the CLI: scan, review, select, confirm.

~/Developer — venvsweep v0.1.2
~~~> clean envs, keep code
Reclaimable7.46 GB
Selected0 B
Environments6
Scan completed1.84s
Search root~/Developer
Targets.venv, venv, .my-venv
analytics-api/.venv1.82 GB8mo3.11.8
ml-playground/venv936 MB5mo3.12.2
vision-lab/.my-venv2.41 GB11mo3.10.13
tiny-tools/.venv624 MB2mo3.13.1
archive/old-bot/venv1.28 GB1.4y3.9.18
scraper-next/.venv388 MB3w3.12.6
01 · SCAN

Point it at a workspace.

Start from the current directory or pass a root. Defaults find .venv and venv; custom target names are first-class.

02 · REVIEW

Size first. Path visible.

VenvSweep surfaces the actual storage cost, Python version, age, and path so the decision is informed instead of blind.

03 · SELECT

Space builds the sweep queue.

Nothing is deleted just because it was discovered. Select one or many environments and watch the queued space update instantly.

04 · VERIFY

Re-check before removal.

Each candidate is validated through pyvenv.cfg again before deletion, reducing the chance of removing an unrelated folder with the same name.

02 / Designed for real Python repos

Opinionated defaults. Flexible targets.

Virtual environments rarely follow one naming convention forever. VenvSweep embraces that without turning cleanup into a dangerous wildcard search.

Auto-detect the obvious ones.

Common names work immediately, while custom names can be added explicitly per run.

.venv venv .my-venv env-py312 backend-env

Safety is part of discovery.

A matching folder name is not enough. VenvSweep validates Python virtual-environment metadata before treating a directory as removable.

1 target name matches
2 pyvenv.cfg exists
3 user explicitly selects
4 validate again → remove

Keyboard-first

Move with arrows or j/k, toggle with Space, select all with A, then confirm.

Reclaimable space

See environment sizes before deleting and keep a running total of what your current selection will recover.

{ }

Script-friendly

Use --dry-run and --json when you want machine-readable discovery without interactive deletion.

quick-start.shNode.js 22+
1# scan current directory
2npx venvsweep
3 
4# scan a workspace
5npx venvsweep ~/Developer
6 
7# custom environment names
8npx venvsweep --targets .venv,venv,.my-venv
9 
10# preview only
11npx venvsweep --dry-run
Open source · MIT

Stop carrying gigabytes of environments you forgot existed.

Run one command, review the candidates, and sweep only what you choose. VenvSweep v0.1.2 is available on npm.

View source ↗ npm ↗