{"id":19261175,"url":"https://github.com/ericklima-ca/trash","last_synced_at":"2026-06-13T06:32:28.233Z","repository":{"id":196769780,"uuid":"697088393","full_name":"ericklima-ca/trash","owner":"ericklima-ca","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-27T03:17:20.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T00:08:08.222Z","etag":null,"topics":[],"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/ericklima-ca.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}},"created_at":"2023-09-27T03:07:21.000Z","updated_at":"2023-09-27T17:43:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"2552dfb1-ea73-4473-8c60-84cf6b6e68c1","html_url":"https://github.com/ericklima-ca/trash","commit_stats":null,"previous_names":["ericklima-ca/trash"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericklima-ca/trash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericklima-ca%2Ftrash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericklima-ca%2Ftrash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericklima-ca%2Ftrash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericklima-ca%2Ftrash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericklima-ca","download_url":"https://codeload.github.com/ericklima-ca/trash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericklima-ca%2Ftrash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34275067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"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":[],"created_at":"2024-11-09T19:25:16.971Z","updated_at":"2026-06-13T06:32:27.937Z","avatar_url":"https://github.com/ericklima-ca.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trash 🗑️\n`trash` is a command-line interface (CLI) tool designed to prevent irreversible file deletions. It achieves this by moving files to a designated trash folder instead of permanently deleting them, allowing for future cleanup or recovery.\n\n## Warning\n**UNDER DEVELOPMENT**\n\n## Installation\nYou can install `trash` using the following command:\n\n```sh\ngo install github.com/ericklima-ca/trash@latest\n```\n\n## Usage\nTo use `trash`, you can run the following command:\n\n```sh\n$ trash remove file.txt\n```\n\n`file.txt` will be moved to the `~/.trash` directory inside of a timestamp folder instead of being deleted.\n\n```sh\nuser@ in ~/.trash\n$ tree\n.\n└── 20230927005243\n    └── file.txt\n\n2 directories, 1 file\n```\n\n### Available Commands\n- **clean**: Cleans the trash directory.\n- **completion**: Generates autocompletion scripts for various shells.\n- **help**: Provides help and information about available commands.\n- **init**: Initializes the trash directory (default location: `$HOME/.trash`).\n- **remove**: Moves files to the trash directory.\n- **stats**: Displays statistics about the contents of the trash directory, similar to 'du -sh'.\n\n### Flags\n- `-h, --help`: Display help for the `trash` command.\n- `-v, --version`: Display the version information for `trash`.\n\n## Creating an Alias for Easy Usage (Optional)\nTo simplify the usage of `trash` and make it a seamless replacement for the `rm` command, you can create an alias in your shell configuration file (e.g., `.zshrc` for Zsh). This alias will allow you to use `trash` instead of `rm`, ensuring that deleted files go to the trash directory by default.\n\n```.zshrc\n# ~/.zshrc\n...\nalias rm=\"trash remove\"\n...\n```\n\n## Generate the autocompletion script for the zsh shell.\n\nIf shell completion is not already enabled in your environment you will need\nto enable it.  You can execute the following once:\n```sh\necho \"autoload -U compinit; compinit\" \u003e\u003e ~/.zshrc\n```\nTo load completions in your current shell session:\n```sh\nsource \u003c(trash completion zsh)\n```\n\nTo load completions for every new session, execute once:\n\n#### Linux:\n```sh\ntrash completion zsh \u003e \"${fpath[1]}/_trash\"\n```\n\n#### macOS:\n```sh\ntrash completion zsh \u003e $(brew --prefix)/share/zsh/site-functions/_trash\n```\nYou will need to start a new shell for this setup to take effect.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericklima-ca%2Ftrash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericklima-ca%2Ftrash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericklima-ca%2Ftrash/lists"}