Skip to main content

An advanced workspace cleanup tool for developers to reclaim disk space.

Project description

🧹 fsweep

fsweep is your friendly neighborhood workspace cleanup tool! It's designed to help developers mop up bulky development artifacts and sweep away disk-space-hogging junk with ease.

Whether it's a mountain of node_modules, a forgotten venv, or stale build caches, fsweep identifies the mess and helps you reclaim your disk space in seconds.

📦 Installation

fsweep is best managed with uv. If you don't have it yet, get it from astral.sh/uv.

uv tool install fsweep

📖 Usage

Keep your workspace spotless with a single command:

uv run fsweep --path /path/to/projects

Safe destructive run flow:

# Step 1: default dry-run (non-destructive)
uv run fsweep --path /path/to/projects

# Step 2: destructive run with explicit confirmation flags
uv run fsweep --path /path/to/projects --delete --yes-delete

Options

Option Shorthand Description Default
--path The directory to scan for cleanup. ~/developer/archive
--force -f Mop up everything without asking for confirmation. False
--dry-run / --delete -d Simulate cleanup (default) or enable destructive mode. True
--yes-delete Required for destructive runs. False
--best-effort Continue and exit successfully even if deletes fail. False
--max-delete-count Max folders allowed in one destructive run. 50
--no-delete-limit Override --max-delete-count. False

🧹 What does it sweep?

fsweep knows exactly which corners to sweep. It currently targets:

  • JavaScript/TypeScript: node_modules, .next, .nuxt, .svelte-kit, .astro, .turbo, .parcel-cache, .vite
  • Python: venv, .venv, __pycache__, .pytest_cache, .tox, .nox, .mypy_cache, .ruff_cache, .ipynb_checkpoints
  • Build/Test Artifacts: build, dist, out, coverage, htmlcov, .nyc_output, .cache
  • JVM/.NET/Rust: .gradle, target, bin, obj
  • Infrastructure-as-Code: .terraform, .terragrunt-cache

🚀 Key Features

  • 🔍 Intelligent Scanning: Recursively hunts down common "junk" folders across your projects.
  • 💰 Size Estimation: Calculates exactly how much space you'll recover before you commit.
  • 📊 Rich Terminal UI: Presents findings in beautiful, easy-to-read tables thanks to Rich.
  • 🛡️ Safety First: Includes a robust --dry-run mode and confirmation prompts to ensure your precious source code stays safe.
  • 💨 Built for Speed: Leverages Python 3.13 and modern async-style progress feedback.

🧪 Development

Ready to help improve the fsweep? Here's how to keep the codebase as clean as your workspace.

git clone https://github.com/drew-simmons/fsweep.git
cd fsweep

uv sync

🛠️ Tech Stack

  • Python 3.13+
  • Typer: For a clean and intuitive CLI experience.
  • Rich: For beautiful terminal output, tables, and progress indicators.
  • uv: For lightning-fast dependency management.

Running Tests

uv run pytest

Exit Codes

  • 0: successful run (or dry-run simulation complete)
  • 1: safety check failure or invalid invocation
  • 2: one or more deletions failed (unless --best-effort is set)

Linting & Formatting

We use Ruff to keep things tidy:

uv run ruff check .
uv run ruff format .
uv run rumdl fmt .

Type Checking

Keep the types in check with ty:

uv run ty check .

[!TIP] uv run prek -a runs all the above linting and formatting.

🔐 Safety Model

  • Default mode is non-destructive (--dry-run).
  • Destructive mode requires --delete --yes-delete.
  • fsweep refuses to sweep / and your home directory root.
  • Destructive runs are capped by --max-delete-count unless overridden.

📋 Release Checklist

Before tagging a release (v*), verify:

uv run pytest
uv run ruff check .
uv run ty check .
uv build
uv run --isolated --no-project --with dist/*.whl fsweep --help
uv run --isolated --no-project --with dist/*.whl python -m fsweep --help
uv run --isolated --no-project --with dist/*.tar.gz fsweep --help
uv run --isolated --no-project --with dist/*.tar.gz python -m fsweep --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fsweep-0.1.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fsweep-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file fsweep-0.1.0.tar.gz.

File metadata

  • Download URL: fsweep-0.1.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fsweep-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c666f8f3badf7ce2ef225e71d14385df1a7c44d3726e9e8ff8cada433c93a6f9
MD5 9801c26d2d2369b1acef81de790091a3
BLAKE2b-256 98f8a034fe320ccbfca77821026b4427d6ccd085ddc0ad55030397c2649a5072

See more details on using hashes here.

File details

Details for the file fsweep-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fsweep-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fsweep-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6be0ed8abc03a787279c5a3eeb3a51cf2a69bd6bb971bec367a72f781c5015b7
MD5 6a5358d6e7528d0f6cdf289b8be86f61
BLAKE2b-256 7146a778b5eac378bf9dba479d417adaf296563a1619e0c331dbe561f671bea4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page