rust · cli · safe-delete

nuke

A safer way to clean directories.

$ curl -fsSL https://github.com/AndresFritscheOgando/nuke/releases/latest/download/install.sh | sh
00

Usage

~/projects/myapp
$

01

What it does

02

Flags

Flag Description
-t <PATH>, --target <PATH> Target directory — repeatable, defaults to current directory
-a, --all Nuke files and subdirectories
--files-only Nuke files only, preserve subdirectories (default)
--dry-run Preview what would be moved — no files are touched
--pattern <GLOB> Only nuke items matching glob pattern
--exclude <GLOB> Skip items matching glob — repeatable, takes precedence over --pattern
--force Skip the [y/N] confirmation prompt
Subcommands
Command Description
nuke list Table of all trash sessions — timestamp, file count, size
nuke restore Interactive picker — choose session, choose destination, restore files
nuke empty Multi-select sessions for permanent deletion
nuke empty --all Permanently delete all trash sessions at once
03

Examples

Nuke files in the current directory
nuke
Preview what would be moved without touching disk
nuke --dry-run -t ./dist
Nuke files in ./dist, skip confirmation
nuke -t ./dist --force
Nuke files and subdirectories in ./build
nuke -a -t ./build
Nuke multiple targets in one command
nuke -t ./dist -t ./build --force
Only nuke items matching a glob pattern
nuke --pattern "*.log" -t ./logs --force
Nuke everything except .env files
nuke --exclude "*.env" -t ./dist --force
List all trash sessions
nuke list
Interactively restore files from trash
nuke restore
Permanently clear all trash
nuke empty --all
04

Recovery

Interactive restore — pick session and destination:

nuke restore

Manually recover a specific file (items are namespaced by target dir):

mv ~/.nuke-trash/2026-04-22_10-00-00/dist/myfile.txt ./

Permanently delete selected trash sessions:

nuke empty

Permanently clear all trash at once:

nuke empty --all