{"id":46600600,"url":"https://github.com/soldatov-ss/thanos","last_synced_at":"2026-03-07T16:03:28.156Z","repository":{"id":324373593,"uuid":"1097000241","full_name":"soldatov-ss/thanos","owner":"soldatov-ss","description":"A CLI tool that deletes half your files — perfectly balanced, as all things should be.","archived":false,"fork":false,"pushed_at":"2025-12-01T15:19:16.000Z","size":196,"stargazers_count":22,"open_issues_count":2,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-02T23:56:30.220Z","etag":null,"topics":["cleanup","cli","python","thanos","utility"],"latest_commit_sha":null,"homepage":"","language":"Python","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/soldatov-ss.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-15T10:52:36.000Z","updated_at":"2025-11-29T00:27:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/soldatov-ss/thanos","commit_stats":null,"previous_names":["soldatov-ss/thanos"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/soldatov-ss/thanos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldatov-ss%2Fthanos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldatov-ss%2Fthanos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldatov-ss%2Fthanos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldatov-ss%2Fthanos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soldatov-ss","download_url":"https://codeload.github.com/soldatov-ss/thanos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soldatov-ss%2Fthanos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30221193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T14:02:48.375Z","status":"ssl_error","status_checked_at":"2026-03-07T14:02:43.192Z","response_time":53,"last_error":"SSL_read: 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":["cleanup","cli","python","thanos","utility"],"created_at":"2026-03-07T16:03:27.629Z","updated_at":"2026-03-07T16:03:28.149Z","avatar_url":"https://github.com/soldatov-ss.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🫰 Thanos\n\n\u003e *\"Perfectly balanced, as all things should be.\"*\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/glove.png\" width=\"120\" alt=\"A glove\"/\u003e\n\u003c/p\u003e\n\nA Python CLI tool that randomly eliminates half of the files in a directory with a snap. Inspired by Marvel's Thanos and\nhis infamous snap.\n\n[![Test Python application](https://github.com/soldatov-ss/thanos/actions/workflows/test.yml/badge.svg)](https://github.com/soldatov-ss/thanos/actions/workflows/test.yml)\n[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)\n[![Coverage Status](https://coveralls.io/repos/github/soldatov-ss/thanos/badge.svg?branch=master)](https://coveralls.io/github/soldatov-ss/thanos?branch=master)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## ⚠️ Warning\n\n**This tool permanently deletes files!** Use `--dry-run` first to preview what would be deleted. Deleted files cannot be\nrecovered. Use at your own risk!\n\n## ✨ Features\n\n* 🗑️ **Trash Mode**: Optionally move files to the system trash/recycle bin instead of permanent deletion.\n* ⚖️ **Weighted Selection**: Configure probabilities based on file age, size, or extension.\n* 🛡️ **Smart Protections**: Automatically protects `.git`, `node_modules`, `venv`, and system files.\n* 🚫 **Custom Ignore**: Support for `.thanosignore` using gitignore syntax.\n* 🎲 **Reproducibility**: Use seeds to ensure the exact same files are selected every time.\n* 📁 **Recursive Support**: Optionally include files in subdirectories.\n\n## 📦 Installation\n\n### Using uv (recommended)\n\n```bash\nuv add thanos-cli\nuv pip install thanos-cli   # \u003c- if you don't have pyproject.toml\n```\n\n### Using pip\n\n```bash\npip install thanos-cli\n```\n\n## 🚀 Quick Start\n\n### 1. Initialize Configuration\n\nCreate default `.thanosignore` and `.thanosrc.json` files in your project:\n\n```bash\nthanos init\n```\n\n### 2. Preview the Snap\n\nAlways start with a dry run to see the \"dead\" files without deleting them:\n\n```bash\nthanos snap --dry-run\n```\n\n### 3. Execute\n\nWhen you are ready to restore balance:\n\n```bash\n# Permanent deletion (Standard Snap)\nthanos snap\n\n# Safer Snap (Move to Trash)\nthanos snap --trash\n```\n\n## ⚙️ Configuration\n\nThanos supports advanced configuration to control the chaos.\n\n### `.thanosignore`\n\nProtect specific files or folders from being snapped (gitignore syntax):\n\n```\n# Protect specific folders\nsrc/\nimportant_docs/\n!debug.log\n```\n\n### `.thanosrc.json`\n\nDefine weights (0.0 to 1.0) to make specific files more or less likely to be eliminated.\n\n- **0.0**: Never eliminate\n- **0.5**: Neutral (Default)\n- **1.0**: Always eliminate\n\nSupported weight types:\n\n- **by_extension** — e.g., target `.tmp` or `.log` files\n- **by_age_days** — e.g., target files older than `30+` days\n- **by_size_mb** — e.g., target files larger than `100+` MB\n\nSee `docs/configuration.md` for the full schema.\n\n## 📖 Commands\n\nThe CLI structure:\n\n- `thanos init` — Generate configuration files.\n- `thanos snap [DIRECTORY] [OPTIONS]` — Main command to eliminate files.\n\nOptions:\n\n- `-t, --trash` — Move files to system trash instead of permanent deletion.\n- `-r, --recursive` — Include subdirectories\n- `-d, --dry-run` — Preview without deleting\n- `--seed \u003cINT\u003e` — Set seed for reproducibility\n- `--no-protect` — Disable protections (dangerous)\n\nFor detailed usage, see `docs/usage.md`.\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 🤔 FAQ\n\n**Q: Can I recover deleted files?**\nA: If you use the --trash flag, **YES**, you can restore them from your system's Recycle Bin/Trash.\nIf you run the standard command without that flag, files are **permanently deleted**.\n\n**Q: How are files selected?**\nA: Randomly, but you can bias the selection using weights in `.thanosrc.json`.\n\n**Q: What is protected by default?**\nA: `.git`, `.svn`, `node_modules`, `venv`, `__pycache__`, `.env`, and more.\n\n**Q: What if I have an odd number of files?**\nA: If you have 11 files, 5 will be deleted (11 // 2 = 5) and 6 will remain.\n\n## 🙏 Acknowledgments\n\n- Inspired by the Marvel Cinematic Universe\n\n---\n\n**Remember: With great power comes great responsibility. Use Thanos wisely! 🫰**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoldatov-ss%2Fthanos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoldatov-ss%2Fthanos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoldatov-ss%2Fthanos/lists"}