dsh-ssh

by onlca

工具与能力github收录于 08-23

DeepSeek Harness 插件:把远程主机的目录设为 远程工作区 , read / write / edit / glob / grep / bash 全部直达目标主机,与本地目录体验一致。

DeepSeek Harness plugin: set a remote host directory as a remote workspace — read / write / edit / glob / grep / bash all go straight to the target host, just like a local directory.

安装

dsh plugin --profile web add github:onlca/dsh-ssh

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗

安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。

README

目录

DeepSeek Harness 插件:把远程主机的目录设为远程工作区,read/write/edit/glob/grep/bash 全部直达目标主机,与本地目录体验一致。

特性

  • 零目标主机安装:目标主机唯一前提是 sshd 在运行,无需安装任何 agent,首次访问只读探测;
  • 零认证代码:原生读取 ~/.ssh/config(Host 别名、IdentityFile、ProxyJump)与 SSH agent,支持自定义 ssh 命令;
  • 官方 seam:实现 Harness 预留的 ctx.fs / ctx.shell 后端接口并按工作区自动分流,工具层零改动;
  • 可靠终止:超时/中止会终止远端进程组,不留孤儿进程;
  • 名称区分:远程工作区自动命名 SSH · user@host:path,侧栏带地球图标。

安装

npx @onlca/dsh-ssh install

一行完成:插件装进 ~/.dsh/profiles/* 并写入补丁层(替换本机 fs/shell 为路由层), 同时自动修补本机 DSH 前端的按钮/wire 协议(幂等)。重启 dsh 生效。卸载:

npx @onlca/dsh-ssh uninstall

使用

  1. 侧栏点 "添加远程工作区"(地球图标,位于"添加工作区"右侧);
  2. 弹窗输入 SSH 命令与远端路径,如 ssh user@host + /home/user/project;
  3. 进入会话后所有工具直达远端,工具输出路径显示为 ssh://user@host/...。

glob/grep 需要目标主机装有 ripgrep(apt install ripgrep / apk add ripgrep);其余工具仅需 sshd。

实现说明

  • 传输层为 OpenSSH CLI 通道(ControlMaster 复用),文件操作为 POSIX/busybox 兼容的 远端协议脚本(原子写、版本守卫编辑),用户可控数据只经 stdin/stdout,无注入面;
  • Web UI 按钮与 workspace.createRemote wire 通过直接修补已安装 DSH 的 5 个 bundle 实现(见 patches/webui/),由安装器幂等应用——DSH 升级后重跑安装器即可。

开发

npm install --cache .npm-cache   # 本地缓存,规避全局 npm 缓存权限问题
npm run build                     # 构建全部内部包与可发布单包
npm run test:unit                 # 纯单元测试
npm run test:integration          # Docker Alpine/Debian 双方言集成测试(需 docker)
npm run e2e                       # headless 端到端(需 docker)

结构:packages/{transport,fs-remote,exec-ssh,routing,workspace} 为内部私有包, packages/dsh-ssh 为发布单包(esbuild 全量内联,零外部 @deepseek-ai/* 依赖); 发布流程见 docs/publishing.md。

许可

MIT,见 LICENSE。

原始 README: https://github.com/onlca/dsh-ssh/blob/main/README.md ↗