Trash CLI for Openclaw

A powerful command-line interface that enables safe file deletion by moving items to the system trash instead of permanent removal.

xlionjuan
v1.0.5
Feb 28, 2026
0
1.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install trash-cli

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install trash-cli using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Trash CLI?

Trash CLI provides a suite of command-line tools that follow the freedesktop.org trashcan specification. Unlike the standard rm command, which permanently deletes files, this Openclaw Skills integration allows users to move files to a recoverable trash location while recording original paths, deletion dates, and permissions. It integrates seamlessly with desktop environments like GNOME, KDE, and XFCE.

This skill is vital for developers who want a safety net against accidental deletions while working in the terminal. By utilizing Openclaw Skills like this, users can implement a more robust data management strategy across various partitions and directories without fear of losing critical work. It acts as a bridge between the efficiency of the command line and the safety of graphical user interface trash systems.

Trash CLI Use Cases

  • Safely deleting files or directories without immediate permanent removal.
  • Recovering accidentally deleted files to their original location using an interactive menu.
  • Auditing deleted files with specific metadata like deletion date and original path.
  • Automating the cleanup of old trashed files based on their age, such as removing files older than 7 days.
  • Managing trash across multiple partitions and user accounts in a headless or server environment.

How Trash CLI Works

  1. The user executes trash-put to move a file or directory into the system-defined trash folder instead of using rm.
  2. The utility records essential metadata, including the original absolute file path and the exact timestamp of deletion.
  3. Users can view a comprehensive list of all recoverable items and their metadata using the trash-list command.
  4. If recovery is needed, trash-restore provides an interactive interface to select and return files to their exact original location.
  5. To maintain system storage, trash-empty can be used to permanently purge files based on specific age criteria or volume.

Trash CLI Setup

Installation is straightforward for any environment supported by Openclaw Skills. You can install the package using various package managers:

# macOS or Linux via Homebrew
brew install trash-cli

# Python environments
pip install trash-cli

# Debian/Ubuntu
sudo apt install trash-cli

# Arch Linux
sudo pacman -S trash-cli

After installation, it is recommended to add a warning alias to your .bashrc or .zshrc to discourage direct rm usage while encouraging the use of Openclaw Skills tools.

Trash CLI Data Schema & Taxonomy

Trash CLI organizes data by creating a metadata file and moving the original file to a specific subdirectory according to the Freedesktop.org specification.

Location Purpose
~/.local/share/Trash/ Default trash directory for the home partition.
/files/ Subdirectory containing the actual trashed files renamed to avoid collisions.
/info/ Subdirectory containing .trashinfo files with original paths and deletion dates.
$mount/.Trash/$uid Trash location for external partitions or secondary mounts to ensure cross-device safety.

Trash CLI Advanced Features

  • Interactive restoration with multi-file selection capabilities using index numbers.
  • Time-based trash purging, allowing users to keep only recent deletions (e.g., trash-empty 30).
  • Pattern-based removal from trash using trash-rm to target specific file types for permanent deletion.
  • Support for multiple partitions, automatically creating partition-specific trash folders when necessary.
  • Full compatibility with the Openclaw Skills ecosystem for automated system maintenance and cleanup scripts.

SKILL.md


Loading

Related Openclaw Skills

Featured*