dsh-trash
DSH 回收站插件:最高权限下所有删除操作一律拦截并转入回收站,误删可一键恢复。Intercepts every delete operation (Remove-Item/rm/del/fs.unlink/...) and redirects it to a recoverable trash store.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:LeonSone/dsh-trash说明文档
阅读完整 README ↗Usage
Once installed, the model's behavior changes automatically:
| Scenario | Behavior |
|---|---|
Model runs Remove-Item / rm / del / … | Blocked with a message explaining the trash workflow |
Model calls trash(paths=[...]) | Files/dirs move into the trash (recoverable) |
| Accidental delete | trash-restore(entry_id=...) restores to the original path; or trash-restore(path="") finds the newest matching entry |
| Permanent cleanup | trash-purge(confirm: true) — optionally scoped to specific entry_ids |
Tool reference
| Tool | Purpose |
|---|---|
trash(paths, reason?) | Move files/directories into the trash. Returns entry_id, trash_root, moved. |
trash-list(path?) | List trash entries (deleted-at, size, reason, original paths). Optional substring filter on the original path. |
trash-restore(entry_id? | path?, target_path?, overwrite?) | Restore an entry to its original location (or target_path for single-item entries). If the target exists, it refuses unless overwrite: true — in which case the existing content is first moved to the trash itself, then the restore proceeds. Nothing is ever lost. |
trash-purge(entry_ids?, confirm: true) | Permanently delete trash entries. The only real deletion in the whole plugin. |
Configuration (optional)
Append to your profile's cordis.patch.yml:
- id: dsh-trash
config:
location: D:/data/dsh-trash # trash root; same drive as the workspace = instant renames
interceptPwsh: true # intercept deletes in pwsh (default true)
interceptBash: true # intercept deletes in bash (default true)
interceptRunCode: true # intercept fs.* deletes in run_code (default true)