面向 AI 生成代码的死代码检测:graphlint 构建依赖图,定位从任何入口不可达的代码,以实现代码库清理和功能有效性理解,并为 DSH 智能体提供 graphlint_query / graphlint_build / graphlint_config 工具与 graphlint 技能。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-graphlint
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:AngelosZou/graphlint#path:/integrations/dsh
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
DeepSeek Harness plugin bundle for graphlint — dead-code detection for AI-generated codebases.
Installing this bundle gives every agent in the profile three tools
(graphlint_query, graphlint_build, graphlint_config) plus a graphlint
skill describing when and how to use them.
Requirements
- Node.js >= 20.
- A DeepSeek Harness profile (
dsh plugininitializes one on first use). - The graphlint CLI on
PATH(pip install graphlint) or inside the project's virtualenv (env/,.venv/,venv/are probed automatically).
Install
Install the published bundle into a DeepSeek Harness profile:
dsh plugin --profile web add dsh-graphlint
# or via the graphlint CLI (requires dsh on PATH):
graphlint install dsh --profile web
Then restart the profile (and refresh the browser page). The bundle's patch
layer inserts the plugin row at the profile root; you can address it by id
dsh-graphlint in your own cordis.patch.yml (e.g. to disable it per profile).
Development / repository install (linking a local checkout):
# 1. Clone the repository and build the bundle
git clone https://github.com/AngelosZou/graphlint.git
cd graphlint/integrations/dsh
npm install
npm run build
# 2. Link the bundle into a profile (run from the repository root)
cd ..
dsh plugin --profile web add link:./integrations/dsh
# 3. Restart dsh web
Tools
| Tool | Purpose |
|---|---|
graphlint_query |
Query the dependency graph for dead code, circular refs, unused imports, and other warnings. Fast incremental mode; JSON result. Common filters: warn_types, graph_id, exclude_clean, include_tests, public_as_entry. |
graphlint_build |
Full or incremental index rebuild as a background job (poll with job_output). |
graphlint_config |
show / get / set entries in the project's .graphlint/config.json, plus add-entry-rule / remove-entry-rule / add-exclude / remove-exclude for custom entry rules and excludes. |
The graphlint skill leads with these tools (they run inside the session working
directory and return structured results); the canonical CLI guidance follows as
reference.
root_dir restriction
Every tool accepts an optional root_dir. It must stay inside the session
working directory (the default) — a hard guard rejects anything else with a
clear error. Scanning a high-level root (such as a user home directory) makes
graphlint build a huge first-time index and can block for many minutes.
Optional Secondary working directories (dsh-multi-folder)
When the dsh-multi-folder
plugin is installed and the user has configured secondary working directories
for the session, those directories automatically become valid root_dir
values for all three tools: the analysis root is accepted inside any configured
secondary directory, graphlint runs with that directory as its working
directory, and the index lands in its .graphlint/. A relative root_dir
still resolves against the primary session workspace.
This compatibility is automatic and optional. Each tool probes
ctx.get('multiFolder') at call time and nothing else changes:
- multi-folder absent, unconfigured, incompatible, or throwing → the plugin behaves exactly as if it did not exist (the guard falls back to the session working directory, and the refusal message keeps its original wording);
- multi-folder present → a refusal still names the configured secondary
directories and the
/multi-foldercommand that adds one, so the model learns the valid roots instead of retrying blindly.
Development
cd integrations/dsh
npm install # first time only; afterwards npm ci
npm run build # tsc → lib/
npm test # node --test lib/test/
The test suite covers the pure logic layers (root guard, argv construction,
JSON parsing), the optional multi-folder probe and its end-to-end tool wiring
(root resolution and spawned CLI cwd, with and without the peer plugin), plus
manifest/patch contract checks. A committed package-lock.json is required (CI
runs npm ci).
链接
同类插件
yjh051108/dsh-routing-suite★ 6995
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3667
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
hust-open-atom-club/oh-dsh★ 325
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
weijiafu14/pi2dsh★ 208
Pi Host ABI 兼容引擎:装一次之后,npm 上的 Pi 扩展原包经 `dsh plugin add <pi-package>` 直接作为 DSH 原生插件挂载。已在官方 DSH 上端到端验证 pi-mcp-adapter(完整 MCP 管理面:OAuth、resources、prompts、MCP Apps、elicitation、sampling)、@tintinweb/pi-subagents、pi-code、pi-hermes-memory、pi-background-tasks;`pi2dsh inspect` 在安装前报告一个包的兼容情况。
lire1131/dsh-undo-savepoint★ 167
DSH 撤销/回退系统:配置变更自动存档,一键撤销/恢复/回退到任意版本,支持 WebUI 与离线 CLI/GUI 工具(DSH 启动失败也能救)。
Fishquito7/dsh-skill-mcp-panel★ 158
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。