dsh-plugin
DayuanJiang/next-ai-draw-iodsh 的 draw.io 绘图插件:通过 next-ai-drawio MCP 服务器作图,点回复里的链接在右侧栏打开实时预览,可以手动修改图,AI 的每次修改都是可以恢复的版本。需 Node.js 18+,首次使用由 npx 下载 MCP 服务器。
SSH/SFTP 远程站点与远程工作区:像本地工作区一样管理远程连接与目录。
A plugin for DSH that brings SSH/SFTP remote workspaces into the workspace sidebar — alongside your local directories.
remote_site_* 管理连接,remote_workspace_* 在会话中直接读写远程文件。Site management (bottom-left panel)
realpath('.') to the server's real homeUnified add-workspace flow (left sidebar)
Native workspace/session grouping
$DSH_HOME/remote-workspaces/<id>/)workspaceRegistry, so remote workspaces appear and behave like local ones: click to start a session, session history stays groupedAGENTS.md is generated in the anchor: the agent learns the real remote endpoint/root and routes file operations through remote_workspace_* toolsAgent tools
remote_site_list / add / test / rename / update / remove / browseremote_workspace_list / add / browse / read / write / test / removeSecurity
sha256:<fingerprint>, later connections reject mismatches$DSH_HOME/storages/remote-workspaces.json with 0600 permissionsThe package declares a dsh.bundle manifest, so it is installable through
DSH's plugin command and by plugin storefronts such as
dsh-market.
Download dsh-external-dsh-remote-workspace-0.1.0.tgz from the
Releases page.
Extract and prepare it:
mkdir -p ~/dsh-plugins
tar -xzf dsh-external-dsh-remote-workspace-0.1.0.tgz -C ~/dsh-plugins
bash ~/dsh-plugins/package/install.sh # installs ssh2 and validates artifacts
Inject it from your DSH session:
# DSH injector environment:
# dev_inject_plugin ~/dsh-plugins/package
Refresh the DSH web page.
The repo ships dsh.bundle.patch + cordis.patch.yml, so a DSH install that
supports bundle installation can add it directly:
dsh plugin --profile web add Hefulalala/dsh-remote-workspace
git clone https://github.com/Hefulalala/dsh-remote-workspace.git dsh-remote-workspace
cd dsh-remote-workspace
# Install the runtime dependency (and, if you want local builds, the toolchain):
npm install --omit=dev ssh2
npm install --save-dev typescript tsdown @types/node @types/react @types/react-dom @types/ssh2
bash scripts/build.sh # host: src/index.ts → lib/
npm run build:client # client: src/client/index.tsx → lib/client.js
# In the DSH injector environment:
# dev_inject_plugin /absolute/path/to/dsh-remote-workspace
scripts/build.sh auto-detects a DSH source checkout (DSH_CHECKOUT) for peer-type linking;
otherwise it falls back to the locally installed toolchain.
Open 🌐 Remote Sites in the bottom-left sidebar and add a site:
| Field | Notes |
|---|---|
| Host / Port / Username | SSH target |
| Home directory | optional; empty = auto-detect the remote home |
| Auth | password / private-key file / SSH agent |
Click Add Workspace in the left workspace tree:
A remote workspace now appears in the left tree. Click it to open a new session, then just talk to the agent, e.g.:
"Read /srv/app/config.yml and change the port to 8081"
The agent resolves paths against the remote root and uses remote_workspace_read/write automatically (guided by the generated AGENTS.md).
0600 JSON file. For production, wire the plugin to DSH's credentials service or an OS keyring.| Tool | Purpose |
|---|---|
remote_site_list | List configured SSH/SFTP connection profiles |
remote_site_add | Add a site (tests the connection; home defaults to the remote home) |
remote_site_test | Test a site connection |
remote_site_rename | Rename a site (auto-derived workspace names follow) |
remote_site_update | Update connection/auth/home of a site |
remote_site_remove | Remove a site and its workspace registrations |
remote_site_browse | Browse site directories (workspace folder picking) |
remote_workspace_list | List remote workspaces |
remote_workspace_add | Create a workspace for siteId + rootPath |
remote_workspace_browse | Browse a workspace directory |
remote_workspace_read | Read a remote file (binary → base64) |
remote_workspace_write | Overwrite a remote file (utf8/base64) |
remote_workspace_append | Append to a remote file (no whole-file rewrite) |
remote_workspace_write_at | Patch part of a remote file at a byte offset |
remote_workspace_test | Test a workspace root |
remote_workspace_remove | Remove the sidebar grouping only |
Prefix: /remote-workspaces/api — every response is {ok:true,value} or {ok:false,error:{code,message}}.
| Method | Route | Purpose |
|---|---|---|
| GET | /ping | Health check |
| GET | /sites/list | List sites |
| POST | /sites/add | Add site |
| POST | /sites/test | Test site |
| POST | /sites/rename | Rename site |
| POST | /sites/update | Update site |
| POST | /sites/remove | Remove site |
| POST | /sites/browse | Browse a site directory |
| POST | /sites/mkdir | Create a remote folder |
| GET | /workspaces/list | List remote workspaces |
| POST | /workspaces/add | Create remote workspace (siteId, optional rootPath, optional name) |
| POST | /workspaces/ensure | Ensure sidebar anchor exists |
| POST | /workspaces/rename | Rename workspace |
| POST | /workspaces/remove | Remove workspace |
| POST | /workspaces/test | Test workspace root |
| POST | /workspaces/browse | Browse workspace directory |
| POST | /workspaces/read | Read file (cached by mtime+size) |
| POST | /workspaces/write | Write file |
| POST | /workspaces/append | Append to a file |
| POST | /workspaces/writeat | Patch part of a file at a byte offset |
| GET | /pool-stats | Connection-pool and file-cache stats |
$DSH_HOME/storages/remote-workspaces.json (v2):
sites[] — connection profiles: host, port, user, auth, resolved homePath, host fingerprintworkspaces[] — siteId + rootPath + sidebar anchor (localWorkspaceId)Version 1 stores are migrated automatically on first load.
src/index.ts Host: data model, SSH2/SFTP, workspaceRegistry anchors, HTTP API, tools
src/client/index.tsx Client: Remote Sites panel + unified add-workspace flow
cordis.patch.yml dsh.bundle patch used by `dsh plugin add`
scripts/build.sh Host build
scripts/smoke.mjs Artifact smoke test
lib/ Build output
More design details: docs/architecture.md · CHANGELOG.md.
webServer, tools, workspaceRegistryslots, workspaces-1 and wraps
local-picking behavior, so removing the plugin cleanly restores the built-in flow.mtime+size content cacheBSD-3-Clause © 2026 dsh-remote-workspace contributors. See LICENSE.