dsh-remote 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +38 -318
- package/README.md +36 -298
- package/lib/binding.js +4 -2
- package/lib/client.js +828 -62
- package/lib/file-changes.js +57 -0
- package/lib/index.js +29 -38
- package/lib/remote-fs.js +8 -2
- package/lib/remote-git.js +127 -0
- package/lib/remote-shell-child.cjs +59 -12
- package/lib/remote-shell.js +1 -1
- package/lib/remote-write.js +51 -0
- package/lib/routes-fs.js +72 -24
- package/lib/sftp-surface.js +1 -1
- package/lib/vendor/jsdiff/LICENSE +29 -0
- package/lib/vendor/jsdiff/SOURCE.md +4 -0
- package/lib/vendor/jsdiff/diff/base.js +254 -0
- package/lib/vendor/jsdiff/diff/line.js +66 -0
- package/lib/vendor/jsdiff/patch/create.js +229 -0
- package/lib/vendor/jsdiff/util/params.js +15 -0
- package/lib/workspace-search.js +219 -0
- package/package.json +6 -5
package/README.en.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
**English** · [中文](https://github.com/flymysql/dsh-remote/blob/main/README.md)
|
|
2
2
|
|
|
3
|
-
---
|
|
4
|
-
|
|
5
3
|
# dsh-remote
|
|
6
4
|
|
|
7
5
|
[](https://www.npmjs.com/package/dsh-remote)
|
|
@@ -12,349 +10,69 @@
|
|
|
12
10
|
|
|
13
11
|
Maintained by [@flymysql](https://github.com/flymysql) · [Homepage](https://flymysql.github.io/dsh-remote/) · [Usage stats](https://flymysql.github.io/dsh-remote/stats/) · [Blog](https://gitpull.cn) · [Discussions](https://github.com/flymysql/dsh-remote/discussions) · [Issues](https://github.com/flymysql/dsh-remote/issues) · [中文说明](https://github.com/flymysql/dsh-remote/blob/main/README.md)
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
**Remote-work assistant for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH).**
|
|
18
|
-
|
|
19
|
-
Manage several SSH machines, then pick a **remote workspace** (or a **local** one) and let the agent operate right there without leaving the harness — listing files, reading code, running builds & commands over the remote host, and keeping that remote directory mirrored into a real local workspace object.
|
|
20
|
-
|
|
21
|
-
The harness Web UI intentionally binds `127.0.0.1` (the CLI rejects `--host 0.0.0.0` for safety). This plugin goes the other way: **you connect out** to the machines you maintain, pick a workspace, and work in it through the normal DSH workspace + agent fs flows — no changes to `dsh-workspace` or the harness core.
|
|
22
|
-
|
|
23
|
-
It works the other way too: **you can open the remote machine's own DSH Web UI as a page in your local browser** — again without exposing any port on the remote. The remote dsh must be installed by you (the plugin no longer installs it).
|
|
24
|
-
|
|
25
|
-
## 1.0 workspace experience
|
|
26
|
-
|
|
27
|
-
Search and reopen recent remote projects directly. The explorer keeps session context and files use native tabs. Agent command cards show actual exit codes, duration and compiler diagnostics; a diagnostic opens the remote file at the reported line. Files support search, wrapping, Markdown preview and save shortcuts. Reopening a file revalidates changes made by the agent.
|
|
28
|
-
|
|
29
|
-
Unsaved drafts remain in page memory, with an unload warning; browser crashes or forced termination can still lose them. The file pane accesses the remote host directly. Mirrors update through `rw_sync` / `rw_push`, or explicitly enabled autoPush. A completed sync describes that operation, not continuous equality.
|
|
30
|
-
|
|
31
|
-
The new interface primarily targets DSH Web 0.2.x; DSH 0.2.2 requires Node.js ≥24.9. Older hosts use the available fallback interfaces. This plugin does not provide a remote language server, extension host, or hosted remote Git/debugger.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Screen previews
|
|
37
|
-
|
|
38
|
-
**Agent diagnostics and remote source navigation** — inspect actual exit codes and open the reported remote file line:
|
|
39
|
-
|
|
40
|
-
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-agent.png" alt="Remote compiler diagnostics, exit code and source navigation" width="1000"/>
|
|
41
|
-
|
|
42
|
-
**File viewing and search** — line numbers, syntax highlighting, match navigation and wrapping:
|
|
43
|
-
|
|
44
|
-
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-file.png" alt="Remote file search, match count, wrapping and highlighting" width="620"/>
|
|
45
|
-
|
|
46
|
-
**Native remote terminal** — explicitly launch remote ssh in the current session's remote directory:
|
|
47
|
-
|
|
48
|
-
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-terminal.png" alt="Actual keyboard input and command output in the DSH remote terminal" width="1000"/>
|
|
49
|
-
|
|
50
|
-
## Features
|
|
51
|
-
|
|
52
|
-

|
|
53
|
-
|
|
54
|
-
The image above is the overview. What follows is only what the image does not make obvious.
|
|
55
|
-
|
|
56
|
-
**Workspace picker** (fills the native "Add workspace" flow) — Local uses the system folder chooser; Remote browses inside the modal:
|
|
57
|
-
|
|
58
|
-
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/picker-dialog.png" alt="The 远程 (remote) tab of the workspace picker: machine select, recent workspaces, browse, set-as-remote-workspace" width="632"/>
|
|
59
|
-
|
|
60
|
-
- The path field autocompletes live; on Windows hosts the root shows a multi-drive view; the floating browser fills the field without committing.
|
|
61
|
-
- On confirm a **real local mirror** is created and adopted by the harness, kept in sync over SFTP; the choice persists on the machine.
|
|
62
|
-
|
|
63
|
-
**Settings** — independent host connectivity checks and connection-test duration, with host configuration separate from workspace creation:
|
|
13
|
+
Turn SSH hosts into everyday development workspaces in [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): browse remote files, edit code, run terminals and let the agent work on the same remote project. Multiple workspaces can use different hosts in parallel.
|
|
64
14
|
|
|
65
|
-
|
|
15
|
+
**IDE mode: files on the left, editor in the center, native agent conversation on the right.** Resize columns or switch panes on narrow screens. Returning to the normal layout keeps tasks and unsaved edits.
|
|
66
16
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- **21 model tools** (listed so they can be copied or searched): `rw_info`, `rw_connect`, `rw_machines`, `rw_pick_workspace`, `rw_list_dir`, `rw_stat`, `rw_read_file`, `rw_write_file`, `rw_edit`, `rw_append`, `rw_mkdir`, `rw_remove`, `rw_move`, `rw_exec`, `rw_search`, `rw_download`, `rw_upload`, `rw_sync`, `rw_push`, `rw_forward`, `rw_disconnect`.
|
|
70
|
-
- **Tell local and remote Sessions apart in the sidebar** (`0.8.43+`) — a remote Session row carries a **green dot** and its hover card names `user@host:port` plus the remote path; opening it also shows a host chip in the conversation header (a local Session shows neither). A Session counts as remote only when its cwd sits inside a `$DSH_HOME/remote-workspaces/…` mirror, so a machine that is merely saved never labels a local Session.
|
|
71
|
-
- **A terminal in a remote Session opens on the remote host out of the box** (`0.8.75+`) — the shell menu's **remote ssh** entry routes by cwd (a mirror cwd → ssh into the remote workspace; anything else → transparent local-shell fallback), and it is the **default shell** whenever neither the host nor you picked one. Saved passwords are answered through the local credential bridge (`0.8.81+`, including OS-keychain ones) — no more `password:` prompt every time a terminal opens.
|
|
72
|
-
- **Remote file previews have line numbers and syntax highlighting** (`0.8.86+`) — code files render through the host's own Shiki engine, and chat links carrying `file:line` (or `#L<n>`) land on that line with a flash.
|
|
73
|
-
- **Remote project skills need no prior sync** (issue #120) — `.dsh/skills` and `.agents/skills` on a remote workspace appear in the DSH skill catalog, including directory bundles and top-level Markdown files; full bodies load over SFTP on demand, and the remote candidate wins a same-named stale mirror copy. Resolve adjacent resources with `rw_list_dir` / `rw_read_file`. Writes, pushes and autoPush invalidate the catalog immediately; background/external edits are covered by a five-minute **invalidate-only** timer that performs no SFTP traffic of its own. Ordinary local Sessions keep the host's original skill discovery.
|
|
74
|
-
- **Open a remote machine's DSH Web UI locally** (`0.8.36+`) — nothing has to be exposed on the remote: the plugin SSHes out, starts a `dsh web` there that binds **`127.0.0.1` only**, and tunnels its port back to a loopback port on this machine. The URL carries a one-time login token, consumed once by a redirect.
|
|
75
|
-
- **The audit log opens locally** — preview recent entries in the panel, or use 「打开日志文件」/「在文件夹中显示」 to open the log with a local program (the log lives on the DSH host, so a browser cannot open it).
|
|
76
|
-
- **Cross-platform remotes** — all file access is SFTP-protocol-level (no POSIX shell), so Linux/macOS/Windows remotes all work.
|
|
77
|
-
- **Windows remotes** — the platform is auto-detected and commands go through `bash -s` over stdin, so quoting and backslash escaping are never an issue (`config.shell` can pin a path or `native` disables wrapping); `C:\Users\dev` and `/c/Users/dev` are both accepted.
|
|
78
|
-
- **Async long tasks** — `rw_sync`/`rw_push` with `async: true` return a `taskId` with progress/result/cancel.
|
|
79
|
-
- **Data lives under the harness home** — machines and mirrors follow `$DSH_HOME`; pre-0.6 data migrates automatically on first run.
|
|
80
|
-
- **No `dsh-workspace` core changes** — everything ships as a normal plugin.
|
|
81
|
-
- **Pages in the terminal UI too (dsh-tui)** — `/dsh-remote` opens a server management page (add/edit/delete, connect, browse remote directories; press `w` there to set the current directory as a workspace), and the new-workspace picker can list remote project directories directly — again without patching dsh-tui. See "Use it from the TUI" below.
|
|
82
|
-
|
|
83
|
-
## 1.0.1 upgrade fixes
|
|
84
|
-
|
|
85
|
-
Stale settings styles are replaced during a client upgrade. SSH configuration opens in an in-app editor with save and external-change protection. The native workspace-files action opens the remote tree, including files not present in the local mirror. DSH 0.2.1-rc.5 is explicitly supported alongside the 0.2.0 and 0.2.2 acceptance hosts.
|
|
86
|
-
|
|
87
|
-
Automatic mode starts checking immediately when enabled, checks every 30 minutes by default, retries failures and displays progress/errors in Preferences. An already installed disk update also triggers a loader reload. After a CLI installation, restart DSH Web and refresh the browser if the running process still serves the previous version.
|
|
17
|
+
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-ide.png" alt="DSH remote IDE with file tree, native code editor and agent conversation" width="1200"/>
|
|
88
18
|
|
|
89
19
|
## Install
|
|
90
20
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Runs on **both** the `0.1.x` and `0.2.x` DSH lines. DSH validates every `@deepseek-ai/dsh-*` peer range *before* importing a bundle and **drops the whole bundle** when any range does not match (no settings panel, no `rw_*` tools):
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
dsh: skipping profile bundle "dsh-remote": Error: Plugin dsh-remote@… is incompatible …
|
|
21
|
+
```bash
|
|
22
|
+
dsh plugin --profile web add dsh-remote
|
|
97
23
|
```
|
|
98
24
|
|
|
99
|
-
|
|
25
|
+
After installation or an upgrade, restart DSH Web and refresh the page. Check automatic-update status under Settings → Remote workspaces → Preferences.
|
|
100
26
|
|
|
101
|
-
|
|
27
|
+
## Start in 3 steps
|
|
102
28
|
|
|
103
|
-
|
|
29
|
+
1. **Configure a host**: open Settings → Remote workspaces to edit SSH configuration or save credentials. Connectivity checks run automatically; no manual connection step is required.
|
|
30
|
+
2. **Create a workspace**: Add workspace → Remote, then choose a host and folder. Each workspace binds its own host; settings have no folder selection or global active host.
|
|
31
|
+
3. **Develop remotely**: open workspace files or enter IDE mode to edit, search, run commands and collaborate with the agent.
|
|
104
32
|
|
|
105
|
-
-
|
|
106
|
-
- A native Remote Files entry uses `sidebarRightTabs`, giving remote files session-scoped resource addresses instead of sending remote paths to the local Files viewer.
|
|
107
|
-
- `dsh-better-sidebar` is not bundled; official Desktop uses the native right sidebar.
|
|
33
|
+
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workspace-picker-browse.png" alt="Remote folder picker with fixed path and confirmation controls and a large directory list" width="720"/>
|
|
108
34
|
|
|
109
|
-
|
|
35
|
+
## Everyday development
|
|
110
36
|
|
|
111
|
-
###
|
|
37
|
+
### Search remote names and contents
|
|
112
38
|
|
|
113
|
-
|
|
114
|
-
dsh plugin add dsh-remote
|
|
115
|
-
```
|
|
39
|
+
Find files, directories or content recursively without expanding folders or syncing a mirror first. The default view keeps scope and progress compact; expand search options or scan details when needed. Case sensitivity, ignored directories, stop and retry remain available. Results reveal a directory or open the matching file line.
|
|
116
40
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
> **Upgrading from 0.7.2–0.8.17:** the embedded sidebar goes away; any old profile override for `id: dsh-remote-sidebar` can be removed.
|
|
120
|
-
|
|
121
|
-
(or `npm install dsh-remote` + add `- id: dsh-remote / name: dsh-remote` in `cordis.patch.yml`).
|
|
122
|
-
|
|
123
|
-
## Quick start
|
|
124
|
-
|
|
125
|
-
1. **Configure hosts** — Settings → Remote workspaces lists SSH config entries and saved hosts. Opening the page automatically checks SSH connectivity and shows connection-test duration. Checks do not select a host, open a folder or change any workspace. Add Host blocks with **Edit SSH config**, then **Refresh**. Saved hosts provide credential and connection editing through their actions menu.
|
|
126
|
-
2. **Create a remote workspace** — use the sidebar Add workspace flow, choose a host and remote folder, or reopen a recent project. Confirmation creates or reuses the local mirror and opens it through the host. Each workspace binds its own host, so multiple remote hosts work in parallel; settings have no global active-host selector. Local projects use the system folder chooser or built-in browser.
|
|
127
|
-
3. **Work with the agent** — treat it like any workspace: `rw_read_file` / `rw_write_file` / `rw_edit` / `rw_exec` / `rw_search` / `rw_sync` / `rw_push` / `rw_forward` (full list above).
|
|
128
|
-
|
|
129
|
-
> **Remote context is session-scoped:** the "Remote workspace" system-prompt section appears only when the current session's workspace is a remote mirror; local sessions are unaffected and the model will not call `rw_*` on its own.
|
|
130
|
-
|
|
131
|
-
## Open a remote machine's DSH Web UI locally
|
|
132
|
-
|
|
133
|
-
The `dsh web` running on a remote machine can also be opened **as a page on this machine** (issue #46). The direction stays "this machine dials out":
|
|
134
|
-
|
|
135
|
-
> **The remote opens no port.** DSH deliberately refuses `--host 0.0.0.0` (it would put remote
|
|
136
|
-
> code execution on the network), so the correct shape is: SSH out, start a `dsh web` on the remote
|
|
137
|
-
> that listens on **127.0.0.1 only**, and carry its port back over the SSH connection to a loopback
|
|
138
|
-
> port here.
|
|
139
|
-
|
|
140
|
-
Usage: Settings → Remote workspaces → **"Remote DSH Web UI"** → pick a machine → **Connect & open**.
|
|
141
|
-
A new tab opens showing that remote machine's full DSH interface (chat, tool tree, settings).
|
|
142
|
-
|
|
143
|
-
- The URL looks like `http://127.0.0.1:3088/?token=…`. That token is a one-time credential the remote
|
|
144
|
-
process prints at startup and is used once, on this machine, by that redirect: DSH exchanges it for a
|
|
145
|
-
30-day signed cookie and lands on a clean `/`. **Do not share that tokenized URL.**
|
|
146
|
-
- "Disconnect" only closes the tunnel and deliberately does **not** kill the remote process (it may be
|
|
147
|
-
an instance you use elsewhere). "Disconnect & stop remote" also ends the process — but only one this
|
|
148
|
-
plugin started.
|
|
149
|
-
- If the remote already runs an interface (for example one you started in a terminal), pick the machine
|
|
150
|
-
and paste its `http://127.0.0.1:<port>/?token=…` into the field, then "Attach to running instance" —
|
|
151
|
-
no second instance will be started.
|
|
152
|
-
- For a **boot-start / resident remote DSH**, manual pasting is unnecessary: configure
|
|
153
|
-
`webAttachDiscoverCommand` on the machine card → "Advanced" → "Discover command" (per machine only;
|
|
154
|
-
empty keeps the historical always-spawn behaviour). Before "Connect & open", the plugin runs this command
|
|
155
|
-
on the remote and takes the last `http(s)://…` line with a valid port and token. If that address answers
|
|
156
|
-
a health probe, the resident instance is reused: no second process is spawned, and disconnect never stops
|
|
157
|
-
it. Empty output, a failing command, an 8-second timeout, or a failed health probe all fall back to the
|
|
158
|
-
normal launch, with the reason shown in the UI. Raw discovery output and its token never enter the audit log.
|
|
159
|
-
|
|
160
|
-
Have the resident instance's startup script save its launch URL in `$HOME/.dsh-web-url` (on Windows,
|
|
161
|
-
`%USERPROFILE%\.dsh-web-url`). The file contains one line, `http://127.0.0.1:<port>/?token=…`; then use
|
|
162
|
-
the command appropriate for that remote:
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
# Linux / macOS (sh / bash)
|
|
166
|
-
cat "$HOME/.dsh-web-url" 2>/dev/null
|
|
167
|
-
|
|
168
|
-
# Windows remote (PowerShell; works with cmd or PowerShell as the SSH login shell)
|
|
169
|
-
powershell -NoProfile -Command "Get-Content $env:USERPROFILE\.dsh-web-url -ErrorAction SilentlyContinue"
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
The discover command runs verbatim in the remote **login shell** — the plugin does not rewrite it as a
|
|
173
|
-
POSIX command — so Windows remotes can use PowerShell directly. A missing file produces empty output and
|
|
174
|
-
the plugin starts a fresh instance as before.
|
|
175
|
-
- When the remote `dsh` is not on the SSH login PATH, point `webAttachCommand` at its absolute path; to
|
|
176
|
-
keep an attached instance out of the remote user's own sessions and settings, point `webAttachDshHome`
|
|
177
|
-
at a scratch directory. This is **per machine**: Settings → Remote workspace → the machine card →
|
|
178
|
-
expand "Advanced" → "Remote dsh command" (e.g.
|
|
179
|
-
`/home/you/.nvm/versions/node/v22.19.0/bin/node /home/you/.dsh-remote/dsh/node_modules/@deepseek-ai/dsh/lib/bin.js`).
|
|
180
|
-
Empty falls back to the global `webAttachCommand`.
|
|
181
|
-
- The tunnel follows the SSH connection: when it drops, the UI shows "Disconnected" and the local DSH
|
|
182
|
-
process is **not** affected. After the pool reconnects the plugin re-resolves the remote port (restarting
|
|
183
|
-
the remote process it started, if that one died), so hitting "Reconnect" is enough to carry on.
|
|
184
|
-
- The remote node must be **≥ 20.12** (booting dsh needs `parseEnv` from `node:util`, which only exists
|
|
185
|
-
from 20.12). On an older node npm only warns (EBADENGINE) and installs anyway, and the crash arrives
|
|
186
|
-
later as `does not provide an export named 'parseEnv'` — check the version before you install.
|
|
187
|
-
|
|
188
|
-
## Use it from the TUI (dsh-tui)
|
|
189
|
-
|
|
190
|
-
The plugin ships a TUI adaptation layer: once installed into a `dsh-tui` profile, the same
|
|
191
|
-
machine registry, SSH pool and remote workspaces work in the terminal UI — **without patching
|
|
192
|
-
dsh-tui itself** (everything registers through its plugin seams).
|
|
41
|
+
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-search-results.png" alt="Compact remote recursive search results with a nested directory and file" width="675"/>
|
|
193
42
|
|
|
194
|
-
|
|
195
|
-
# On a machine that already runs dsh-tui this is the only step; a local checkout works too
|
|
196
|
-
dsh plugin --profile dsh-tui add dsh-remote
|
|
197
|
-
# or: dsh plugin --profile dsh-tui add /path/to/dsh-remote
|
|
198
|
-
```
|
|
43
|
+
### Inspect remote Git changes
|
|
199
44
|
|
|
200
|
-
|
|
45
|
+
Switch between working-tree and staged diffs, filter files and jump from a changed line to source. The panel is read-only; it does not commit or change the index.
|
|
201
46
|
|
|
202
|
-
|
|
203
|
-
- the `/workspace` picker lists remote projects directly (or go straight: `dshremote://<machine>/<path>`);
|
|
204
|
-
- the status bar names the current remote machine (remote Sessions only; hover for details).
|
|
47
|
+
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-git.png" alt="Remote Git working-tree and staged changes with file list and source diff" width="675"/>
|
|
205
48
|
|
|
206
|
-
|
|
207
|
-
cleanup semantics, the host-API contract and the limits live in **[docs/tui.md](https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/tui.md)** (Chinese).
|
|
49
|
+
### Run a remote terminal
|
|
208
50
|
|
|
209
|
-
|
|
51
|
+
The terminal starts in the session's remote directory. A pixel fish welcomes you before the real SSH shell; saved credentials can answer authentication automatically, and multiple terminals can run together.
|
|
210
52
|
|
|
211
|
-
|
|
53
|
+
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-terminal.png" alt="Native remote terminal with pixel fish and actual SSH command output" width="1000"/>
|
|
212
54
|
|
|
213
|
-
|
|
214
|
-
# Example only — use values for your own machine.
|
|
215
|
-
- id: dsh-remote
|
|
216
|
-
name: dsh-remote
|
|
217
|
-
config:
|
|
218
|
-
host: 203.0.113.10 # or your real host / hostname
|
|
219
|
-
port: 22
|
|
220
|
-
username: dev
|
|
221
|
-
privateKeyPath: ~/.ssh/id_rsa
|
|
222
|
-
# or password: '…'
|
|
223
|
-
workspace: ~/project
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
If `host` is empty the plugin starts disconnected and you configure machines in the UI.
|
|
227
|
-
|
|
228
|
-
## CLI quick reference
|
|
229
|
-
|
|
230
|
-
Installing and driving DSH may live in different shells, so both the `dsh` binary and the `npx` form are shown. Always tell DSH **which profile** to use with `--profile <name>` (usually `web`).
|
|
231
|
-
|
|
232
|
-
```bash
|
|
233
|
-
# install the bundle into a profile (npm is pulled by pnpm; recommended)
|
|
234
|
-
dsh plugin --profile web add dsh-remote
|
|
235
|
-
# same but when `dsh` is not on PATH (e.g. Windows PowerShell inside a repo)
|
|
236
|
-
npx --yes @deepseek-ai/dsh plugin --profile web add dsh-remote
|
|
55
|
+
### Edit and build with the agent
|
|
237
56
|
|
|
238
|
-
|
|
239
|
-
dsh plugin --profile web list
|
|
240
|
-
npx --yes @deepseek-ai/dsh plugin --profile web list
|
|
57
|
+
Tool cards show applied changes, actual exit codes and build output, with compiler diagnostics linking to source. Saving detects remote conflicts, preserves CRLF and protects newer input typed during the save.
|
|
241
58
|
|
|
242
|
-
|
|
243
|
-
dsh --profile web
|
|
244
|
-
npx --yes @deepseek-ai/dsh --profile web # http://127.0.0.1:3080
|
|
59
|
+
<img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-applied-diff.png" alt="Applied remote agent edit with diff, file path and added/deleted line counts" width="485"/>
|
|
245
60
|
|
|
246
|
-
|
|
247
|
-
npx --yes @deepseek-ai/dsh plugin --profile web add /path/to/dsh-remote
|
|
248
|
-
npx --yes @deepseek-ai/dsh plugin --profile web remove dsh-remote # back to release
|
|
249
|
-
```
|
|
61
|
+
## Compatibility and limits
|
|
250
62
|
|
|
251
|
-
|
|
63
|
+
- Primarily targets **DSH Web 0.2.x**; 0.2.2 needs **Node.js ≥24.9**. See the [compatibility reference](https://github.com/flymysql/dsh-remote/blob/main/docs/reference.en.md#dsh-version-compatibility) for older-host fallbacks, Desktop/TUI and agent-diff differences.
|
|
64
|
+
- Files access the remote host directly; mirrors sync on demand. Drafts live in page memory and can be lost after a crash or forced exit.
|
|
65
|
+
- No remote language server, extension host or debugger. The agent runs commands as your configured SSH user; configure trusted hosts only.
|
|
252
66
|
|
|
253
|
-
##
|
|
67
|
+
## Documentation and community
|
|
254
68
|
|
|
255
|
-
|
|
69
|
+
[Full tool and configuration reference](https://github.com/flymysql/dsh-remote/blob/main/docs/reference.en.md) · [Troubleshooting](https://github.com/flymysql/dsh-remote/blob/main/docs/troubleshooting.md) · [Upgrade guide](https://github.com/flymysql/dsh-remote/blob/main/docs/migration-1.0.md) · [Changelog](https://github.com/flymysql/dsh-remote/blob/main/CHANGELOG.md)
|
|
256
70
|
|
|
257
|
-
|
|
258
|
-
scripts/dev-run.sh --restart # start / restart the isolated sandbox
|
|
259
|
-
scripts/dev-run.sh --stop # stop it
|
|
260
|
-
scripts/dev-run.sh --status # is it running?
|
|
261
|
-
```
|
|
71
|
+
[Homepage](https://flymysql.github.io/dsh-remote/) · [Discussions](https://github.com/flymysql/dsh-remote/discussions) · [Report an issue](https://github.com/flymysql/dsh-remote/issues) · [Contributing](https://github.com/flymysql/dsh-remote/blob/main/CONTRIBUTING.md) · [Contributors and credits](#contributors-and-credits)
|
|
262
72
|
|
|
263
|
-
|
|
264
|
-
- **Host-half** (`lib/index.js`) changes need `--restart`; **client-half** (`lib/client.js`) changes need only a page refresh.
|
|
265
|
-
- The script hardlink-copies `lib/` into the sandbox rather than symlinking — a symlink breaks `@deepseek-ai/*` resolution.
|
|
266
|
-
- Before committing: `node check.mjs` (framework-constraint gate) and `npm test`; `scripts/boot-smoke.sh` proves the plugin still starts.
|
|
267
|
-
- Full rules live in `scripts/dev-standards.md`.
|
|
268
|
-
|
|
269
|
-
Deploying to a product profile is a separate, explicit action (`./sync.sh`) for releases only.
|
|
270
|
-
|
|
271
|
-
## Configuration
|
|
272
|
-
|
|
273
|
-
| Key | Type | Default | Meaning |
|
|
274
|
-
| --- | --- | --- | --- |
|
|
275
|
-
| `host` | string | `''` | default SSH host (else start disconnected) |
|
|
276
|
-
| `port` | int | `22` | default SSH port |
|
|
277
|
-
| `username` | string | `''` | default SSH user |
|
|
278
|
-
| `password` | string | `''` | default SSH password (non-empty overrides key) |
|
|
279
|
-
| `privateKeyPath` | string | `''` | private key path (used only when explicitly provided) |
|
|
280
|
-
| `passphrase` | string | `''` | passphrase for an encrypted private key |
|
|
281
|
-
| `workspace` | string | `''` | default remote workspace path |
|
|
282
|
-
| `shell` | string | `''` | remote command terminal strategy: `''`=auto-detect (Git Bash on Windows remotes), `'git-bash'`=prefer Git Bash, `'native'`=never wrap, anything else=explicit bash.exe path (e.g. `C:\Program Files\Git\bin\bash.exe`) |
|
|
283
|
-
| `commandTimeoutMs` | int | 20000 | per remote command timeout |
|
|
284
|
-
| `connectTimeoutMs` | int | 15000 | SSH connect timeout |
|
|
285
|
-
| `maxOutputChars` | int | 200000 | cap on captured stdout/stderr per remote command |
|
|
286
|
-
| `maxFileBytes` | int | 52428800 | skip mirroring/reading files larger than this (0 = no cap) |
|
|
287
|
-
| `hostKeyMode` | string | `accept-new` | host-key policy: `accept-new` (TOFU), `verify` (reject unknown hosts), `off` (skip) |
|
|
288
|
-
| `useAgent` | bool | `false` | authenticate via the OpenSSH agent (`SSH_AUTH_SOCK`) |
|
|
289
|
-
| `keyboardInteractive` | bool | `false` | allow keyboard-interactive auth (OTP/MFA) with the configured password |
|
|
290
|
-
| `backend` | string | `native` | SSH transport backend (issue #51). `native` = the built-in ssh2 client (password / private key / agent / OTP); `openssh` = **drive the local `ssh` command**, which is the only way to reach hosts whose sole authentication method is GSSAPI/Kerberos (log in once with `kinit`), and which also honours `ProxyCommand`, `PKCS11Provider`, `Match` blocks and the rest of `~/.ssh/config`. **Settable per machine.** The cost is a fresh connection per command (slower than native); SFTP still reuses one session. The host name is handed to ssh **verbatim** (so `~/.ssh/config` stays the single source of truth) and host keys are checked by ssh against your own `known_hosts` |
|
|
291
|
-
| `sshBinary` | string | `''` | the `ssh` executable the `openssh` backend drives (empty = the `ssh` on PATH) |
|
|
292
|
-
| `proxy` | object | — | jump host: `{ host, port?, username?, password?, privateKeyPath? }`; it means "reach the target host:port from the bastion", which is also what reaches a docker container's sshd on the bastion (see the issue #56 entry in the FAQ) |
|
|
293
|
-
| `autoPush` | bool | `false` | auto-push edited mirror files back to the remote (watcher, debounced) |
|
|
294
|
-
| `auditLog` | bool | `true` | append executed commands to `$DSH_HOME/remote-workspaces/audit.log` |
|
|
295
|
-
| `encoding` | string | `utf-8` | text encoding for remote file reads/writes (e.g. `gbk`) |
|
|
296
|
-
| `fileReference` | bool | `true` | remote `@` completion: in a remote session `@` lists the **remote** tree over SFTP (issue #39); off → only the local mirror |
|
|
297
|
-
| `fileReferenceMaxResults` | int | `20` | max `@` candidates rendered for one query |
|
|
298
|
-
| `fileReferenceMaxEntries` | int | `3000` | max entries retained in one remote workspace's `@` index |
|
|
299
|
-
| `fileReferenceExcludedDirectories` | string[] | `[.git, node_modules, dist, build, out, coverage, target, .next, .nuxt, .turbo, .venv, __pycache__, .pytest_cache, .mypy_cache, .gradle]` | directory basenames the remote `@` traversal skips |
|
|
300
|
-
| `fileReferenceTimeoutMs` | int | `4000` | wall-clock budget for one remote `@` index pass (on expiry the partial index answers rather than making the caret wait) |
|
|
301
|
-
| `searchTimeoutMs` | int | `60000` | Cooperative budget (ms) for `rw_search`: declared as the tool's `timeoutMs` for DSH's timeout policy and used as the search's own wall-clock cap; on expiry it returns partial results marked `TRUNCATED` (issue #44). |
|
|
302
|
-
| `searchMaxEntries` | int | `50000` | Max files `rw_search` scans before returning partial results. |
|
|
303
|
-
| `updateMode` | string | `auto` | self-update behaviour: `auto` checks npm on load, when enabled and every 30 minutes and applies a newer release; `manual` only checks when asked; `off` disables checks. **Default changed to `auto` in 0.8.27** — safe because 0.8.24 added the host-half hot swap |
|
|
304
|
-
| `updateCheckIntervalMs` | int | 1800000 (30 min) | how often `auto` mode checks npm (floor 60000) |
|
|
305
|
-
| `updateAutoReload` | bool | `true` | hot-swap the host half after an update lands; `false` defers it to the next process start and the panel reports `pendingReload` |
|
|
306
|
-
| `webAttachPortStart` | int | `3088` | first local port for the "Remote DSH Web UI" tunnel (later ports are tried when taken; loopback only) |
|
|
307
|
-
| `webAttachCommand` | string | `dsh` | command used to start `dsh web` on the remote; change it when the remote `dsh` is not on the SSH login PATH (also settable per machine under "Advanced" in the settings page, which wins over this default) |
|
|
308
|
-
| `webAttachDshHome` | string | `''` | `DSH_HOME` exported on the remote when attaching; empty reuses the remote user's own harness home |
|
|
309
|
-
| `webAttachWaitSeconds` | int | `45` | how long to wait for a freshly started remote `dsh web` to print its launch token |
|
|
310
|
-
| `localTools` | string | `bootstrap` | which `rw_*` tools a LOCAL session (cwd outside every remote mirror) sees (issue #63): `bootstrap` keeps only the configuration loop `rw_machines`/`rw_connect`/`rw_pick_workspace` (the other 19 refuse a local session with "this session is LOCAL", so exposing them just wastes schema budget); `none` hides all `rw_*` (remote setup happens via the settings page only); `all` restores the legacy full surface. REMOTE sessions (cwd inside a mirror) always see everything; an invalid value degrades to `bootstrap` |
|
|
311
|
-
| `telemetry` | bool | `true` | anonymous install heartbeat (daily-active statistics, at most once a day; the payload is a plugin-specific HMAC pseudonym + version, no machine info). `false` disables it (the admin path); the 0.8.78 settings checkbox was removed in 0.8.81 — a previously persisted user opt-out is still honored |
|
|
312
|
-
| `remoteTerminalDefault` | bool | `true` | make the shell menu's "remote ssh" launcher the terminal's DEFAULT shell when neither the host (`config.shell`) nor the user (a remembered menu choice) has picked one: a session rooted in a remote mirror opens a terminal already sshed into the remote workspace, any other session transparently falls back to a local shell (issue #55); `false` keeps it menu-only |
|
|
313
|
-
| `tui` | bool | `true` | master switch for the TUI (dsh-tui) layer; `false` registers no `/dsh-remote` page, workspace provider or status field |
|
|
314
|
-
| `tuiProviderListRecent` | bool | `true` | list each machine's recent remote projects in the TUI workspace picker |
|
|
315
|
-
| `tuiProviderRecentLimit` | int | `5` | recent remote projects listed per machine (1–20) |
|
|
316
|
-
| `tuiAutoSwitchWorkspace` | bool | `true` | switch the session right after pressing `w` (set as workspace) in the directory browser |
|
|
317
|
-
| `tuiLang` | string | `''` | language of the TUI layer's own copy: `''` = auto (zh, or en when `DSH_TUI_LANG=en`), `zh` / `en` pins it |
|
|
318
|
-
| `remoteSandbox` | string | `inherit` | which sandbox semantics remote operations follow (0.8.54+): `inherit` reads the mode the local `ctx.sandboxPolicy` resolved (read-only refuses remote writes/commands/forwards, workspace-write fences remote writes to the workspace root, danger-full-access allows everything); `off` disables the fence (legacy behaviour); an explicit mode name is also accepted. **This is containment, not a security boundary** — deploy hard boundaries on the remote side |
|
|
319
|
-
| `credentialFallback` | string | `refuse` | what to do when the OS secure store refuses a password (0.8.54+): `refuse` saves no password (the machine is still saved, the UI reports why, and nothing is written to machines.json in plaintext); `plain` restores the legacy plaintext fallback (with a warning). Turning encryption off explicitly (`backend: plain`) is unaffected |
|
|
320
|
-
|
|
321
|
-
> The authoritative list is the `Config` schema in `lib/index.js`; this table mirrors it.
|
|
322
|
-
|
|
323
|
-
## FAQ / troubleshooting
|
|
324
|
-
|
|
325
|
-
Quick answers first — the long root-cause stories moved to [docs/troubleshooting.en.md](https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/troubleshooting.en.md):
|
|
326
|
-
|
|
327
|
-
- **The built-in Files panel shows a LOCAL directory** — that is the mirror working copy (by design);
|
|
328
|
-
the live remote tree lives in the Remote Files tab (auto-opens on remote Sessions since 0.8.82).
|
|
329
|
-
- **Does the remote terminal still ask for the password?** — no: saved passwords are answered through
|
|
330
|
-
the local credential bridge (0.8.81+); OTP codes excepted.
|
|
331
|
-
- **A terminal in a remote Session opens on the remote host** — the shell menu's remote ssh is the
|
|
332
|
-
default shell (0.8.75+; `remoteTerminalDefault: false` opts out).
|
|
333
|
-
- **Host key changed** — `/remote forget-key` (or Settings → machine → trust again).
|
|
334
|
-
- **Authentication failed** — check username/password/key path; encrypted keys need the passphrase;
|
|
335
|
-
OTP needs keyboard-interactive.
|
|
336
|
-
- **Unreachable intranet host** — fill the Jump host field (register the bastion itself first);
|
|
337
|
-
multi-hop chains work (ProxyJump equivalent).
|
|
338
|
-
- **A container as a workspace** — yes; two recipes by whether the container exposes a port, see the manual.
|
|
339
|
-
|
|
340
|
-
The full troubleshooting handbook: **[docs/troubleshooting.en.md](https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/troubleshooting.en.md)**
|
|
341
|
-
(including the "remote DSH UI won't connect" chapter).
|
|
342
|
-
|
|
343
|
-
## Safety
|
|
344
|
-
|
|
345
|
-
Giving the plugin a machine's credentials lets the agent run **shell commands as your user** on that host — only add machines you trust. Passwords live in a local file (or the OS keychain); treat them as sensitive. With `auditLog` on, every command is recorded.
|
|
346
|
-
|
|
347
|
-
## License
|
|
348
|
-
|
|
349
|
-
MIT
|
|
350
|
-
|
|
351
|
-
## Contributing & credits
|
|
352
|
-
|
|
353
|
-
See [SUPPORT.md](https://github.com/flymysql/dsh-remote/blob/main/SUPPORT.md) for help and reporting, and the [1.0 upgrade guide](https://github.com/flymysql/dsh-remote/blob/main/docs/migration-1.0.md) for migration details.
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
Contributions are welcome — see [CONTRIBUTING.md](https://github.com/flymysql/dsh-remote/blob/main/CONTRIBUTING.md). Questions, setups and "is this supported?" go to [Discussions](https://github.com/flymysql/dsh-remote/discussions); reproducible bugs go to [Issues](https://github.com/flymysql/dsh-remote/issues).
|
|
73
|
+
Maintained by [@flymysql](https://github.com/flymysql) and the community · [MIT](https://github.com/flymysql/dsh-remote/blob/main/LICENSE)
|
|
357
74
|
|
|
75
|
+
### Contributors and credits
|
|
358
76
|
|
|
359
77
|
Thanks to everyone who makes this project better (avatars link to profiles; bots excluded):
|
|
360
78
|
|
|
@@ -377,6 +95,9 @@ Thanks to everyone who makes this project better (avatars link to profiles; bots
|
|
|
377
95
|
<a href="https://github.com/shis23"><img src="https://avatars.githubusercontent.com/u/189869650?s=80&v=4" width="40" height="40" alt="@shis23" title="@shis23" /></a>
|
|
378
96
|
</p>
|
|
379
97
|
|
|
98
|
+
<details>
|
|
99
|
+
<summary>Contribution highlights and earlier contributors</summary>
|
|
100
|
+
|
|
380
101
|
Recent highlight contributions (there is always room on this list):
|
|
381
102
|
|
|
382
103
|
| Contributor | What they did |
|
|
@@ -394,6 +115,7 @@ The older hand-kept roll of merged PRs (with their numbers):
|
|
|
394
115
|
[@dahaipeng](https://github.com/dahaipeng) (#31) ·
|
|
395
116
|
[@YiHui-Liu](https://github.com/YiHui-Liu) (#28) ·
|
|
396
117
|
[@nekomona](https://github.com/nekomona) (#24) ·
|
|
118
|
+
[@zhz1667](https://github.com/zhz1667) (#43) ·
|
|
397
119
|
[FoolishWiser](https://github.com/FoolishWiser) (#17) ·
|
|
398
120
|
[@jace1cch](https://github.com/jace1cch) (#16) ·
|
|
399
121
|
[@Minggle](https://github.com/Minggle) (#10) ·
|
|
@@ -403,6 +125,4 @@ The older hand-kept roll of merged PRs (with their numbers):
|
|
|
403
125
|
> The wall updates with releases; a well-written issue report, a repro, or a root-cause lead
|
|
404
126
|
> is worth as much as a patch — about half of this repo's fixes started as a clear issue.
|
|
405
127
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
See [CHANGELOG.md](https://github.com/flymysql/dsh-remote/blob/main/CHANGELOG.md).
|
|
128
|
+
</details>
|