dsearch

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

dsearch

dsearch

dsearch
is a CLI tool for searching and reading offline documentation (via DevDocs).
dsearch
是一款用于搜索和阅读离线文档(基于DevDocs)的CLI工具。

Tools

工具

dsearch

dsearch

The primary command for interacting with documentation.
这是与文档交互的核心命令。

Examples

示例

List installed documentation
To see what documentation is available:
bash
dsearch list
Search for a specific term
To search for a term across all installed documentation:
bash
dsearch "query string"
Search within a specific documentation set
To narrow down the search to a specific language or library (e.g., Go):
bash
dsearch "http.Client" --doc go
Read documentation in Markdown format
For LLM consumption, always use
--format md
to get clean Markdown output, and include
--full
to ensure the entire page is retrieved without truncation:
bash
dsearch "http.Client" --doc go --format md --full
Install new documentation
If the required documentation is missing:
bash
dsearch install python
查看已安装的文档
查看当前可用的文档:
bash
dsearch list
搜索特定术语
在所有已安装的文档中搜索某个术语:
bash
dsearch "query string"
在特定文档集中搜索
将搜索范围缩小到特定语言或库(例如Go):
bash
dsearch "http.Client" --doc go
以Markdown格式阅读文档
为适配LLM使用,始终使用
--format md
参数获取整洁的Markdown输出,并添加
--full
参数确保获取完整页面内容,避免被截断:
bash
dsearch "http.Client" --doc go --format md --full
安装新文档
如果所需文档未安装:
bash
dsearch install python

Best Practices

最佳实践

  • Always use
    --format md
    when valid to get machine-readable output.
  • Use
    --full
    to retrieve the complete documentation page, preventing truncation of long articles.
  • Use
    --doc <name>
    to reduce noise when you know the context (e.g., searching for
    Map
    in
    go
    vs
    javascript
    ).
  • If a search returns too many results, try a more specific query or use the
    --limit
    flag.
  • 在适用时始终使用
    --format md
    参数,以获得机器可读的输出。
  • 使用
    --full
    参数获取完整的文档页面,避免长文章被截断。
  • 当你明确上下文时,使用
    --doc <名称>
    参数减少无关结果(例如,在
    go
    javascript
    中搜索
    Map
    的区别)。
  • 如果搜索结果过多,尝试使用更具体的查询或
    --limit
    参数限制结果数量。