Search and retrieve documents from locally indexed markdown knowledge bases.
bash
bun install -g https://github.com/tobi/qmd
bash
# Add a collection
qmd collection add ~/notes --name notes --mask "**/*.md"
# Generate embeddings (required for vsearch/query)
qmd embed
Always use --json flag for structured output when invoking qmd commands.
bash
qmd search "authentication flow" --json
qmd search "error handling" --json -n 10
qmd search "config" --json -c notes
bash
qmd vsearch "how does login work" --json
qmd vsearch "authentication best practices" --json -n 20
bash
qmd query "implementing user auth" --json
qmd query "deployment process" --json --min-score 0.5
OptionDescription-n NUMNumber of results (default: 5, or 20 with --json)-c, --collection NAMERestrict to specific collection--min-score NUMMinimum score threshold--fullReturn complete document content in results--allReturn all matches
bash
qmd get docs/guide.md --json
qmd get "#a1b2c3" --json
qmd get notes/meeting.md:50 -l 100 --json
bash
qmd multi-get "docs/*.md" --json
qmd multi-get "api.md, guide.md, #abc123" --json
qmd multi-get "notes/**/*.md" --json --max-bytes 20480
bash
qmd update # Re-index changed files
qmd status # Check index health
qmd collection list # List all collections
ModeSpeedQualityBest ForsearchFastGoodExact keywords, known termsvsearchMediumBetterConceptual queries, synonymsquerySlowBestComplex questions, uncertain terms
Performance note: vsearch and query have ~1 minute cold start latency for vector initialization. Prefer search for interactive use.
qmd can run as an MCP server for direct integration:
bash
qmd mcp
Exposes tools: qmd_search, qmd_vsearch, qmd_query, qmd_get, qmd_multi_get, qmd_status