Skip to main content

🧹 DevSweep

CI PyPI Python License: MIT Built with Typer & Rich

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

DevSweep CLI 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)
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 pip installs into user site-packages (%APPDATA%\Python\Python3xx\Scripts) and prints a PATH warning, either add that Scripts folder to your system PATH, install inside a virtual environment, or run via python -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'

# Filter by specific artifact types (repeatable or comma-separated)
devsweep scan ./projects --type node_modules --type pycache

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

# Clean only specific artifact categories
devsweep clean ./projects --type node_modules --type __pycache__ --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 clean removes stopped containers before dangling images/volumes and never uses --force on 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)
--type CATEGORY -t scan, clean Filter by artifact category, e.g. node_modules, pycache, venv (repeatable or comma-separated)
--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)

  1. CLI --exclude flags (always win, cannot be overridden by ignore files)
  2. --ignore-file or .devsweepignore (supports ! negation to re-include paths)
  3. 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.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for devsweep-cli 0.3.0
File Size Uploaded Provenance Actions
devsweep_cli-0.3.0.tar.gz 45.9 kB With provenance Details for devsweep_cli-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for devsweep-cli 0.3.0
File Interpreter ABI Platform Actions
devsweep_cli-0.3.0-py3-none-any.whl Python 3 none any Details for devsweep_cli-0.3.0-py3-none-any.whl

Total release size: 77.4 kB

Release files / devsweep_cli-0.3.0.tar.gz

Download URL devsweep_cli-0.3.0.tar.gz
Size 45.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5303d52ce63bd0f3b0665c281d5740714166af4bfaf0bd9abed3d4e57ffed936
BLAKE2b-256 checksum
How to use checksums
bf89e25a76060e2faee36a8525c6c1bc18ee7ee8dae5926d19d24a95ede6cf7b
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 log

Release files / devsweep_cli-0.3.0-py3-none-any.whl

Download URL devsweep_cli-0.3.0-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56957126e5459ec8e279cff1dfeaab43a8582463f55f431e963ac04ea20ccf1a
BLAKE2b-256 checksum
How to use checksums
4afee093c0117b59c0da966433f8afd943a0c1784695a7f98149269e93440a44
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 log

Security for devsweep-cli 0.3.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.

Select from 2 files

Attestation for devsweep_cli-0.3.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 log

A 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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page