jiangzhenguo/dsh-codegraph
Project Overview项目介绍
This is a native DSH bundle plugin that wraps the independent CodeGraph CLI tool, exposing its pre-indexed code knowledge graph functionality as LLM-callable tools inside DSH sessions. Users can install the plugin directly via DSH's built-in plugin manager by running the command dsh plugin --profile web add github:jiangzhenguo/dsh-codegraph, which automatically registers the plugin and requires no manual configuration edits. Before installation, users must first install DSH itself and install the @colbymchenry/codegraph CLI globally via npm, and confirm that the codegraph executable, version 1.0 or higher, is available in the system PATH.
By default, the plugin only registers 4 core tools: codegraph_status, codegraph_init, codegraph_sync, and codegraph_explore, which keeps the model's tool list clean and focused, aligned with upstream testing that shows codegraph_explore is the most reliably called tool. The plugin injects a high-priority instruction into DSH's system prompt, placed before all built-in file tools, which tells the model it must use codegraph tools instead of grep or read for code search. It also implements a prompt trigger system that automatically injects relevant pre-explored codegraph context into the conversation when the user's prompt matches code query keywords or symbols.
Users can configure the plugin via the DSH profile's combination layer to turn off system prompt injection, switch to full tool surface that exposes all 13 codegraph tools, or turn off the automatic context frontload feature. The repository includes a full test harness that runs end-to-end tests of all plugin functionality, all supported configuration combinations, from tool registration to frontload triggering, to ensure expected behavior before deployment. The plugin is released under the open-source permissive MIT license, and users can modify or redistribute it per the license terms.
这是一款专为 DeepSeek Harness (DSH) 开发的原生插件,用于将 @colbymchenry/codegraph CLI 的预索引代码图谱能力包装为大模型可直接调用的原生工具。默认只注册 4 个核心工具来保持工具列表精简,提升模型调用聚焦度,可通过配置开启全量模式开放全部 13 个工具。
本插件会在 DSH 的系统提示词中注入高优先级(order 98,在内置文件工具之前)指引,让模型优先使用 codegraph 工具搜索代码而非原生的 grep、glob 和读取文件。它还支持基于用户提问的结构化上下文前置注入,匹配代码查询类提问时自动预加载相关代码图谱结果到会话上下文。
使用本插件需要预先安装好 DSH 和全局可访问的 codegraph CLI 工具,可通过 DSH 内置的插件管理命令一键安装到指定 profile,无需手动修改配置文件。本插件使用 MIT 许可证开源,支持对指引、工具集、上下文注入等功能进行自定义配置。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-codegraph(jiangzhenguo/dsh-codegraph)
仓库:https://github.com/jiangzhenguo/dsh-codegraph
本站详情页:https://www.yhbd.top/plugins/jiangzhenguo-dsh-codegraph/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 12 · 最近提交 2026-09-30 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- 12 stars - an early-stage project星标 12,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add github:jiangzhenguo/dsh-codegraph
把 jiangzhenguo/dsh-codegraph 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-codegraph
让 DSH 会话直接使用 CodeGraph
(@colbymchenry/codegraph)的预索引代码知识图谱能力。
这是一个可一键安装的 DSH 插件(bundle):它把 codegraph CLI 包装成
模型可见的原生工具,模型在分析代码时无需 grep/读大量文件,直接按符号、
按区域、按调用链查询索引,并能自举并维护索引(init/index/sync)。
工具面(surface):借鉴上游项目「
codegraph_explore是唯一稳定赢得模型调用的工具」 的实测结论(其官方 MCP server 默认只暴露 explore),本插件默认只注册 4 个核心工具 (codegraph_status/codegraph_init/codegraph_sync/codegraph_explore), 保持模型工具列表精简、引导集中。需要全部 13 个工具时,在组合层配置surface: 'full'(见下文「配置」)。
提供的工具
| 工具 | 对应 CLI | 用途 |
|---|---|---|
codegraph_status |
status --json |
索引状态(是否已初始化、版本、文件/节点/边数、待同步变更、建议重建等) |
codegraph_init |
init |
初始化项目并建立初始索引(.codegraph/) |
codegraph_index |
index |
全量(重)索引;status 建议 reindex 时用 |
codegraph_sync |
sync |
增量同步索引(改代码后调用,让查询反映新代码) |
codegraph_uninit |
uninit -f |
删除项目索引 |
codegraph_query |
query --json |
按名称/子串搜索符号,返回结构化 JSON |
codegraph_node |
node |
单个符号源码 + 调用/被调用轨迹,或带行号读文件 + 依赖 |
codegraph_explore |
explore |
自然语言探索一块代码区域,直接返回相关文件源码与调用路径 |
codegraph_files |
files --json |
索引内的项目文件结构 |
codegraph_callers |
callers --json |
谁调用了某个符号 |
codegraph_callees |
callees --json |
某个符号调用了什么 |
codegraph_impact |
impact --json |
改动某个符号会波及哪些代码(重构/改名前用) |
codegraph_affected |
affected --json |
改动若干源文件后应运行哪些测试文件 |
工具名与 CodeGraph 官方 MCP 工具同名,模型的使用心智与官方文档一致。
前置要求
已安装 DSH(本插件为 DSH bundle,随 DSH web 应用装载)。
支持的 DSH 版本:
0.1.x与0.2.x(含0.2.0),两条线共用同一份代码。 插件使用的接口在本插件所覆盖的范围内跨版本稳定:defineTool(name/description/parameters/output/execute/presentCall/timeoutMs)、tools.register()、systemPrompt.section()、createUserMessage、ctx.get('subprocess' | 'shell'), 以及agent/inbox/inserted事件 +agent.steer()。⚠️ 安装门槛在
peerDependencies上,不在代码里。 DSH 0.2.0 起会在安装前校验本包peerDependencies中每个@deepseek-ai/dsh*范围:若当前 DSH 版本不满足semver.satisfies(v, range, { includePrerelease: true }),dsh plugin add会直接拒绝安装 (报incompatible-version)。因此本插件的上限是<0.3.0-0而非<0.2.0-0—— 后者会把所有0.2.x预发布版一并排除。若从1.1.0及更早版本升级,请一并更新插件。
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
CocoSgt/dsh-attachments
tower1229/dsh-thinkbar