在 DSH Web 界面的工作区右侧菜单加一行「在 VSCode 中打开」,点一下就用本机 VS Code 打开该工作区目录,省去手动找路径。
- 语言
- JavaScript
- License
- MIT
- 分支
- main
安装
$ dsh plugin --profile web add github:omdsh-dev/dsh-open-in-vscode在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程
对话式安装
帮我安装 DeepSeek Harness 插件 omdsh-dev/dsh-open-in-vscode:先查看仓库 https://github.com/omdsh-dev/dsh-open-in-vscode.git 确认安全性,然后执行安装命令并验证插件加载成功。
把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。
一句话定位
在 DeepSeek Harness 的网页界面里,给侧边栏每个工作区的「…」菜单加一行「在 VSCode 中打开」。点一下就把这个工作区的目录用本机 VS Code 打开,不用再手动复制路径去终端敲命令。
核心能力
- 在工作区行的溢出菜单中插入一行编辑器入口,图标和悬停样式跟随界面主题
- 点击后直接启动编辑器打开该工作区目录,菜单会先自动关闭
- 菜单文案随界面语言切换:中文显示「在 VSCode 中打开」,英文显示「Open in VSCode」
- 支持把要启动的编辑器命令换成 VS Code 之外的任意编辑器,并可追加启动参数
- Windows 上使用默认命令时会自动查找常见的 VS Code 安装目录,不必事先配好 PATH
- 编辑器以独立进程启动,DSH 服务端重启或退出不会带走已打开的编辑器窗口
技术实现
- 语言: TypeScript(含 React TSX 客户端组件)
- 关键依赖: zod(校验传输数据)、@deepseek-ai/dsh-typert-protocol(前后端调用通道)、@deepseek-ai/dsh-client-ui-slots(界面插槽)、react
- 架构模式: 插件分为服务端与浏览器端两半。服务端注册一个受严格校验的远程调用端点
openInVscode/open,用 Node 子进程以分离模式启动编辑器;浏览器端把菜单行注册进宿主的sidebar.workspaces.row-menu插槽,点击时通过该端点把目录路径交给服务端。若宿主版本尚未提供该插槽,会启用一个基于 DOM 观察的兼容适配器,并在检测到原生插槽出现时自动撤下。 - 入口文件:
src/index.ts(服务端)、src/client/index.ts(浏览器端)
适用场景
适合日常在 DSH 网页界面里切换多个工作区、又频繁需要在编辑器中查看同一份代码的人。原来的做法是把工作区目录路径复制出来,再切到终端或文件管理器打开,这个插件把这一步压缩成菜单里的一次点击。前提是编辑器和 DSH 服务端跑在同一台机器上。
前置依赖与兼容性
| 依赖 | 最低版本 | 说明 |
|---|---|---|
| Node.js | ^22.19 或 >=24 | 服务端运行环境要求 |
| DSH | 清单声明 >=0.0.1,文档建议 0.1.0-rc.6 及以上 | 有原生工作区菜单插槽时走原生路径,rc.6 走兼容适配器 |
| 平台 | macOS / Windows / Linux | 服务端只用 Node 内置能力;Windows 对默认 code 命令有额外的安装目录探测 |
| 界面形态 | 仅 Web 界面 | 插件的客户端部分声明为 web 平台,命令行/终端界面下没有这个菜单 |
| VS Code 或其他编辑器 CLI | 无 | 需要一个能接收目录参数的可执行文件,默认是 code;macOS 需先安装 VS Code 的命令行工具 |
| 原生模块 | 无 | 不依赖任何需要编译的原生扩展 |
安装方式
dsh plugin --profile web add github:omdsh-dev/dsh-open-in-vscode
配置项
| 配置 | 类型 | 说明 | 默认值 |
|---|---|---|---|
| command | 字符串 | 用来打开目录的编辑器可执行文件,可换成任意编辑器命令 | code |
| args | 字符串数组 | 在目录路径之前额外传给编辑器的启动参数 | [] |
配置写在 DSH 的 cordis.yml 中并会经过校验。可执行文件找不到时会报错并给出修复提示。
常见问题
Q: 安装后菜单里没有出现「在 VSCode 中打开」怎么办?
A: 装完插件需要重启 Web 服务端并刷新页面,菜单行才会出现。文档明确要求用 kill -TERM 优雅退出后再启动,不要用 kill -9。
Q: 点击后没反应,怎么排查?
A: 失败信息只打印在浏览器控制台,界面上不会弹提示。打开浏览器开发者工具查看以 [dsh-open-in-vscode] 开头的报错,最常见的原因是编辑器命令不在 PATH 上。
Q: macOS 上提示找不到 code 命令怎么解决?
A: 需要先在 VS Code 里安装命令行工具(Shell Command: Install 'code' command in PATH),或者把插件的 command 改成其他能打开目录的编辑器命令。
Q: 可以用其他编辑器代替 VS Code 吗?
A: 可以,把 command 换成任意能接收目录参数的可执行文件即可,还能用 args 追加参数。注意只有默认的 code 命令在 Windows 上会自动探测安装目录,其他命令必须能在 PATH 中找到。
Q: 编辑器会在我的电脑上打开还是在服务器上打开?
A: 在运行 DSH 服务端的那台机器上打开。如果你通过浏览器远程访问别的机器上的 DSH,编辑器窗口会出现在那台服务器上,不会出现在你本地。
Q: 这个插件会读写我的文件或者被模型调用吗?
A: 不会。它只在你手动点击菜单时启动编辑器进程,自身不读写文件,也没有注册任何工具或技能,模型看不到也调用不了它。
Q: 关闭 DSH 服务后编辑器会跟着退出吗?
A: 不会。编辑器以分离进程方式启动,启动后与服务端脱离父子关系,服务端退出不影响已打开的编辑器窗口。
Q: 为什么某些工作区行没有这一菜单项?
A: 只有带真实目录路径的工作区才会渲染该菜单行;没有目录信息的行会被跳过。
上手难度
入门 — 装完重启服务刷新页面即可使用,默认配置针对 VS Code,只有换编辑器或 macOS 未装 code 命令时才需要动配置。
已知问题与限制
- 启动失败只在浏览器控制台输出错误日志,界面上没有可见提示,普通用户容易以为「点了没反应」(
src/client/row.tsx:71-73) - 编辑器在 DSH 服务端所在机器上启动,远程访问场景下无法在浏览器所在的本地机器打开目录(
src/runtime.ts:37) - 只接受绝对路径,相对路径会被直接拒绝并报错(
src/runtime.ts:86-88) - 没有目录路径的工作区行不会显示该菜单项(
src/client/row.tsx:65) - 面向旧版宿主的兼容适配器依靠观察 DOM、并通过「重命名 / 删除」两项菜单文案来识别工作区菜单,宿主界面文案或结构调整可能导致识别失败(
src/client/legacy-menu.tsx:60-63) - Windows 上的安装目录自动探测只对默认的
code命令生效,自定义命令仍需自行保证可被 PATH 解析(src/resolve.ts:53) - Windows 找不到 VS Code 时的错误提示里写死了旧版本号
0.1.5,与当前包版本不一致,排查时容易误判(src/runtime.ts:51) - 客户端只声明了 web 平台,非网页形态的界面下无此功能(
package.json:28-36)
Open a workspace directory in VS Code straight from the DeepSeek Harness web GUI: every real Workspace row in the sidebar gains an Open in VSCode row inside its … overflow menu.
What it does
- The client half uses the harness's
sidebar.workspaces.row-menuslot when available and falls back to a scoped compatibility adapter on the public DSH0.1.0-rc.6build. Both paths render the same locale-following menu row — 在 VSCode 中打开 under the Chinese locale, Open in VSCode under English. - The row's click closes the menu and calls the host over the strict Typert
Remote
openInVscode/open, passing the workspace directory. - The host half spawns the configured editor CLI on that directory
(
code <path>by default), detached, so the editor outlives the server.
Prerequisites
- VS Code, or an editor CLI on PATH. On Windows, the default
codecommand also discovers standard per-user and system VS Code installations. On macOS, install the VS Code shell command or set the plugincommandto any editor that opens a directory). - DSH
0.1.0-rc.6or newer. The plugin uses the native Workspace row-menu extension point where present and a compatibility adapter onrc.6.
Install
Add the plugin to your web profile (this runs pnpm inside the profile and reconciles the bundle layer):
dsh plugin --profile web add https://github.com/omdsh-dev/dsh-open-in-vscode/archive/refs/tags/v0.1.6.tar.gz
Restart the web server (kill -TERM <pid> and wait for exit — never
kill -9, it tears the session zstd log mid-frame), then refresh the page.
The host plugin mounts under dsh-open-in-vscode; the client bundle is
served at /plugins/dsh-open-in-vscode/client.js.
The versioned tarball replaces older pinned commits without running a git
prepare script. Confirm the installed version with:
dsh plugin --profile web list dsh-open-in-vscode --depth 0
Configuration
Deployment-varying choices are validated Config fields, changeable from
cordis.yml:
| Key | Default | Meaning |
|---|---|---|
command | code | Executable that opens a directory. The default also probes standard Windows VS Code install locations; other commands resolve through PATH. |
args | [] | Extra arguments passed before the directory path. |
A missing executable fails loud with a fix hint; relative paths are refused.
Capability boundary
| Action | Runs where | Requires approval |
|---|---|---|
| Open a workspace directory in the editor | Host (user gesture) | No — the user clicked the row |
| Anything else | — | The plugin has no tools, no settings namespace, and no model-facing surface |
The plugin adds no tools, no skills, and no settings; it only opens the directory the user already opened in DSH. It never reads or writes files itself.
Development
pnpm install
pnpm run check # typecheck + lint + test + build; commit lib/ (file: installs run without a build)
Layout: the wire contract lives in one module (src/contract.ts) shared by
the host manifest (src/typert.ts) and the client contribution
(src/client/remote.ts); the harness owns the slot declaration and the
Menu node-entry kind this plugin composes through.
License
MIT
收录徽章
[](https://deepseek-plugin.org/plugins/omdsh-dev/dsh-open-in-vscode)把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。