lettuce search

~2 min read

lettuce search

Full-text search across a vault, from the shell.

lettuce search <vault> <query…> [--limit N] [--semantic] [--hybrid]

The same FTS5/BM25 engine as the MCP search tool, accessed from the command line. The first positional argument is the vault directory; everything after it (up to flags) is the query.

Examples

Plain text:

lettuce search ~/Notes lettuce

Multiple words (matched together):

lettuce search ~/Notes shipping list

Phrase:

lettuce search ~/Notes '"shipping list"'

Either term:

lettuce search ~/Notes lettuce OR cabbage

Exclude a term:

lettuce search ~/Notes lettuce -mascot
lettuce search ~/Notes lettuce NOT mascot

Cap the result count (default 20):

lettuce search ~/Notes milestone --limit 5

Options

Flag Notes
--limit N Max results, default 20
--semantic Embedding-based semantic search instead of FTS5 keyword matching
--hybrid Combine keyword (FTS5/BM25) and semantic search

Query syntax

The query is parsed into a vetted FTS5 operator subset (a malformed query just returns no rows — it never becomes a syntax error):

Form Meaning
word matches the word
word word both words (AND)
"phrase" exact phrase
-word exclude the word
word NOT word exclude the following word
word OR word either word (uppercase OR)

There are no field/column filters (no field:value, --tag, --fm, or date filters). For tag-scoped or metadata queries, use the MCP notes_by_tag / list_notes tools or the in-app search.

Output

One result per match, in BM25 rank order (best first):

Projects/Lettuce.md  —  Lettuce
    …the lettuce project shipped v0.6…
Inbox/x.md  —  Untitled
    …lettuce-themed mascot…

Each result prints the note’s relative path and title, followed by an indented snippet (when one is available). No matches. is printed when nothing matches.