介绍
# qmd — Fast Local Markdown Search
## 适用场景
- **查找文件** — 在大型目录中作为 `find` 的替代方案(避免卡顿) - **搜索笔记/文档** — 在已建立的索引集合中进行语义或关键词搜索 - **代码发现** — 查找实现、配置或模式 - **上下文收集** — 在回答问题之前提取相关代码片段
## 快速参考
### 搜索(最常用)
```bash # Keyword search (BM25) qmd search "alpaca API" -c projects
# Semantic search (understands meaning) qmd vsearch "how to implement stop loss"
# Combined search with reranking (best quality) qmd query "trading rules for breakouts"
# File paths only (fast discovery) qmd search "config" --files -c kell
# Full document content qmd search "pattern detection" --full --line-numbers ```
### 集合
```bash # List collections qmd collection list
# Add new collection qmd collection add /path/to/folder --name myproject --mask "*.md,*.py"
# Re-index after changes qmd update ```
### 获取文件
```bash # Get full file qmd get myproject/README.md
# Get specific lines qmd get myproject/config.py:50 -l 30
# Get multiple files by glob qmd multi-get "*.yaml" -l 50 --max-bytes 10240 ```
### 输出格式
- `--files` — 路径 + 分数(用于文件发现) - `--json` — 带有代码片段的结构化数据 - `--md` — Markdown 格式 - `-n 10` — 限制结果数量
## 提示
1. **始终使用集合** (`-c name`) 来限定搜索范围 2. **添加新文件后运行 `qmd update`** 3. **使用 `qmd embed`** 启用向量搜索(只需一次,耗时几分钟) 4. 对于大型目录,**优先使用 `qmd search --files`** 而非 `find`
## 模型(自动下载)
- Embedding: embeddinggemma-300M - Reranking: qwen3-reranker-0.6b - Generation: Qwen3-0.6B
所有模型均在本地运行 — 无需 API 密钥。