zijun-T/dsh-sidebar-remote0

dsh-sidebar-remote

DSH Web 聚合插件:自动集成 dsh-better-sidebar 与 @dsh-ssh/dsh-ssh,使 SSH 远程工作区的文件、预览、传输、终端和 Git 运行在远程主机

AI 分析

核心用途是无缝融合侧边栏与 SSH 功能,让远程会话的文件管理、终端和 Git 操作直接在远端服务器执行。适合经常需要远程开发和运维的用户。

包名
dsh-sidebar-remote
版本
0.2.0
许可证
MIT
最近更新
2026年9月6日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:zijun-T/dsh-sidebar-remote

dsh-sidebar-remote

单一可安装的 DSH Web 聚合插件——自动集成 dsh-better-sidebar + @dsh-ssh/dsh-ssh,使 SSH 远程工作区的文件、预览、传输、终端和 Git 真正运行在远端,本地工作区保持原侧边栏行为不变。

无额外 UI、无独立入口。装好即忘:侧边栏自动区分本地与远程会话。

安装

# 本地路径
dsh plugin --profile web add /path/to/remote-sidebar-plugin

# tarball(推荐换机部署)
npm pack
dsh plugin --profile web add ./dsh-sidebar-remote-0.2.0.tgz

# 发布后(npm)
dsh plugin --profile web add dsh-sidebar-remote

单次安装即可。cordis.patch.yml 会自动挂载聚合插件,上游两个插件通常已随 profile 安装。

移除:dsh plugin --profile web remove dsh-sidebar-remote

远程语义

功能远端实现
文件树 / 浏览SFTP readdir + stat 探测
读取 / 编辑 / 保存Sftp.readTextapplyLiteralEditwriteFileAtomic
上传 / 下载Sftp.createWriteStream / createReadStream,失败清理
预览`/sidebar/remote/html//
` + 相对资源同路由
终端SshConn.shell PTY,30s 重连优雅期
Gitgit -C --no-pager -c color.ui=falseSshConn.exec

本地会话零回归:不建立 SSH 连接,沿用原 dsh-better-sidebar 行为。

换机部署

不需要重新构建。客户端在挂载时向 GET /sidebar/remote/root 取回权威占位根,一份 bundle 可服务任意部署。

迁移 ~/.dsh/settings.yaml 即可带走主机配置与侧边栏偏好;私钥 / known_hosts 不自动迁移,新设备上手动复制 ~/.ssh/* 或走 TOFU 对话重建。

验证

npm install
npm run typecheck
npm test             # 102 tests / 14 suites,无需网络与远端主机
npm run build
npm pack --dry-run

真机端到端:

DSH_ORIGIN=http://127.0.0.1:3080 \
DSH_HOST_ID= \
DSH_REMOTE_PATH=/path/on/remote \
DSH_EXPECT_ENTRY= \
  npm run verify:live    # 14 项断言

依赖

组件版本
DSH0.1.1-rc.2(Cordis ^4.0.1
dsh-better-sidebar0.17.1
@dsh-ssh/dsh-ssh0.1.3
Node>=22

详细架构设计与接口差距分析见 docs/