v1.3.0 | Multi-language package cache cleaner with an interactive TUI.
Find unused dependencies, clean OS temp files, browser caches, and Docker build artifacts to reclaim disk space. Supports Go, Python, Rust, Node.js, Java (Maven/Gradle), and .NET (NuGet).
go install github.com/Aswanidev-vs/goclean@latestOr build from source:
git clone https://github.com/Aswanidev-vs/goclean.git
cd goclean
go build -o goclean .goclean| Flag | Description |
|---|---|
--paths |
Comma-separated directories to scan for Go projects |
--dry-run |
Simulate deletion without removing files |
--verbose |
Show detailed logs |
--version |
Show version |
--export <file> |
Export scan report to a JSON file |
--min-size <size> |
Minimum size filter (e.g. 1MB, 100KB, 1GB) |
# Run with default paths
goclean
# Custom scan paths
goclean --paths "C:\Users\me\projects,D:\work"
# Dry run mode
goclean --dry-run --verbose
# Export scan report to JSON
goclean --export report.json
# Only show packages larger than 10MB
goclean --min-size 10MB
# Combine flags
goclean --paths "~/projects" --export report.json --min-size 1MB --dry-runScans configured directories for Go projects, finds all dependencies via go list -m all, compares against the module cache, and identifies unused modules. Module sizes are computed lazily in the background — the list appears instantly and sizes fill in progressively.
Browse and delete cached packages by language:
| Language | Cache Location |
|---|---|
| Go | go env GOMODCACHE |
| Python (pip) | pip cache dir / ~/.cache/pip / %LOCALAPPDATA%\pip\cache |
| Rust (Cargo) | ~/.cargo/registry/cache and ~/.cargo/registry/src |
| Node.js (npm) | npm config get cache / ~/.npm |
| Java (Maven) | ~/.m2/repository |
| Java (Gradle) | ~/.gradle/caches |
| .NET (NuGet) | ~/.nuget/packages / %LOCALAPPDATA%\NuGet\Cache |
Detect and clean OS and application temp/cache files. Each item shows its source, description, and criticality level:
| Item | Source | Criticality |
|---|---|---|
Windows Temp (%TEMP%, %TMP%) |
Windows OS | Safe |
| Recycle Bin | Windows Shell | Caution |
| Chrome Cache | Google Chrome | Safe |
| Firefox Cache | Mozilla Firefox | Safe |
| Edge Cache | Microsoft Edge | Safe |
| Docker Build Cache | Docker | Moderate |
| Docker Dangling Images | Docker | Moderate |
| Docker Container Logs | Docker | Caution |
Criticality levels: Safe (green) — will be recreated automatically, Moderate (yellow) — may slow next operation, Caution (red) — permanent data loss.
Export scan results to a structured JSON file for reporting or CI integration:
goclean --export report.jsonThe report includes timestamp, project count, module counts, reclaimable space, and a full list of unused modules with sizes and paths.
Filter packages by minimum size to focus on the biggest space savings. Available as a CLI flag or interactively in the TUI:
# CLI flag
goclean --min-size 10MBIn the TUI, press m to cycle through thresholds: off → 1MB → 10MB → 100MB → 1GB. Works in both the unused modules list and the cache browser.
Add or remove directories for Go project scanning. Paths are saved to ~/.goclean.json and persist across sessions.
Switch dry-run mode on/off. When enabled, no files are deleted.
- Lazy size loading — module sizes are computed concurrently in the background. The scan completes in seconds; sizes fill in progressively
- Parallel scanning — project discovery, dependency aggregation, and cache scanning all use goroutine worker pools with semaphore-based concurrency limiting
- Depth-limited discovery — project scanning is capped at 8 directory levels deep to prevent runaway traversal on large filesystems
- Efficient directory walking — uses
filepath.WalkDirinstead offilepath.Walkto avoid redundantLstatsyscalls - Efficient sorting — uses Go's
sort.Slice(O(n log n))
| Key | Action |
|---|---|
↑/↓ |
Navigate |
enter/space |
Select |
i |
Toggle info panel |
q |
Quit |
| Key | Action |
|---|---|
↑/↓ |
Navigate languages |
enter/space |
Browse that language's cache |
q |
Back to menu |
| Key | Action |
|---|---|
↑/↓ |
Move cursor |
space |
Toggle selection |
a |
Select all |
n |
Deselect all |
/ |
Search/filter |
s |
Sort (name/size toggle) |
m |
Cycle min size filter (off/1MB/10MB/100MB/1GB) |
enter |
Delete selected |
q |
Back |
| Key | Action |
|---|---|
↑/↓ |
Move cursor |
space |
Toggle selection |
a |
Select all |
n |
Deselect all |
i |
Show item details (source, criticality, description) |
enter |
Clean selected items |
q |
Back to menu |
| Key | Action |
|---|---|
y |
Confirm deletion |
n |
Cancel |
Works on Windows, macOS, and Linux. All paths are auto-detected dynamically using environment variables and tool commands — nothing is hardcoded per user or machine.
- Never deletes modules used by detected Go projects (Start Scan mode)
- Always requires explicit
yconfirmation before deletion - Supports
--dry-runto preview what would be deleted - Temp/cache cleaners show criticality level for each item
- Handles file lock errors gracefully (especially on Windows)
- Deletions are concurrent but rate-limited (4 workers)
- Added
.NET (NuGet)cache browser (was defined but not registered) - Added
--exportflag to export scan reports as JSON - Added
--min-sizeflag andmkey to filter by minimum package size - Added progress bar display during deletion operations
- Fixed Docker container logs size calculation (was always returning 0)
- Fixed Docker logs cleanup to work cross-platform (was using
sh -c) - Fixed
computeIDincrement being lost due to value receiver - Fixed
saveConfig()using value receiver instead of pointer - Optimized directory walking with
filepath.WalkDir(avoids extra syscalls) - Optimized project discovery with depth limit (max 8 levels)
- Consolidated duplicate utility functions into
util/package
- Added temp/cache file cleaner (Windows temp, browser caches, Docker)
- Added Docker build cache, dangling images, and container log cleanup
- Added multi-language cache browser (Python, Rust, Node.js, Java, .NET)
- Added language selector with cache availability detection
- Added persistent configuration (
~/.goclean.json)
- Initial release with Go module cache scanning and cleanup
MIT