{"id":26223519,"url":"https://github.com/hamedmp/devdetox","last_synced_at":"2026-05-22T20:34:27.407Z","repository":{"id":275118586,"uuid":"925124832","full_name":"HamedMP/devdetox","owner":"HamedMP","description":"A simple tool to clean up old dev directories and free up space","archived":false,"fork":false,"pushed_at":"2025-01-31T09:35:58.000Z","size":402,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T09:35:01.198Z","etag":null,"topics":["disk-space-cleaner","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HamedMP.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-01-31T09:25:12.000Z","updated_at":"2025-01-31T09:37:45.000Z","dependencies_parsed_at":"2025-01-31T10:31:45.417Z","dependency_job_id":"faf69636-6179-46b2-a717-f27f17fc02b6","html_url":"https://github.com/HamedMP/devdetox","commit_stats":null,"previous_names":["hamedmp/devdetox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HamedMP/devdetox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamedMP%2Fdevdetox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamedMP%2Fdevdetox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamedMP%2Fdevdetox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamedMP%2Fdevdetox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HamedMP","download_url":"https://codeload.github.com/HamedMP/devdetox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamedMP%2Fdevdetox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33366523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["disk-space-cleaner","go"],"created_at":"2025-03-12T17:35:49.710Z","updated_at":"2026-05-22T20:34:22.371Z","avatar_url":"https://github.com/HamedMP.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevDetox 🧹\n\nA Go utility that helps identify and clean up old `node_modules`, `.venv`, and `.env` directories that are taking up space on your system. It finds directories older than a specified age, calculates their sizes, and deletes them. The logs are exported to a CSV file.\n\n## Features\n\n- 🔍 Finds old `node_modules`, `.venv`, and `.env` directories\n- 📊 Calculates directory sizes using `du`\n- 📝 Exports results to CSV for record keeping\n- 🗑️ Interactive deletion with support for single, multiple, or all directories\n- 💪 Handles large directory structures efficiently\n- ✨ Progress indication for long operations\n\n## Requirements\n\n- Go 1.x\n- Unix-like system (Linux/macOS) with `du` command available\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/hamedmp/devdetox\ncd devdetox\n\n# Build the binary\ngo build -o devdetox\n\n# Optional: Move to a directory in your PATH (Linux/macOS)\nsudo mv devdetox /usr/local/bin/\n```\n\n## Quick Start\n\n```bash\n# Run directly after building\n./devdetox -path /your/path -days 30\n\n# Or if installed to PATH\ndevdetox -path /your/path -days 30\n\n# Or run it without building\ngo run main.go -path /your/path\n```\n\n## Usage\n\nBasic usage:\n\n```bash\n./devdetox -path /path/to/search -days 30\n```\n\nArguments:\n\n- `-path`: Starting directory for the search (required)\n- `-days`: Minimum age in days for directories (default: 30)\n\nThe tool will:\n\n1. Scan for matching directories older than specified days\n2. Calculate sizes for found directories\n3. Generate a CSV report with timestamps\n4. Offer interactive deletion options\n\n## Running as a Cron Job\n\nTo run automated scans (without interactive deletion), you can set up a cron job:\n\n1. Create a shell script `cleanup_scan.sh`:\n\n```bash\n#!/bin/bash\nSCAN_PATH=\"/your/search/path\"\nOUTPUT_DIR=\"/path/to/store/reports\"\n\ncd /path/to/devdetox\n./devdetox -path \"$SCAN_PATH\" \u003e \"$OUTPUT_DIR/scan_$(date +\\%Y\\%m\\%d).log\" 2\u003e\u00261\n```\n\n2. Make it executable:\n\n```bash\nchmod +x cleanup_scan.sh\n```\n\n3. Add to crontab (runs every Monday at 2 AM):\n\n```bash\n0 2 * * 1 /path/to/cleanup_scan.sh\n```\n\nEdit crontab with:\n\n```bash\ncrontab -e\n```\n\n## Output\n\nThe tool generates a CSV file named `cleanup_TIMESTAMP.csv` containing:\n\n- Full path to directory\n- Size (human-readable)\n- Last modified date\n\n## Example\n\nI cleaned 43 GBs of old node_modules and .venv directories on my mac.\n\n![Screenshot](devdetox.png)\n\n```bash\n$ ./dircleanup -path /Users/me/projects -days 60\n\nFinding old directories...\nCalculating sizes for 15 directories...\n\nFound directories older than 60 days:\n\n1. /Users/me/projects/old-project/node_modules\n   Size: 1.2G\n   Modified: 2023-12-01 15:04:05\n\n2. /Users/me/projects/legacy-app/.venv\n   Size: 234M\n   Modified: 2023-11-15 10:30:00\n\nResults written to: cleanup_2024-03-15_150405.csv\n```\n\n## License\n\nMIT License - See LICENSE file for details\n\n## Contributing\n\nPull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.\n\n# Initialize the module\n\ngo mod init github.com/hamedmp/devdetox\n\n# Tidy up dependencies (though you might not have any external ones)\n\ngo mod tidy\n\n```\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamedmp%2Fdevdetox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamedmp%2Fdevdetox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamedmp%2Fdevdetox/lists"}