goweep is a high-performance, parallel CLI utility written in Go. It is designed to quickly identify and remove common development "junk" folders (like node_modules, .venv, target, and dist) to reclaim disk space across large workspaces.
Built with a "safety-first" philosophy, it features a mandatory dry-run mode and interactive confirmation prompts to prevent accidental data loss.
- High-Speed Parallel Scanning: Utilizes a worker pool and Go's concurrency primitives to measure directory sizes in parallel.
- Intelligent Discovery: Automatically skips sub-directories of matched folders (e.g., prevents scanning nested
node_modulesinside a pnpm tree) for maximum efficiency. - Impactful Reporting: Sorts findings by size (heaviest first) and summarizes the Top 10 cleanup targets to reduce output noise.
- Smart Filtering: Supports age-based filtering (e.g., "only delete folders older than 30 days").
- Safe by Default: Dry-run mode is active by default. No deletion occurs without explicit
--dry-run=falseand user confirmation. - Professional CLI: Clean, color-coded output with status prefixes (
[OK],[ERROR],[DRY-RUN]).
Since the tool is written in Go, it compiles to a single static binary with no external dependencies.
-
Clone the repository:
git clone https://github.com/yourusername/goweep.git cd goweep -
Build the binary:
go build -o goweep.exe
-
Run it:
./goweep.exe --path .
There are two ways to run GoWeep: during development using the Go compiler, or using the standalone executable.
Useful when you are testing changes or don't want to build a binary yet.
# Basic scan
go run main.go --path .
# Deep clean with custom targets
go run main.go --path "C:\Projects" --targets "node_modules,dist,build" --dry-run=falseThe preferred way to use GoWeep as a regular tool.
# Basic scan (Dry-run)
./goweep.exe --path .
# Delete folders older than 30 days
./goweep.exe --path "Z:\Projects" --older-than 30 --dry-run=false
# Automation mode (No confirmation prompt)
./goweep.exe --path "C:\Temp" --dry-run=false --force- Custom Worker Count: Increase speed on high-core CPUs (default is 4).
goweep --path . --workers 16 - Target Specific Ecosystems: Focus only on Python environments.
goweep --targets ".venv,venv,__pycache__" --dry-run=false - Clean Entire Workspace: Scan a parent directory to find all nested junk.
goweep --path "Z:\Workspaces" --dry-run=false
The tool tracks the following patterns by default:
- Node.js:
node_modules - Python:
.venv,venv,env,__pycache__ - Rust/Java:
target - Web:
dist,build,.next,.nuxt,.cache - Go:
vendor - Mobile:
Pods,bower_components
Ensure logic and size calculations remain accurate.
go test ./.../scanner: Parallel filesystem walking, size calculation, and discovery optimization./deleter: Safe execution logic, confirmation prompts, and error handling./output: Result aggregation (sorting/limiting) and terminal formatting.
This utility leverages Go's Goroutines and Channels to manage disk I/O efficiently, allowing the tool to stay responsive even when scanning millions of files. The resulting static binary makes it portable across Windows, macOS, and Linux with zero setup.
This was my first project exploring the Go programming language! Coming from a Node.js and Python background, this project was a hands-on way to learn:
- Parallelism vs Concurrency: Implementing a worker-pool pattern using
goroutines and buffered channels. - Explicit Memory: Understanding the use of pointers (
*) and references (&) for efficient data handling. - Strict Typing: Moving from dynamic languages to Go's safe and predictable type system.
- Software Architecture: Organizing code into modular packages (
scanner,deleter,output) to keep the codebase maintainable. - The Go Ecosystem: Using
go mod,go test, and the standard library to build a production-ready tool with minimal external dependencies.