trash-cli
$ trash-put Community Med Risktrash-cli implements the FreeDesktop.org Trash specification via separate commands: trash-put moves files non-interactively to the trashcan, trash-list inspects trashed paths, trash-restore recovers items, and trash-empty permanently purges them. Using trash-put instead of rm gives coding agents reversible file deletion.
brew install trash-cli Direct trash-put calls give agents instant reversible local file deletion without any MCP layer.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
trash-put and trash-list run non-interactively with clean exit codes, though trash-list emits plain text (no --json) and trash-restore prompts interactively.
trash-putandtrash-listwork headlessly- No
--jsonoutput;trash-restoreis interactive by default
Reversible trash placement is dramatically safer than rm, though trash-empty and trash-rm perform permanent deletion.
trash-putpreserves recovery path and timestamptrash-emptypermanently deletes trashed items
Installed easily via brew install trash-cli, pip install trash-cli, or Linux distro packages; not built for Windows.
- Available on PyPI, Homebrew, and Linux repositories
Drop-in safer alternative to rm in agent cleanup workflows with zero configuration.
- Single-command reversible deletion via
trash-put
Long-standing GPL-2.0 Python project (andreafrancia/trash-cli) maintained across distributions.
- Stable GitHub repository with distro packaging
Clear README and per-command --help / man pages for trash-put, trash-list, trash-restore, and trash-empty.
- Man pages and README examples for all subcommands
Security, Auth & Guardrails
None required; writes FreeDesktop trash metadata under ~/.local/share/Trash/.
100% free, offline, and open-source (GPL-2.0).
# trash-cli Agent Rules - Prefer `trash-put` over `rm` for reversible cleanup. - NEVER run `trash-empty` or `trash-rm` without explicit user approval—they permanently purge files. - Avoid bare `trash-restore` in headless shells since it prompts interactively for a row index.
Agent-Ready Command Recipes
Safe Read-Only Queries
trash-list
Prints deletion timestamps and original file paths from the FreeDesktop trash directory read-only.
Controlled Writes & Previews
trash-put build/old-artifact.tar.gz
Moves the file to ~/.local/share/Trash/ instead of unlinking it permanently like rm.
Strengths for Agents
- +
trash-putgives agents a non-interactive, reversible alternative torm. - +
trash-listrecords exact deletion timestamps and original paths.
Caveats & Pitfalls
- ! No
--jsonoutput fromtrash-list. - !
trash-restoreprompts interactively unless piped;trash-emptypermanently deletes.