A collection of Go CLI tools for reclaiming disk space on development machines.
macOS cache cleaner that runs safe, official cleanup commands for developer tools (Docker, npm, Homebrew, etc.)—never rm -rf.
Cross-platform tool that scans source directories for project cache directories (like node_modules, .venv, target, etc.) across multiple languages.
Cross-platform tool that finds .git directories, reports their sizes, and optionally optimizes repositories with git gc.
brew tap markcallen/cache-cleaner
brew install cache-cleanerThis installs all 3 apps: dev-cache, git-cleaner, and mac-cache-cleaner.
If you don't have Homebrew, you can use the install script:
# Install all 3 apps to ~/.local/bin
curl -sSfL https://raw.githubusercontent.com/markcallen/cache-cleaner/HEAD/install.sh | sh -s -- -b $HOME/.local/bin
# Install specific app only
curl -sSfL https://raw.githubusercontent.com/markcallen/cache-cleaner/HEAD/install.sh | sh -s -- -b $HOME/.local/bin -a mac-cache-cleanerImportant: The install script requires the -b flag to specify an installation directory. If you omit the -b flag, the script will error out and recommend using Homebrew instead.
Note: Make sure ~/.local/bin is in your PATH:
export PATH="$HOME/.local/bin:$PATH"Add this to your shell profile (~/.zshrc or ~/.bashrc) to make it permanent.
mac-cache-cleaner --init
mac-cache-cleaner # dry-run (summary)
mac-cache-cleaner --details # show per-directory details
mac-cache-cleaner --clean # execute cleanup
mac-cache-cleaner --targets brew,npm --cleandev-cache --init
dev-cache # scan for cache directories (dry-run)
dev-cache --details # detailed breakdown
dev-cache --scan ~/projects --clean # delete found cachesgit-cleaner --scan ~/src # find and report .git sizes
git-cleaner --scan ~/src --clean # optimize with git gcIf brew install cache-cleaner fails with "No available formula":
-
Update Homebrew and retry:
brew update brew tap markcallen/cache-cleaner brew install cache-cleaner
-
Verify the formula exists at: https://github.com/markcallen/homebrew-cache-cleaner/tree/main/Formula
If you encounter issues during installation:
-
Check that Homebrew is up to date:
brew update brew doctor
-
Try installing with verbose output to see detailed logs:
brew install cache-cleaner --verbose
-
If problems persist, check the GitHub Issues
Each app has detailed documentation in its own directory:
mac-cache-cleaner/README.md- Full mac-cache-cleaner docsdev-cache/README.md- Full dev-cache docsgit-cleaner/README.md- Full git-cleaner docs
To develop on this project, you need the following tools installed:
- Go 1.21 or higher (download)
- Make (typically pre-installed on macOS/Linux)
- GoReleaser (optional, for releases):
brew install goreleaser - pre-commit (optional, for Git hooks):
pip install pre-commit
You can verify all required tools are installed by running:
make check-toolsBuild all apps:
make allBuild specific app:
make dev-cache
make git-cleaner
make mac-cache-cleanerRun tests/lint for all:
make test
make lint
make vetWhat should happen:
-
GitHub Actions will trigger the release workflow
-
GoReleaser will:
- Build all 3 binaries for darwin/amd64 and darwin/arm64
- Create a GitHub release with binaries attached
- Generate a Homebrew cask
- Push the formula to
homebrew-cache-cleanerrepository
-
Check the results:
Testing locally
# Install GoReleaser for local testing
brew install goreleaser
# Test the configuration
make goreleaser-check
# Test a snapshot build (without releasing)
make release-snapshot
# Test release process without building
make release-dry-runAfter creating your first release, verify the installation works correctly:
# Add the tap and install
brew tap markcallen/cache-cleaner
brew install cache-cleaner --verbose
# Verify all binaries are installed
which dev-cache
which git-cleaner
which mac-cache-cleaner
# Test functionality
dev-cache --version
git-cleaner --version
mac-cache-cleaner --version
# Audit the formula
brew audit --strict --online cache-cleaner
# Test uninstall (optional)
brew uninstall cache-cleaner
brew untap markcallen/cache-cleanerOpen an issue on GitHub: https://github.com/markcallen/cache-cleaner/issues
MIT License - see LICENSE file for details.
Mark C Allen (@markcallen)