dsh-ssh:DeepSeek Harness 的 SSH 远程执行插件

前言

DSH 把工具能力拆成插件。做智能体开发时,如果本地 harness 需要操作另一台机器上的 shell、文件、终端和 LSP,常见做法是把命令逐条转发到远端执行。dsh-ssh 是 UynajGI 维护的 DeepSeek Harness SSH remote-execution plugin,用一条 SSH 连接把 Bash、文件工具、PTY 终端和 LSP 放到远端主机执行。

这是什么

dsh-ssh 是 DSH 的 SSH 远程执行插件。它基于 ssh2,为 ctx.subprocessctx.fs 提供远程 provider,让本地 DSH 保留进程,命令执行、文件访问和 PTY 落到远端。它支持 multi-hop ProxyJump chains、SFTP upload/download,以及 full auth coverage。

核心功能

下面列出的能力来自已核实的插件描述:

  • SSH remote-execution plugin for DeepSeek Harness
  • Moves Bash, file tools, PTY terminals, and LSP onto a remote host over a single SSH connection
  • Multi-hop ProxyJump chains
  • SFTP upload/download
  • Full auth coverage
  • Built on ssh2
  • Remote providers for ctx.subprocess and ctx.fs
  • Web Add-workspace flow with connection sidebar and directory browser
  • ~/.ssh/config host alias resolution and registration
  • Local native folder picker via local.pickNative
  • Connection management and remote directory browsing over the /dsh-ssh RPC channel

安装与启用

安装命令:

npm i dsh-ssh

启用时,可以先在 cordis.yml 里挂载聚合行。hostusernamecwd 是必填项;cwd 必须是 absolute POSIX path。

- id: ssh-remote
  name: dsh-ssh
  config:
    host: server.example.com
    port: 22
    username: root
    privateKey: ~/.ssh/id_ed25519
    cwd: /root/workspace

如果目标需要经过跳板机,可以加 jump 数组。数组的第一跳来自本地,最后一跳指向目标主机。

    jump:
      - host: bastion.example.com

如果部署中需要单独组合 provider,也可以分别挂载 subpath rows:

- id: ssh
  name: dsh-ssh/ssh

- id: subprocess-ssh
  name: dsh-ssh/subprocess

- id: fs-ssh
  name: dsh-ssh/fs

strictHostKeyCheckingtrue 时,需要配置 knownHosts

Web Add-workspace 用法

Web 端启用 dsh-ssh 的 Add-workspace 流程时,需要先禁用动态目录 picker 行,再插入 SSH backend。这里的 name 用作匹配条件,所以按 id 禁用更合适。

- id: directory-picker
  name: '@deepseek-ai/dsh-host-directory-picker-auto'
  disabled: true

- insert:
    - id: ssh-remote
      name: dsh-ssh
      config: { ...same config as the quick start... }

    - id: directory-picker-ssh
      name: dsh-ssh/picker

    - id: ssh-web-channel
      name: dsh-ssh/web

选择远端目录时,先调用 session.route 获取一个本地 placeholder cwd,再创建 session。

const { cwd } = await rpc('session.route', { id: connectionId, path: remotePath })
ctx.sessions.create({ cwd })

适用场景与注意

适合本地 DSH 需要驱动远端主机的 shell、文件工具、PTY 终端和 LSP 的情况。已核实资料明确说明,harness 不需要安装在远端。

使用前建议检查源码与 MIT 许可证。插件以当前 dsh 进程权限运行,安装前应确认本地进程可访问的凭据、文件和权限是否符合预期。

另外,remote sessions 不会进入 DSH local workspace registry。抓取到的 README 与 package.json 末尾均被截断,后续 scripts 和完整 limitations 没有完整显示,因此不要依赖未显示的限制说明做完整安全判断。

链接

  • GitHub: https://github.com/UynajGI/dsh-ssh
  • 目录页(插件线索给出的独立目录站点): https://www.skillhub.cn/plugins/UynajGI/dsh-ssh
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜