CrazyShout/dsh-ssh-remote ↗★ 0
dsh-ssh-remote
DeepSeek Harness SSH remote workspaces: browse, read/write, run commands and open terminals on remote hosts, with connection status dots in the sidebar.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:CrazyShout/dsh-ssh-remote说明文档
阅读完整 README ↗dsh-ssh-remote
English | 中文
DeepSeek Harness 的 SSH 远程工作区插件:让 agent 通过 SSH 连接远程主机,浏览/读写远程文件、执行远程命令、打开远程终端,并在侧边栏用颜色圆点显示连接状态——对标 Codex Remote。
状态:v0.1 提供完整的 host 侧(
ssh_remote工具 +ctx.sshRemote服务)。侧边栏 UI 与「透明文件系统路由」(read/write/edit自动命中远程)是已标注的后续里程碑。
特性
- SSH 连接管理:
ssh2连接池(每 host 一个)、keepalive、断线指数退避自动重连、连接状态机。 - 远程文件操作:SFTP 实现
FileSystem12 原语(读/写/编辑/列目录/stat),错误码对齐 DSH 的FS_*规范。 - 远程命令:
ssh_remote exec在远程主机执行 shell 命令。 - 复用
~/.ssh/config:具体 Host 别名(HostName/User/Port/IdentityFile)自动解析;忽略Host *通配。 - 连接状态圆点:绿=已连接、黄=连接中/重连中、红=断线/错误。
- 多主机并列:workspace 记录持久化到
$DSH_HOME/ssh-remote-workspaces.json。
安装
要求:Node 22+、pnpm、DSH 0.1.0-rc.x。
# 方式一:npm(若已发布)
dsh plugin --profile web add dsh-ssh-remote
# 方式二:GitHub(无需发布)
dsh plugin --profile web add 'github:CrazyShout/dsh-ssh-remote'
重启 dsh web 后生效。
使用
agent 通过 ssh_remote 工具操作远程主机:
ssh_remote { action: "add", uri: "ssh://user@gpu-server:22/home/user/exp" }
ssh_remote { action: "connect", id: "" }
ssh_remote { action: "exec", id: "", command: "nvidia-smi" }
ssh_remote { action: "read", id: "", path: "train.py" }
ssh_remote { action: "write", id: "", path: "notes.txt", content: "..." }
ssh_remote { action: "list" }
path 支持远程绝对路径(/home/user/exp/a.py)或相对 workspace 根(a.py)。
认证
- 优先本机 ssh-agent(
SSH_AUTH_SOCK)。 ~/.ssh/config里的IdentityFile会读取对应私钥。- 目标机需开启
sftp子系统(Subsystem sftp internal-sftp)。
后续里程碑
- P1 透明文件系统路由:远程 workspace 的会话里
read/write/edit/bash自动命中远程(借助 scope 挂 / )。