π§Ή TidyMyMac
An open-source macOS storage cleanup utility for developers.
Scan, review, and reclaim disk space β safely, transparently, and from the terminal.
β¨ Features
- π₯οΈ Interactive TUI to browse and select what to clean
- π‘οΈ Dry-run by default β nothing is deleted without your explicit confirmation
- π Modular cleaners for different categories of junk
- π Progress reporting and summary of reclaimed space
- π€ Export scan results as JSON or CSV
- π Generate shell cleanup scripts from scan results
- π― Target specific categories in any command
ποΈ Cleaners
| Category |
What it targets |
| ποΈ Temporary Files |
/tmp, /var/tmp, user temp directories |
| π¦ Application Caches |
~/Library/Caches |
| π System Logs |
~/Library/Logs, /Library/Logs, /var/log |
| πΊ Homebrew Cache |
Packages cached by brew |
| π³ Docker Artifacts |
Stopped containers, untagged images, orphaned volumes |
| π± iOS Backups |
iPhone/iPad backups in ~/Library/Application Support/MobileSync/Backup |
| π macOS Updates |
Old macOS update residues and installers |
| ποΈ Xcode |
DerivedData, archives, simulators |
| π¨βπ» Development Artifacts |
Go build cache and downloaded module cache |
| π°οΈ Time Machine Snapshots |
Local Time Machine snapshots stored on disk |
| ποΈ Trash |
Files in the Trash waiting to be permanently removed |
π Installation
# Clone and build
git clone https://github.com/viniciussouzao/tidymymac
cd tidymymac
make build
# Run
./bin/tidymymac
Requires Go 1.21+
π οΈ Usage
# Launch interactive TUI (dry-run, nothing is deleted)
tidymymac
# Actually delete the selected files
tidymymac --execute
π Commands
scan β identify junk without deleting
# Interactive table (default)
tidymymac scan
# Scan specific categories only
tidymymac scan docker caches xcode
# Output as JSON or CSV
tidymymac scan --output json
tidymymac scan --output csv
# Include individual file paths in output
tidymymac scan --output json --detailed
# Save output to a timestamped file
tidymymac scan --output csv --save
# Generate a shell cleanup script from scan results
tidymymac scan --generate-script
# Suppress progress output (useful in scripts)
tidymymac scan --output json --quiet
clean β delete junk files
# Preview what would be deleted (dry-run, default)
tidymymac clean
# Actually delete files
tidymymac clean --execute
# Clean specific categories
tidymymac clean docker caches --execute
# Use a previously saved detailed scan instead of re-scanning
tidymymac clean --from-file scan.json --execute
# Output cleanup result as JSON
tidymymac clean --output json
Other commands
tidymymac version # Print version, commit, build date, platform, and Go version
tidymymac explain # Explain what each category contains
tidymymac history # Show past cleanup runs
ποΈ Development
make build # Compile binary to bin/tidymymac
make test # Run tests with race detection
make run # Build and run
make clean # Remove build artifacts
π Safety
TidyMyMac is designed with safety as the primary concern:
- β
Dry-run by default: scanning and reviewing never touches your files
- β
Explicit confirmation required: deletion only happens with
--execute
- β
No silent operations: every file is shown before removal
- β
Errors are non-fatal: a failure on one file won't stop the rest
π License
This project is licensed under the MIT License - see the LICENSE file for details.