{"id":43437608,"url":"https://github.com/fenilsonani/cleanup-cache","last_synced_at":"2026-02-02T21:00:51.800Z","repository":{"id":325128741,"uuid":"1099951829","full_name":"fenilsonani/cleanup-cache","owner":"fenilsonani","description":"A powerful, safe, and intelligent CLI tool to clean up your Mac or Linux system","archived":false,"fork":false,"pushed_at":"2025-12-16T19:19:34.000Z","size":229,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-19T09:00:28.336Z","etag":null,"topics":["cache","cleaner","cleanup","cli","disk-space","golang","interactive","linux","macos","system-cleaner","tui"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fenilsonani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-19T16:41:27.000Z","updated_at":"2025-12-16T19:19:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fenilsonani/cleanup-cache","commit_stats":null,"previous_names":["fenilsonani/cleanup-cache"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/fenilsonani/cleanup-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenilsonani%2Fcleanup-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenilsonani%2Fcleanup-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenilsonani%2Fcleanup-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenilsonani%2Fcleanup-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fenilsonani","download_url":"https://codeload.github.com/fenilsonani/cleanup-cache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenilsonani%2Fcleanup-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29019533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T18:51:31.335Z","status":"ssl_error","status_checked_at":"2026-02-02T18:49:20.777Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","cleaner","cleanup","cli","disk-space","golang","interactive","linux","macos","system-cleaner","tui"],"created_at":"2026-02-02T21:00:32.232Z","updated_at":"2026-02-02T21:00:51.792Z","avatar_url":"https://github.com/fenilsonani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TidyUp 🗑️\n\nA powerful, safe, and intelligent CLI tool to clean up your Mac or Linux system by removing unnecessary files, caches, logs, and more.\n\n## ✨ Features\n\n- 🔍 **Smart Scanning** - Intelligently identifies cleanable files across multiple categories\n- 🔒 **Safe \u0026 Secure** - Multiple safety layers with confirmation prompts before deletion\n- 🚀 **Fast \u0026 Efficient** - Parallel scanning with progress updates\n- 📊 **Detailed Reports** - Multiple output formats (summary, table, JSON, YAML)\n- 🔐 **Permission Management** - Smart sudo handling for system files with pre-flight analysis\n- ⚙️ **Highly Configurable** - Customize what gets cleaned and how\n- 🎯 **Targeted Cleaning** - Clean by category (cache, temp, logs, downloads, etc.)\n- 🐳 **Docker Cleanup** - Clean unused Docker images, containers, volumes, and build cache\n- 🔐 **Secure Deletion** - DoD 5220.22-M and Gutmann secure file wiping standards\n- ⏰ **Daemon Mode** - Scheduled automated cleanups with cron-like scheduling\n\n## 📦 Installation\n\n### Homebrew (Recommended for macOS/Linux)\n\n```bash\nbrew install fenilsonani/tidyup/tidyup\n```\n\nOr tap first:\n```bash\nbrew tap fenilsonani/tidyup\nbrew install tidyup\n```\n\n### Go Install (requires Go 1.21+)\n\n```bash\ngo install github.com/fenilsonani/cleanup-cache/cmd/tidyup@latest\n```\n\n### Download Binary\n\nDownload the latest release from [GitHub Releases](https://github.com/fenilsonani/cleanup-cache/releases/latest).\n\n### From Source\n\n```bash\ngit clone https://github.com/fenilsonani/cleanup-cache.git\ncd cleanup-cache\nmake build\nsudo mv bin/tidyup /usr/local/bin/\n```\n\n## 🚀 Quick Start\n\n### 1. Scan your system\n```bash\ntidyup scan\n```\n\n### 2. Clean with preview (dry-run)\n```bash\ntidyup clean --dry-run\n```\n\n### 3. Actually clean files\n```bash\ntidyup clean\n```\n\n## 📖 Usage\n\n### Commands\n\n#### `tidyup scan`\nScan the system and report what can be cleaned without making any changes.\n\n```bash\ntidyup scan\ntidyup scan --output table\ntidyup scan --output json\n```\n\n#### `tidyup clean`\nClean the system based on your configuration.\n\n```bash\ntidyup clean                    # Interactive with confirmation\ntidyup clean --dry-run         # Preview what will be deleted\ntidyup clean --force           # Skip confirmation prompts\ntidyup clean --category cache  # Clean only specific category\n```\n\n#### `tidyup report`\nGenerate a detailed report of cleanup opportunities.\n\n```bash\ntidyup report                           # Show summary\ntidyup report --output json             # JSON format\ntidyup report --output yaml             # YAML format\ntidyup report --file report.json        # Save to file\n```\n\n#### `tidyup config`\nDisplay current configuration and config file location.\n\n```bash\ntidyup config\n```\n\n### Categories\n\nTidyUp can clean the following types of files:\n\n- **cache** - Application caches and temporary data\n- **temp** - Temporary files and directories\n- **logs** - Log files and archives\n- **package_managers** - Package manager caches (npm, pip, go, etc.)\n- **downloads** - Files in Downloads folder older than 30 days\n- **trash** - Items in system trash\n- **browser_cache** - Web browser caches\n- **docker** - Unused Docker containers, images, and volumes\n\n### Configuration\n\nThe tool will work with default settings, but you can customize behavior by creating a config file at `~/.config/cleanup-cache/config.yaml`:\n\n```yaml\n# Example configuration file\n# ~/.config/cleanup-cache/config.yaml\n\n# Global settings\ndry_run: false\nverbose: false\nmin_file_age: 1  # Hours - never delete files younger than this\n\n# Categories to include/exclude\ncategories:\n  cache: true\n  temp: true\n  logs: true\n  package_managers: true\n  downloads: false  # Disabled by default for safety\n  docker: false     # Requires Docker to be installed\n\n# Age thresholds (in days)\nage_thresholds:\n  logs: 30\n  downloads: 90\n  temp: 7\n\n# Exclusions\nexclude_patterns:\n  - \"*/important/*\"\n  - \"*.keep\"\n  - \"*/Documents/*\"\n\n# Docker settings (only applies when docker category is enabled)\ndocker:\n  enabled: false\n  clean_images: true\n  clean_containers: true\n  clean_volumes: false        # Disabled - may contain important data\n  clean_build_cache: true\n  only_dangling_images: true  # Only clean untagged images\n  only_stopped_containers: true\n  image_age_days: 7\n  container_age_days: 1\n\n# Secure deletion (military-grade file wiping)\nsecure_deletion:\n  enabled: false              # Disabled by default\n  standard: \"dod522022\"       # \"dod522022\", \"gutmann\", \"random\", \"none\"\n  verify_writes: true         # Verify each overwrite pass\n  force_sync: true            # Force sync to disk\n\n# Daemon mode for scheduled cleanups\ndaemon:\n  enabled: false\n  pid_file: \"/var/run/cleanup-cache.pid\"\n  log_file: \"/var/log/cleanup-cache.log\"\n  schedules:\n    - name: \"daily_cleanup\"\n      schedule: \"0 2 * * *\"   # Every day at 2 AM\n      categories:\n        cache: true\n        temp: true\n      dry_run: false\n  notifications:\n    enabled: false\n    on_success: true\n    on_failure: true\n```\n\n## 🛡️ Safety Features\n\n- **Dry Run Mode** - Preview what will be deleted before actually cleaning\n- **Confirmation Prompts** - Interactive confirmation before deletion\n- **Permission Analysis** - Shows which files need elevated permissions\n- **Smart Exclusions** - Automatically excludes important system directories\n- **Size Warnings** - Warns before deleting large files\n\n## 📊 Output Formats\n\n### Summary Format (default)\n```\n📊 System Scan Results\n\n📂 Found 1,234 files (2.3 GB)\n├── 📦 Cache: 892 files (1.8 GB)\n├── 🗂️  Temp Files: 312 files (450 MB)\n├── 📝 Logs: 30 files (50 MB)\n└── 🗑️  Trash: 0 files (0 B)\n```\n\n### Table Format\n```\n┌─────────────┬──────┬────────────┬─────────────────────────────────────┐\n│ CATEGORY    │ COUNT│ SIZE       │ PATH                              │\n├─────────────┼──────┼────────────┼─────────────────────────────────────┤\n│ cache       │  892 │ 1.8 GB     │ ~/Library/Caches                  │\n│ temp        │  312 │ 450 MB     │ /tmp                              │\n└─────────────┴──────┴────────────┴─────────────────────────────────────┘\n```\n\n### JSON Format\n```json\n{\n  \"total_count\": 1234,\n  \"total_size\": 2345678901,\n  \"categories\": {\n    \"cache\": {\n      \"count\": 892,\n      \"size\": 1932735283,\n      \"paths\": [\"/Users/user/Library/Caches\"]\n    }\n  }\n}\n```\n\n## 🔄 Automation\n\n### Cron Job\nSet up automatic weekly cleaning:\n\n```bash\n# Edit crontab\ncrontab -e\n\n# Add weekly cleanup (every Sunday at 2 AM)\n0 2 * * 0 /usr/local/bin/tidyup clean --force\n```\n\n### Script Usage\nUse in scripts with specific options:\n\n```bash\n#!/bin/bash\n# Backup important data before cleaning\necho \"Starting backup...\"\n./backup.sh\n\n# Clean with verbose output\ntidyup clean --force --verbose\n\necho \"Cleanup complete!\"\n```\n\n## 🐳 Docker Support\n\nClean Docker resources safely - only stops containers, removes unused images, and cleans build cache:\n\n```bash\n# Preview Docker cleanup\ntidyup clean --category docker --dry-run\n\n# Clean Docker resources\ntidyup clean --category docker --force\n```\n\n**Docker Safety Features:**\n- Only removes **stopped** containers (never running ones)\n- Only removes **dangling/unused** images by default\n- Volumes are disabled by default to prevent data loss\n- Configurable age thresholds for images and containers\n\n## 🔐 Secure Deletion\n\nFor sensitive data, enable secure deletion to overwrite files before removing:\n\n```yaml\n# In config.yaml\nsecure_deletion:\n  enabled: true\n  standard: \"dod522022\"  # DoD 5220.22-M (3 passes)\n```\n\n**Available Standards:**\n- `dod522022` - DoD 5220.22-M (3 passes) - Good balance of security and speed\n- `gutmann` - Gutmann method (35 passes) - Maximum security, very slow\n- `random` - Random data overwrite (configurable passes)\n- `none` - Standard deletion (fastest)\n\n## ⏰ Daemon Mode\n\nRun CleanupCache as a background service for automated scheduled cleanups:\n\n```bash\n# Start the daemon\ncleanup-daemon --config ~/.config/cleanup-cache/config.yaml\n\n# Test configuration\ncleanup-daemon --test-config\n\n# Run in foreground (for debugging)\ncleanup-daemon --foreground\n```\n\n**Daemon Features:**\n- Cron-style scheduling (e.g., `\"0 2 * * *\"` for daily at 2 AM)\n- Multiple schedules with different categories\n- Email and webhook notifications\n- Graceful shutdown handling\n- PID file management\n\n## 🔧 Advanced Usage\n\n### Clean Specific Categories\n```bash\n# Clean only cache and temp files\ntidyup clean --category cache --force\n\n# Clean multiple categories\ntidyup clean --category cache --category logs --force\n```\n\n### Generate Reports for Analysis\n```bash\n# Generate JSON report for analysis\ntidyup report --output json --file analysis.json\n\n# Use with other tools\ntidyup report --output json | jq '.total_size'\n```\n\n### Configuration Management\n```bash\n# Show current configuration\ntidyup config\n\n# Use custom config file\ntidyup --config ~/custom-config.yaml clean\n```\n\n## 🐛 Troubleshooting\n\n### Permission Denied\n```bash\n# The tool will prompt for sudo if needed\n# Or run with sudo explicitly\nsudo tidyup clean\n```\n\n### Files Not Deleted\nCheck the error output for specific reasons:\n\n- **File in use**: Close the application using the file\n- **Permission denied**: Run with sudo or check file ownership\n- **System protection**: Some system files are protected\n\n### Dry Run Shows Different Results\nFiles might be created/deleted between scan and actual cleaning. Always run with `--dry-run` first to see current state.\n\n## 📝 Examples\n\n### Before and After\n```bash\n$ tidyup scan\n📊 System Scan Results\n\n📂 Found 2,543 files (4.2 GB)\n├── 📦 Cache: 1,892 files (3.1 GB)\n├── 🗂️  Temp Files: 412 files (850 MB)\n├── 📝 Logs: 239 files (250 MB)\n└── 🗑️  Trash: 0 files (0 B)\n\n$ tidyup clean --force\nScanning system...\n📊 Cleanup Complete!\n✅ Successfully deleted: 2,543 files (4.2 GB)\n```\n\n### Selective Cleaning\n```bash\n# Only clean caches, leave everything else\n$ tidyup clean --category cache --dry-run\n📊 System Scan Results\n\n📂 Found 1,892 files (3.1 GB)\n├── 📦 Cache: 1,892 files (3.1 GB)\n\n$ tidyup clean --category cache --force\n✅ Successfully deleted: 1,892 files (3.1 GB)\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the project\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Built with [Cobra](https://github.com/spf13/cobra) for CLI framework\n- Inspired by various system cleaning tools\n- Thanks to all contributors\n\n## 📞 Support\n\nIf you encounter any issues:\n\n1. Check the [Issues](https://github.com/fenilsonani/cleanup-cache/issues) page\n2. Create a new issue with details about your system\n3. Include the output of `tidyup --version`\n\n---\n\n**⚠️ Warning**: This tool deletes files permanently. Always review what will be deleted with `--dry-run` first, especially when using `--force`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenilsonani%2Fcleanup-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffenilsonani%2Fcleanup-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenilsonani%2Fcleanup-cache/lists"}