Search for notes by name or content, with interactive selection and multiple output formats.
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
| Option | Description |
|---|
-o, --output <format> | Output format: text, paths, link, content, json |
--preview | Show file preview in fzf picker |
--picker <mode> | Selection mode: auto, fzf, numbered, none |
| Option | Description |
|---|
--open | Open the selected note after search |
--edit | Edit 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 |
| Option | Description |
|---|
-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, --body | Enable content search mode |
| Option | Description |
|---|
-C, --context <lines> | Lines of context around matches (default: 2) |
--no-context | Do not show context lines |
-S, --case-sensitive | Case-sensitive search (default: case-insensitive) |
-E, --regex | Treat pattern as regex (default: literal) |
-l, --limit <count> | Maximum files to return (default: 100) |
| Format | Description |
|---|
text | Note name (default) |
paths | Vault-relative path with extension |
link | Wikilink format ([[Note Name]]) |
content | Full file contents (frontmatter + body) |
json | JSON with metadata and matches |
bwrb search "My Note" --output link
# 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
bwrb search "My Note" --edit --json '{"status":"done"}'
# Search all notes for "deploy"
bwrb search "deploy" --body
bwrb search "deploy" -b -t task
bwrb search "TODO" -b --where "status != 'done'"
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
# Open results in VS Code
bwrb search "bug" --output paths | xargs -I {} code {}
| Mode | Behavior |
|---|
auto | Use fzf if available, else numbered select (default) |
fzf | Force fzf (error if unavailable) |
numbered | Force numbered select |
none | Error on ambiguity (for non-interactive use) |
Uses shortest unambiguous form:
- Unique basename:
[[My Note]]
- Ambiguous (multiple notes with same name):
[[Ideas/My Note]]
--app flag (explicit)
BWRB_DEFAULT_APP environment variable
config.open_with in .bwrb/schema.json
- Fallback:
system