PortWrench panel for DSH: view listening ports, identify owning processes, and close process trees on Windows. Requires the PortWrench app to be installed and running.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:OldQin-Family/PortWrench#path:/packages/dsh-portwrench
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
PortWrench(端口扳手)的 DSH 插件壳:在 DSH 设置 → 插件 里加一个「端口扳手」面板, 内嵌本机 PortWrench 完整 UI——查看监听端口、识别归属、关闭进程树。
它是什么、不是什么
- 这只是壳:它把 DSH 和本机 PortWrench 服务连起来。
- PortWrench 本体(
port_console.py,Python)不随本插件安装——需要你自己在 本机下载并运行(见下方三步)。 - 所有安全闸(杀前身份复核、保护线、审计、频率闸)都在 PortWrench 本体服务端, 本壳不引入任何新权限。
使用三步
- 从 PortWrench Releases 下载 zip,解压到任意目录;
- 双击
启动端口控制台.bat(Windows、Python 3.10+;默认http://127.0.0.1:3999/,被占自动顺延); - 回到 DSH 设置 → 插件 →「端口扳手」,面板会自动检测并嵌入 UI。
PortWrench 未运行时,面板显示引导页(不会白屏)。
端口发现(3999–4098 自动探测)
- 本体从
3999起绑定,被占则顺延(最多 100 个端口,末位4098)。 - 壳页打开时并发探测整个 3999–4098 区间的
/api/v1/health,自动选最低响应端口嵌入—— 本体顺延到 4000、4001 时面板不再误报「未运行」,无需手工改地址。 - 探测只打回环 health(无敏感面),单口 800ms 超时;区间内无实例才显示引导页。
- 不读取本地文件、不做 4099 以上端口扫描(与本体顺延范围严格一致)。
卸载
DSH 插件:设置 → 插件 →「端口扳手」→ 卸载;或命令行 dsh plugin remove dsh-portwrench。
PortWrench 本体:直接删掉解压出来的目录即可——它不写注册表、不做开机自启、不留后台服务,删目录就干净了。
平台
- PortWrench 本体目前仅支持 Windows(依赖
taskkill/Win32_Process/Get-NetTCPConnection)。非 Windows 平台面板会提示暂不支持。
出问题怎么办
| 现象 | 先查什么 |
|---|---|
| 面板一直显示「PortWrench 未运行」 | 壳已自动探测 3999–4098;仍失败说明区间内确无实例:①看本体启动窗口是否开着②看启动窗口打印的实际地址,用浏览器直接开一次验证(被占会顺延,地址可能不是 3999) |
| 面板白屏 | 打开 DSH 的开发者工具看 Console——多半是壳没注册上(模块 id 与包名不一致会报 loaded without registering) |
| 设置页找不到「端口扳手」 | 插件没启用,或 DSH 版本低于插件要求 |
| 点了关闭没反应 | 那是本体的护栏在拦(目标受保护 / 端口易主 / 触发频率闸),看返回里的 reason 字段 |
面板里能看到端口列表 = 链路通了。 面板里能点、能关,说明 iframe 嵌的确实是本机那个本体。
隐私与安全
- 只监听
127.0.0.1,绝不开放外网;不做开机自启、不写注册表、不改防火墙。 - 关闭动作全部落审计日志;
api_token.txt是程序化通道凭据,不随壳分发;多占用仍需本机授权和一次性user_grant_id。
来源
- 本体与设计:PortWrench(MIT)
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 37918
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37097
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
superdesigndev/treg★ 8650
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 5964
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
sixtysevenlf/dsh-blender-plugin★ 2216
Lets a DSH agent drive a local Blender over a direct TCP channel with 15 tools: viewport frames, custom-angle renders, Python execution, headless and job offload, transaction rollback, and a planning layer of 228 ops across 34 families.
helloHub1212/dsh-windows-mcp★ 2002
Bridges the CursorTouch/Windows-MCP desktop automation server into DSH through the official MCP client bridge, registering its screenshot, UI tree snapshot, mouse and keyboard input, clipboard, process and registry tools as mcp__windows__* tools for the model, and adds a windows_mcp_doctor diagnostic tool. Computer Use is off by default and is switched on from the plugin panel.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.