DeepSeek Harness plugin

dsh-command-vscode

DeepSeek Harness slash command: open the current workspace (or a given path) in Visual Studio Code

Jump to install

Source facts

Repository
foxi-ui/dsh-command-vscode
Latest update
Aug 19, 2026
Category
Tools & Capabilities
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/foxi-ui/dsh-command-vscode
Plugin: dsh-command-vscode
Author: foxi-ui

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

@foxi-ai/dsh-command-vscode

> DeepSeek Harness 插件:一条斜杠命令,用 VS Code 快速打开当前工作区。

/vscode 让 DeepSeek Harness 把当前会话的工作区目录(会话的 cwd)在 Visual Studio Code 中打开,也可以打开任意指定路径。

功能

  • /vscode —— 打开当前会话工作区
  • /vscode <path> —— 打开指定目录(空格安全,可加引号)
  • 自动探测 VS Code CLI:环境变量 → PATH → 常见安装路径
  • macOS 上回退到 open -a "Visual Studio Code"
  • 零运行时依赖:仅用 Node 内置 child_process.execFile,无 shell,自动透传中止信号
  • 跨平台:macOS / Windows / Linux

安装

> 前置:dsh plugin 通过 pnpm 工作,请先确保已安装 pnpm(corepack enable pnpmnpm i -g pnpm)。

从 npm 安装(推荐)

dsh plugin --profile web add @foxi-ai/dsh-command-vscode

本包声明了 dsh.bundledsh plugin 安装后会自动把它加入 dsh.profile.bundles 并激活。重启 dsh 后即可使用。

从 tarball 安装(无需 npm 账号)

在本包目录内打包,再安装:

npm pack                                            # 生成 foxi-ai-dsh-command-vscode-0.1.0.tgz
dsh plugin --profile web add ./foxi-ai-dsh-command-vscode-0.1.0.tgz

从 GitHub 安装

dsh plugin --profile web add github:you/dsh-command-vscode#<commit>

本插件是纯 JS(lib/index.js 直接提交,无构建步骤),git 安装开箱即用。若你改造后引入 TypeScript,需按官方文档配置 prepare 脚本,并在 profile 的 pnpm-workspace.yamlallowBuilds 授权。

本地开发安装(symlink + 热重载)

./install.sh

该脚本把本包软链接进 profile 的 node_modules,并把插件行写入 profile 的 cordis.patch.yml(受 HMR 监听,保存即热加载,无需重启)。

命令说明

/vscode

打开当前会话的工作区目录。

/vscode
  • 工作区目录取自该会话的 session.header.cwd(即启动 dsh 时所在的目录)。
  • 会话没有 cwd 时返回错误:

No workspace directory is associated with this session. Usage: /vscode [path]

/vscode <path>

打开指定目录。

/vscode /path/to/project
/vscode "/path/with spaces"
  • <path> 为相对或绝对路径,原样传给 VS Code CLI(不经 shell,所以空格安全)。
  • 若整体用成对引号 "…"'…' 包裹,会去掉外层引号。

参数

参数必填说明
path要打开的目录;省略时打开当前会话工作区

环境变量

变量说明
VSCODE_CLI自定义 VS Code 可执行文件路径,优先级最高。例如 export VSCODE_CLI=/path/to/code

CLI 探测顺序

1. $VSCODE_CLI(若设置) 2. codePATH) 3. macOS:/usr/local/bin/code/opt/homebrew/bin/code → VS Code.app 内置 CLI 4. Windows:code.cmdcode 5. Linux:/usr/local/bin/code/usr/bin/code 6. macOS 兜底:open -a "Visual Studio Code"(随后尝试 Insiders)

输出

情形输出
成功Opened <path> in VS Code
未找到 CLI / 打开失败Could not open VS Code: <原因>
请求被中止Opening VS Code was cancelled.

工作原理

插件把 /vscode 注册到 Harness 的命令注册表(ctx.commands)。命令处理器读取 invocation.agent.session.header.cwd 作为默认目录,再用无 shell 的 execFile 调用 VS Code CLI,并把 AbortSignal 透传给孩子进程。

目录结构

.
├── package.json        # 包元数据 + dsh.bundle 声明
├── cordis.patch.yml    # bundle patch:向 profile 插入插件行
├── lib/index.js        # 插件实现(name / inject / apply)
├── install.sh          # 本地开发安装(symlink + cordis.patch.yml)
├── test/smoke.mjs      # 冒烟测试
├── LICENSE             # MIT
└── README.md

发布到 npm

使用「细粒度令牌 + 绕过 2FA」发布(无需全局登录,token 不落盘):

1. 在 npmjs.com 生成 Granular Access Token,勾选 Bypass two-factor authentication (2FA),权限给 @foxi-ai/dsh-command-vscode 的 *Read and write*。 2. 把令牌写入本地 .env.local(该文件已被 .gitignore / .npmignore 忽略,切勿提交或公开):

``bash cp .env.example .env.local # 然后编辑 .env.local,填入 NPM_TOKEN=npm_xxx ``

3. 发布:

``bash ./publish.sh # 或 ./publish.sh --dry-run 预演 ``

发布前请确认:

  • package.jsonname@foxi-ai/dsh-command-vscode(作用域包,需 publishConfig.accesspublic,已配置);
  • repository 指向正确的源码仓库;
  • cordis.patch.yml 里的插件行 name 与包名一致。

发布后即可用 dsh plugin --profile web add @foxi-ai/dsh-command-vscode 安装。

开发与测试

node test/smoke.mjs

License

[MIT](./LICENSE)