跳到正文

Luke-Yong/dsh-plugin-knowledge-graph

30最近提交 2026年8月14日

dsh-plugin-knowledge-graph DSH 插件

该插件从工作区根目录构建内存中的知识图谱,追踪文件、目录、导出符号及其关系。它提供单一工具 read_graph,支持查询目录结构、导出、导入、依赖者和符号导出者。图谱使用三种节点类型(dir、file、symbol)和四种边类型(CONTAINS、EXPORTS、IMPORTS、IMPORTS_SYMBOL)。

如何安装 dsh-plugin-knowledge-graph DSH 插件

dsh plugin --profile web add github:Luke-Yong/dsh-plugin-knowledge-graph

复制不会执行命令。安装 dsh-plugin-knowledge-graph DSH 插件前请核对仓库和版本。

dsh-plugin-knowledge-graph DSH 插件数据来源

dsh-plugin-knowledge-graph DSH 插件快照日期:2026年8月16日

discovered

dsh-plugin-knowledge-graph DSH 插件能做什么

  • 构建代码库的内存知识图谱,涵盖文件、目录和导出符号。
  • 支持查询:structure(目录树)、exports(文件导出)、imports_of(文件导入)、exporters_of(符号来源)、dependents(依赖该文件的文件)。
  • 可通过 root 参数自定义工作区根目录,默认使用 process.cwd()。
  • 无缝集成到 DSH,作为插件通过 ctx.tools 注册。

dsh-plugin-knowledge-graph DSH 插件适合哪些场景

  • 在不离开聊天界面时快速查看项目的目录结构。
  • 在代码审查或调试时找出哪个文件导出了某个符号。
  • 评估变更影响时识别所有依赖给定文件的其他文件。
  • 追踪导入链以理解大型代码库中的模块依赖关系。

dsh-plugin-knowledge-graph DSH 插件适合谁

  • 使用 DeepSeek Harness 并需要探索代码库结构和依赖的开发者。
  • 在大型项目中工作、需要理解文件关系的软件工程师。

dsh-plugin-knowledge-graph DSH 插件的限制

  • 项目处于早期阶段,执行行为和查询接口可能随时变化。
  • 需要安装 DSH 并配置 profile 才能安装该插件。
  • 默认根目录为 process.cwd(),如果不显式指定 root 参数,可能不适用于所有环境。

dsh-plugin-knowledge-graph DSH 插件的仓库 README 摘录

以下文字摘自 dsh-plugin-knowledge-graph DSH 插件的上游仓库 Luke-Yong/dsh-plugin-knowledge-graph 的 README,版权归原作者,仅作引用。

A [DeepSeek Harness (DSH)](https://github.com/deepseek-ai) plugin that exposes a `read_graph` tool backed by a codebase **knowledge graph**. The graph tracks every file, directory, exported symbol, and their relationships so an agent can answer structural and dependency questions faster than grepping or reading files. > **Status: infancy.** This project is in its infancy stage. Execution behavior, the query surface, and compatibility may change while the project is iterated on and tested by the open source community. > **Derived work.** This project is derived from the knowledge graph tool in [Luke-Yong/H](https://github.com/Luke-Yong/H), adapted to DeepSeek Harness's "everything is a plugin" model. ## What it does Given a workspace root, the plugin builds an in-memory graph and answers queries such as: - `structure` — print the full directory tree - `exports <file>` — list every symbol exported by a file - `imports_of <file>` — list symbols a file imports (with their source files) - `exporters_of <symbol>` — find which files export a symbol - `dependents <file>` — find which files import from a file ## Graph model The graph uses three node types and four edge types: | Node

阅读完整 README仓库许可: MIT

dsh-plugin-knowledge-graph DSH 插件常见问题

如何安装这个插件?

使用 DSH CLI:`dsh plugin --profile web add github:Luke-Yong/dsh-plugin-knowledge-graph`。你也可以固定到特定提交:`dsh plugin --profile web add github:Luke-Yong/dsh-plugin-knowledge-graph#<commit-sha>`。

read_graph 支持哪些查询?

该工具支持五种查询类型:structure(显示目录树)、exports <文件>、imports_of <文件>、exporters_of <符号>、dependents <文件>。每个查询的格式为 `<查询类型> <目标>`。

这个插件是否支持 JavaScript/TypeScript 以外的语言?

README 中没有明确说明语言支持范围。根据衍生项目,当前实现可能主要针对 JavaScript/TypeScript,但建议查看源代码或在你的代码库中测试以确认。

我可以自定义工作区根目录吗?

可以,read_graph 工具接受可选的 'root' 参数。如果省略,默认使用 DSH 进程的当前工作目录。

这个插件适合生产环境使用吗?

项目明确声明处于早期阶段。执行行为、查询接口和兼容性可能发生变化。建议固定到特定提交,并在依赖之前充分测试。