id = "safe-rm"
name = "safe-rm"
homepage = "https://github.com/kaelzhang/shell-safe-rm"
description = "Safe-rm: A drop-in and much safer replacement of the unix rm command with nearly full functionalities and options of the rm command!"
executables = ["safe-rm"]
[dotfiles]
paths = ["~/.safe-rm/config", "~/.safe-rm/.gitignore"]
exclude = []
secret = []
[commands]
format = 1
label = "Move to Trash"
description = "Move files or directories to the system Trash instead of deleting them, with rm-compatible switches."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = false, short_bundles = true }
[[commands.source]]
id = "readme"
kind = "manual"
url = "https://github.com/kaelzhang/shell-safe-rm"
revision = "2026-10-27"
evidence = """
| `-i`, `--interactive` | **Interactive** | Prompts you to confirm before removing each file |
| `-f`, `--force` | **Force** | Removes files without prompting for confirmation, ignoring nonexistent files and overriding file protections |
| `-r`, `-R`, `--recursive`, `--Recursive` | **Recursive** | Removes directories and their contents recursively. Required for deleting directories |
| `-v`, `--verbose` | **Verbose** | Displays detailed information about each file or directory being removed |
| `-d`, '--directory' | **Remove Empty Directories** | `safe-rm` can check and only remove empty directories specifically with this flag |
| `--` | **End of Options** | Used to indicate the end of options. Useful if a filename starts with a `-` |
"""
[[commands.field]]
id = "files"
label = "Files or directories"
type = "path"
position = 0
multiple = true
min = 1
path = { kind = "any", role = "input", must_exist = true }
effect = "delete"
sources = ["readme"]
[[commands.field]]
id = "recursive"
label = "Recursive"
description = "Required for directories with contents."
type = "boolean"
option = ["--recursive", "-r"]
sources = ["readme"]
[[commands.field]]
id = "directory"
label = "Empty directories"
type = "boolean"
option = ["-d"]
sources = ["readme"]
[[commands.field]]
id = "interactive"
label = "Confirm each"
type = "boolean"
option = ["--interactive", "-i"]
sources = ["readme"]
[[commands.field]]
id = "force"
label = "Force"
description = "Ignore nonexistent files and never prompt."
type = "boolean"
option = ["--force", "-f"]
sources = ["readme"]
[[commands.field]]
id = "verbose"
label = "Verbose"
type = "boolean"
option = ["--verbose", "-v"]
sources = ["readme"]
[[commands.task]]
id = "trash-files"
label = "Trash files"
fields = ["files", "interactive", "verbose"]
required = ["files"]
[[commands.task]]
id = "trash-dir"
label = "Trash a directory"
set = { recursive = [true] }
lock = ["recursive"]
fields = ["files", "recursive", "interactive", "verbose"]
required = ["files"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["files", "recursive", "directory", "interactive"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["force", "verbose"]