🧹 DevSweep
DevSweep is a fast, safe, cross-platform Python CLI that scans your workspaces and reclaims gigabytes of disk space from forgotten build artifacts, dependency folders (node_modules, .venv, target, .next, __pycache__, …), and unused Docker resources — with built-in dry-run previews, interactive selection, .devsweepignore rules, and strict safety guardrails.
Demo
Features
| Category | Capabilities |
|---|---|
| Multi-ecosystem Detection | Automatically detects node_modules, .venv, venv, virtualenv .env (verified by markers so secret .env files are never touched), target (Rust/Java), dist, build, __pycache__, .next, .nuxt, coverage, .pytest_cache, .gradle, .turbo, .parcel-cache, .mypy_cache, and .ruff_cache |
| Fast & Accurate Scanner | Streaming os.scandir() traversal, automatic pruning inside matched folders (prevents nested double-counting), symlink & Windows NTFS junction safety, multi-path scanning, --max-depth, and smart devsweep scan ~ |
| Safe Deletion Engine | Multi-layer protection blocking filesystem roots (/, C:\, D:\), user $HOME, and OS system trees (C:\Windows, /usr, /etc, /System, …); enforces allowed cleanup scope and handles PermissionError/OSError gracefully |
| Interactive & Dry-Run Modes | --dry-run preview banner, interactive checkbox selector (1,3-5, all, none, done, q), explicit confirmation prompt (default No), and --yes for automation |
| Ignore System | Full .gitignore-style .devsweepignore and --ignore-file support with strict precedence: CLI --exclude > .devsweepignore > default ignores (.git, .idea, .vscode, .hg, .svn) |
| Docker Cleanup | devsweep docker scan and devsweep docker clean for dangling images, stopped containers, unused volumes, and build cache — never force-removes in-use images or running containers |
| Polished Terminal UI | Color-coded Rich tables, progress spinners, multi-path progress bars, summary panels, helpful error hints, and --no-color ASCII-safe output for CI/logs |
Installation
Requirements
- Python 3.10+
- Optional: Docker CLI (only required for
devsweep docker ...commands)
Install from PyPI (once published)
pip install devsweep-cli
Standard Install (from source)
git clone https://github.com/vuloc080611/DevSweep.git
cd DevSweep
pip install .
Editable / Development Install
git clone https://github.com/vuloc080611/DevSweep.git
cd DevSweep
pip install -e ".[dev]"
# or alternatively:
pip install -e .
pip install -r requirements-dev.txt
Verify Installation
devsweep --version
devsweep --help
# Also works via Python module execution:
python -m devsweep --version
Windows PATH note: If
pipinstalls into user site-packages (%APPDATA%\Python\Python3xx\Scripts) and prints a PATH warning, either add thatScriptsfolder to your systemPATH, install inside a virtual environment, or run viapython -m devsweep.
Usage Examples
Scanning Directories
# Scan the current directory
devsweep scan
# Scan one or more target directories
devsweep scan ./frontend ./backend
# Limit traversal depth and exclude specific directories or patterns
devsweep scan ~/projects --max-depth 2 --exclude "*backup*" --exclude vendor
# Smart home directory scan (focuses on common workspace folders like Projects, workspace, Desktop, Documents)
devsweep scan ~
# Preview scan with dry-run notice or plain text output (CI-friendly)
devsweep scan ./projects --dry-run --no-color
# Machine-readable JSON output for jq, CI pipelines, or dashboards
devsweep scan ./projects --json | jq '.total_reclaimable_bytes'
Cleaning Folders Safely
# Always preview first with --dry-run
devsweep clean ./projects --dry-run
# Interactively toggle folders to delete (supports 1,3-5, all, none, done, q)
devsweep clean ./projects --interactive
# Clean multiple paths, keeping specific directories excluded
devsweep clean ./web ./api --exclude legacy --interactive
# Non-interactive cleanup (skips confirmation prompt)
devsweep clean ./projects --yes
Cleaning Unused Docker Resources
# List dangling images, stopped containers, unused volumes, and reclaimable build cache
devsweep docker scan
# Export unused Docker resources as JSON
devsweep docker scan --json
# Preview Docker cleanup without removing anything
devsweep docker clean --dry-run
# Interactively choose which unused Docker resources to remove
devsweep docker clean --interactive
# Remove all discovered unused Docker resources without prompting
devsweep docker clean --yes
Safety guarantee:
devsweep docker cleanremoves stopped containers before dangling images/volumes and never uses--forceon images or containers, so active containers and in-use images are never touched.
Commands & Flags Reference
Global Options
| Option | Short | Description |
|---|---|---|
--version |
-V |
Show DevSweep version and exit |
--no-color |
Disable colored output and Unicode emojis | |
--help |
Show help message and usage examples |
Commands
| Command | Description |
|---|---|
devsweep scan [PATHS...] |
Scan one or more directories and display cleanable folders |
devsweep clean [PATHS...] |
Scan and safely delete cleanable folders |
devsweep docker scan |
List unused Docker images, containers, volumes, and build cache |
devsweep docker clean |
Safely remove unused Docker resources |
devsweep version |
Display the installed DevSweep version |
scan & clean Options
| Option | Short | Commands | Description |
|---|---|---|---|
--max-depth INT |
-d |
scan, clean |
Maximum directory depth to descend (0 scans nothing inside root) |
--exclude PATTERN |
-e |
scan, clean |
Exclude matching folder name or relative glob pattern (repeatable) |
--ignore-file PATH |
scan, clean |
Use a custom ignore file instead of auto-discovered .devsweepignore |
|
--dry-run |
-n |
scan, clean, docker |
Show what would be targeted without deleting anything |
--json |
scan, docker scan |
Emit pure machine-readable JSON (suppresses spinners and banners) | |
--interactive |
-i |
clean, docker clean |
Interactively select items (1,3-5, all, none, done, q) |
--yes |
-y |
clean, docker clean |
Skip confirmation prompt before deletion |
--no-color |
all | Disable ANSI color output |
Ignore System (.devsweepignore)
Place a .devsweepignore file inside your workspace root (or pass --ignore-file <path>) using standard .gitignore syntax:
# Comments start with '#'
archive/
vendor/
# Anchor to scan root only (ignores ./dist but still scans ./apps/web/dist)
/dist
# Wildcards and double-star paths
*backup*
packages/**/legacy
# Negation ('!') overrides earlier rules or default ignores
!important_backup
!.vscode
Precedence Order (Highest to Lowest)
- CLI
--excludeflags (always win, cannot be overridden by ignore files) --ignore-fileor.devsweepignore(supports!negation to re-include paths)- Default ignores (
.git,.idea,.vscode,.hg,.svn)
Contributing
Contributions, bug reports, and feature ideas are welcome! Please read CONTRIBUTING.md for development setup, test commands, and commit guidelines, and SECURITY.md for reporting safety or security issues.
License
Released under the MIT License.
Metadata
Release files for devsweep-cli 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| devsweep_cli-0.2.0.tar.gz | 44.4 kB | With provenance | Details for devsweep_cli-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| devsweep_cli-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for devsweep_cli-0.2.0-py3-none-any.whl |
Total release size: 75.1 kB
Release files / devsweep_cli-0.2.0.tar.gz
| Download URL | devsweep_cli-0.2.0.tar.gz |
|---|---|
| Size | 44.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d98d2c3f01cdc283357c200a11f12f71dcd4a030f7caf8a31e789bc4738cd2a
|
|
BLAKE2b-256 checksum How to use checksums |
8c459f95e9ef8e8f016258f608c67f90d8c517310c218a9e83c58a17aaac3053
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logRelease files / devsweep_cli-0.2.0-py3-none-any.whl
| Download URL | devsweep_cli-0.2.0-py3-none-any.whl |
|---|---|
| Size | 30.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
410611a3cec94a091747f19218551efa339231378a16bd49d92c787a4e1223aa
|
|
BLAKE2b-256 checksum How to use checksums |
bc45259f87acaa19a841efe76ea23a19d61ee89478a1142af8b39c4a5b74257a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logSecurity for devsweep-cli 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for devsweep_cli-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.