{"id":31164265,"url":"https://github.com/sivchari/trash-cli-go","last_synced_at":"2025-09-19T07:57:14.134Z","repository":{"id":302793353,"uuid":"1013640044","full_name":"sivchari/trash-cli-go","owner":"sivchari","description":"A Go reimplementation of trash-cli that follows the FreeDesktop.org trash standard.","archived":false,"fork":false,"pushed_at":"2025-07-04T08:43:08.000Z","size":3509,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T14:11:35.729Z","etag":null,"topics":["trash-cli","trashcan"],"latest_commit_sha":null,"homepage":"","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/sivchari.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2025-07-04T08:20:06.000Z","updated_at":"2025-07-23T10:14:01.000Z","dependencies_parsed_at":"2025-07-04T09:33:16.021Z","dependency_job_id":"86305eb9-1e70-4e49-bbc5-7ea7ed2701cb","html_url":"https://github.com/sivchari/trash-cli-go","commit_stats":null,"previous_names":["sivchari/trash-cli-go"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sivchari/trash-cli-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Ftrash-cli-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Ftrash-cli-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Ftrash-cli-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Ftrash-cli-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sivchari","download_url":"https://codeload.github.com/sivchari/trash-cli-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivchari%2Ftrash-cli-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275902080,"owners_count":25549242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"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":["trash-cli","trashcan"],"created_at":"2025-09-19T07:57:08.871Z","updated_at":"2025-09-19T07:57:14.100Z","avatar_url":"https://github.com/sivchari.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trash-cli-go\n\n[![Test](https://github.com/sivchari/trash-cli-go/actions/workflows/test.yml/badge.svg)](https://github.com/sivchari/trash-cli-go/actions/workflows/test.yml)\n[![Release](https://github.com/sivchari/trash-cli-go/actions/workflows/release.yml/badge.svg)](https://github.com/sivchari/trash-cli-go/actions/workflows/release.yml)\n\nA Go reimplementation of [trash-cli](https://github.com/andreafrancia/trash-cli) that follows the FreeDesktop.org trash standard.\n\n## Features\n\n- **trash put** - Move files and directories to trash\n- **trash list** - List trashed files  \n- **trash restore** - Restore files from trash (interactive UI)\n- **trash empty** - Empty the trash (with optional age filter)\n- **trash rm** - Remove specific files from trash (pattern matching)\n- **trash version** - Show version information\n\n## Installation\n\n### Download prebuilt binaries\n\nDownload the latest release from [GitHub Releases](https://github.com/sivchari/trash-cli-go/releases).\n\n### Using Go\n\n```bash\ngo install github.com/sivchari/trash-cli-go@latest\n```\n\n### Build from source\n\n```bash\ngit clone https://github.com/sivchari/trash-cli-go\ncd trash-cli-go\ngo build -o trash\n```\n\n\n## Usage\n\n### Basic Operations\n\n```bash\n# Move files to trash\n./trash put file.txt directory/\n\n# List trashed files\n./trash list\n\n# Restore files (interactive selection)\n./trash restore\n\n# Empty trash completely\n./trash empty\n\n# Remove files older than 30 days\n./trash empty 30\n\n# Remove specific files from trash\n./trash rm \"*.txt\"\n./trash rm \"old_file\"\n\n# Show version\n./trash version\n\n# Get help\n./trash --help\n./trash [command] --help\n```\n\n### Advanced Features\n\n- **Interactive restore** - User-friendly TUI for selecting files to restore\n- **Pattern matching** - Use wildcards with `trash rm` command\n- **Age-based cleanup** - Remove old files with `trash empty \u003cdays\u003e`\n- **FreeDesktop.org compliance** - Compatible with Linux desktop environments\n- **Cross-platform** - Works on Linux, macOS, and Windows\n\n## Trash Location\n\nFiles are stored in `~/.local/share/Trash/` following the FreeDesktop.org standard, making it compatible with desktop environments like GNOME, KDE, and XFCE.\n\n## Performance Comparison\n\nBenchmark results comparing trash-cli-go with the original Python implementation:\n\n| Operation | Original (Python) | Go Implementation | Improvement |\n|-----------|------------------|-------------------|-------------|\n| **Single file trash** | 0.488s | 0.305s | **37% faster** |\n| **100 files trash** | 0.130s | 0.068s | **48% faster** |\n| **List trash contents** | 0.377s | 0.031s | **92% faster** |\n| **Startup time** | 0.041s | 0.004s | **90% faster** |\n| **Memory usage (10MB file)** | 14.2MB | 5.2MB | **63% less** |\n\n### Key Advantages\n\n- **Lightning-fast startup** - No Python interpreter overhead\n- **Efficient file operations** - Native system calls\n- **Low memory footprint** - Ideal for resource-constrained environments\n- **Better performance at scale** - Handles large numbers of files efficiently\n\n## Compatibility\n\nThis implementation aims to be compatible with the original Python trash-cli, supporting the same command structure and .trashinfo file format.\n\n## Development\n\n### Prerequisites\n\n- Go 1.24.4 or later\n- make (optional, for using Makefile)\n\n### Building\n\n```bash\n# Using make\nmake build\n\n# Or directly with go\ngo build -o trash\n```\n\n### Testing\n\n```bash\n# Run tests\nmake test\n\n# Generate coverage report\nmake coverage\n```\n\n### Running Benchmarks\n\n```bash\nmake benchmark\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivchari%2Ftrash-cli-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsivchari%2Ftrash-cli-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivchari%2Ftrash-cli-go/lists"}