Skip to content

bwrb search

Search for notes by name or content, with interactive selection and multiple output formats.

Terminal window
bwrb search [options] [query]

Search operates in two modes:

  • Name search (default): Searches by note name, basename, or path
  • Content search (--body): Full-text search across note contents using ripgrep
OptionDescription
-o, --output <format>Output format: text, paths, link, content, json
--previewShow file preview in fzf picker
--picker <mode>Selection mode: auto, fzf, numbered, none
OptionDescription
--openOpen the selected note after search
--editEdit the selected note’s frontmatter after search
--json <patch>JSON patch data for --edit mode (non-interactive)
--app <mode>How to open: system, editor, visual, obsidian, print
OptionDescription
-t, --type <type>Restrict search to a type
-p, --path <pattern>Filter by file path glob pattern
-w, --where <expr>Filter results by frontmatter expression (repeatable)
-b, --bodyEnable content search mode
OptionDescription
-C, --context <lines>Lines of context around matches (default: 2)
--no-contextDo not show context lines
-S, --case-sensitiveCase-sensitive search (default: case-insensitive)
-E, --regexTreat pattern as regex (default: literal)
-l, --limit <count>Maximum files to return (default: 100)
FormatDescription
textNote name (default)
pathsVault-relative path with extension
linkWikilink format ([[Note Name]])
contentFull file contents (frontmatter + body)
jsonJSON with metadata and matches
Terminal window
# Find by name
bwrb search "My Note"
# Output as wikilink
bwrb search "My Note" --output link
# Output: [[My Note]]
# Find and open in Obsidian
bwrb search "My Note" --open
# Find and open in $EDITOR
bwrb search "My Note" --open --app editor
# Find and edit frontmatter
bwrb search "My Note" --edit
# Non-interactive edit
bwrb search "My Note" --edit --json '{"status":"done"}'
Terminal window
# Search all notes for "deploy"
bwrb search "deploy" --body
# Search only in tasks
bwrb search "deploy" -b -t task
# Filter by frontmatter
bwrb search "TODO" -b --where "status != 'done'"
# Regex search
bwrb search "error.*log" -b --regex
# JSON output with matches
bwrb search "deploy" -b --output json
# Search and open first match
bwrb search "deploy" -b --open
Terminal window
# Open results in VS Code
bwrb search "bug" --output paths | xargs -I {} code {}
ModeBehavior
autoUse fzf if available, else numbered select (default)
fzfForce fzf (error if unavailable)
numberedForce numbered select
noneError on ambiguity (for non-interactive use)

Uses shortest unambiguous form:

  • Unique basename: [[My Note]]
  • Ambiguous (multiple notes with same name): [[Ideas/My Note]]
  1. --app flag (explicit)
  2. BWRB_DEFAULT_APP environment variable
  3. config.open_with in .bwrb/schema.json
  4. Fallback: system