OSS Tanbou

trash-cli — move files and folders to the operating system trash instead of deleting them with rm

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
1,414
Primary language
JavaScript
License
MIT
Repository last updated
Feb 2, 2026

Overview

sindresorhus/trash-cli provides a single trash command that moves files and folders to the macOS, Linux, or Windows trash/recycle bin instead of permanently deleting them with rm. The latest stable release checked on September 23, 2026 is 7.2.0.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Move paths or glob matches into the OS trash

The CLI accepts ordinary paths plus glob and negation patterns, with --verbose available to print the items moved.

Sources: [2][4]

Version 7.2.0 adds --dot for dotfiles in glob patterns

The new flag includes dotfiles when the CLI itself evaluates a glob. The README examples quote glob patterns so the shell does not expand them first.

Sources: [1][2]

Best fit

Fits interactive shell use where recoverability matters more than permanent deletion

It is useful for local terminal workflows where files should land in the system trash so they can still be restored through normal OS facilities.

Sources: [2]

Before adoption

This repository only provides trash; it does not provide list/restore/empty commands

Commands such as trash-put, trash-list, and trash-restore belong to different similarly named projects. This package only moves items to trash; restoration is handled by OS facilities and the README points to a separate empty-trash-cli for emptying trash.

Sources: [2][4]

Node.js 20 or newer is required

The v7.2.0 package metadata declares Node.js >=20.

Sources: [3]

alias rm=trash is convenient but not full rm compatibility

The README suggests the alias for interactive shells, but the implementation ignores several common rm flags rather than implementing their semantics. Do not substitute it in scripts that depend on exact rm behavior.

Sources: [2][4]

Understand shell expansion versus trash-cli globbing

Quoting patterns such as trash '*.png' lets trash-cli's globby implementation interpret the pattern. Unquoted globs can be expanded by the shell first, changing dotfile and negation behavior.

Sources: [2][4]

Main still reports version 7.2.0

Reviewed main contains later metadata edits but the package version remains 7.2.0, so functional evaluation can stay anchored to the release tag.

Sources: [5][3]

Official sources

  1. [1]trash-cli v7.2.0 release(2026-09-23)
  2. [2]trash-cli v7.2.0 README(2026-09-23)
  3. [3]trash-cli v7.2.0 package metadata(2026-09-23)
  4. [4]trash-cli v7.2.0 CLI implementation(2026-09-23)
  5. [5]trash-cli reviewed main(2026-09-23)
  6. [6]trash-cli MIT license(2026-09-23)
Supplemental curator note

This repository provides only the trash command. trash-put, trash-list, and trash-restore belong to other projects; this review corrects that prior confusion. Version 7.2.0 adds --dot for dotfile globs and requires Node 20+.

Try it in 3 steps

  1. 1

    Install trash-cli 7.2.0 globally

    Node.js 20 or newer is required.

    npm install --global trash-cli@7.2.0
  2. 2

    Create a disposable test file and move it to trash

    The file is moved to the operating system trash/recycle bin rather than permanently deleted.

    mkdir -p /tmp/trash-cli-demo && printf 'demo\n' >/tmp/trash-cli-demo/sample.txt && trash --verbose /tmp/trash-cli-demo/sample.txt
  3. 3

    Exercise quoted dotfile globbing

    This demonstrates the 7.2.0 --dot flag. Restore through normal OS trash facilities; this CLI does not provide list/restore commands.

    printf 'hidden\n' >/tmp/trash-cli-demo/.hidden.tmp && trash --dot --verbose '/tmp/trash-cli-demo/*.tmp'
Check the official README

Growth

Growth trends · Last 30 days

1,414 Stars

+1 (+0.1%)

Sep 5Sep 12

Development activity

Last 90 days · weekly

Issues opened
0
Issues closed
0
PRs opened
1
PRs merged
0

Issues

0 / 0

Jun 23Sep 20
Issues openedIssues closed

Pull requests

1 / 0

Jun 23Sep 20
PRs openedPRs merged

Maintenance

Median first response
Not specified
Issue response rate
No eligible issues

Based on up to the 100 newest issues opened by external users in the last 90 days. A first comment from an OWNER, MEMBER, or COLLABORATOR counts as a response; issues whose full comment history cannot be checked are excluded. The median and response rate update weekly.

Built with

Categories and tags

Categories

GitHub data

GitHub dataView detailed GitHub data
Stars
1,414
Forks
39
Watchers
9
Open issues
2
Contributors
4
Primary language
JavaScript
License
MIT
Repository last updated
Feb 2, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.