| name | blz-docs-search |
| description | Teaches effective documentation search using the blz CLI tool. Use when searching documentation with blz, looking up APIs, finding code examples, retrieving citations, or when questions mention libraries, frameworks, "how to", or documentation topics. Covers BM25 full-text search patterns, citation retrieval, and efficient querying. |
BLZ Search Patterns
Fast local documentation search using blz. Search is local, free, and fast (~6ms) - try many queries.
Key Concepts
Full-text search, not semantic: blz uses BM25 ranking. Query with keywords that appear in docs:
- Good:
"useEffect cleanup", "test configuration", "HTTP server"
- Bad:
"How do I use useEffect?", "What's the best way to..."
Citations: Results include citations like bun:304-324 (source:start-end lines). Use these with blz find to retrieve content.
Quick Patterns
blz list --status --json
blz "test runner" --json
blz "hooks" --source react --json
blz find bun:304-324 --json
blz find bun:304-324 --context all --json
blz find bun:304-324 -C 5 --json
blz find bun:304-324 deno:500-520 --json
Search Strategy
- Start specific: Use precise technical terms
- Try variations: Synonyms, abbreviations, alternate terms
- Check sources: Verify relevant docs are indexed
- Multiple searches: Run 3-5 different queries - it's fast
- Narrow by source: Use
--source when you know the library
Retrieval Options
| Flag | Use When |
|---|
--json | Always (structured output) |
--context all | Need full section |
-C N | Need N lines before/after |
-A N / -B N | Asymmetric context |
--max-lines N | Limit large sections |
Common Pitfalls
- Semantic queries: "Compare X vs Y" won't work. Search
"X" and "Y" separately.
- Too broad: "authentication" returns too much. Try
"JWT auth", "OAuth flow".
- Missing sources: Check
blz list first. Add sources with blz add.
- One search only: Try multiple query variations.
MCP Alternative
For structured operations, MCP tools are also available:
mcp__blz__blz_find({ query: "test runner" })
mcp__blz__blz_find({ snippets: ["bun:304-324"] })
mcp__blz__blz_list_sources()
mcp__blz__blz_add_source({ alias: "react", url: "https://react.dev/llms.txt" })
mcp__blz__blz_learn({})