Skip to content

bwrb delete

Delete notes from your vault with safety checks and bulk mode support.

Terminal window
bwrb delete [options] [query]

Delete operates in two modes:

  • Single-file mode (default): Delete a specific note by name/query
  • Bulk mode: Delete multiple notes matching targeting selectors
OptionDescription
-t, --type <type>Filter by type
-p, --path <glob>Filter by path glob
-w, --where <expr>Filter by frontmatter expression (repeatable)
-b, --body <query>Filter by body content search
-a, --allSelect all notes (required for bulk delete without other targeting)
OptionDescription
-x, --executeActually delete files (default is dry-run for bulk)
-f, --forceSkip confirmation prompt (single-file mode)
--picker <mode>Selection mode: auto, fzf, numbered, none
-o, --output <format>Output format: text, json

Bulk delete requires two explicit gates to prevent accidents:

  1. Targeting gate: Must specify at least one selector (--type, --path, --where, --body) OR use --all
  2. Execution gate: Must use --execute to actually delete (dry-run by default)
Terminal window
# Error: no targeting specified
bwrb delete
# "No files selected. Use --type, --path, --where, --body, or --all."
# Dry-run: shows what would be deleted
bwrb delete --type task
# Actually deletes
bwrb delete --type task --execute
Terminal window
# Delete specific note with confirmation
bwrb delete "My Note"
# Skip confirmation
bwrb delete "My Note" --force
# Scripting mode
bwrb delete "My Note" -o json --force
Terminal window
# Preview deletions (dry-run)
bwrb delete --type task
# Actually delete all tasks
bwrb delete --type task --execute
# Delete all notes in Archive
bwrb delete --path "Archive/**" -x
# Delete by content
bwrb delete --body "DELETE ME" --execute
# Delete with frontmatter filter
bwrb delete --where "status=archived" --execute
# Delete ALL notes (dangerous!)
bwrb delete --all --execute

When query is ambiguous (single-file mode):

ModeBehavior
autoUse fzf if available, else numbered select (default)
fzfForce fzf (error if unavailable)
numberedForce numbered select
noneError on ambiguity (for non-interactive use)

Deletion is permanent. Use version control (git) to recover deleted notes if needed.