dsh-remote 0.8.91 → 0.8.93

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.
Files changed (181) hide show
  1. package/LICENSE +21 -21
  2. package/README.en.md +369 -368
  3. package/README.md +354 -353
  4. package/cordis.patch.yml +9 -9
  5. package/lib/audit.js +45 -45
  6. package/lib/binding.js +172 -172
  7. package/lib/client.js +4647 -4550
  8. package/lib/credential.js +270 -263
  9. package/lib/errors.js +141 -141
  10. package/lib/exec-job.js +242 -242
  11. package/lib/file-reference.js +457 -457
  12. package/lib/forwards.js +258 -258
  13. package/lib/host-api.js +822 -822
  14. package/lib/hostkey.js +108 -108
  15. package/lib/http-transport.js +201 -201
  16. package/lib/ignore.js +202 -202
  17. package/lib/index.js +4488 -4394
  18. package/lib/instructions-dynamic.js +415 -415
  19. package/lib/instructions.js +288 -288
  20. package/lib/open-folder.js +56 -56
  21. package/lib/openssh.js +940 -881
  22. package/lib/paths.js +292 -292
  23. package/lib/pool.js +1029 -970
  24. package/lib/posix-shell.cjs +34 -0
  25. package/lib/registry.js +296 -296
  26. package/lib/remote-fs.js +173 -173
  27. package/lib/remote-sandbox.js +183 -183
  28. package/lib/remote-shell-child.cjs +397 -400
  29. package/lib/remote-shell.js +697 -697
  30. package/lib/remote-skills.js +312 -0
  31. package/lib/routes-audit.js +58 -58
  32. package/lib/routes-forwards.js +72 -72
  33. package/lib/routes-fs.js +251 -245
  34. package/lib/routes-machines.js +186 -186
  35. package/lib/routes-misc.js +187 -150
  36. package/lib/routes-term.js +169 -169
  37. package/lib/routes-update.js +143 -143
  38. package/lib/routes-web-attach.js +112 -112
  39. package/lib/routes-workspace.js +312 -312
  40. package/lib/search.js +235 -235
  41. package/lib/sftp-surface.js +119 -119
  42. package/lib/sshconfig.js +779 -779
  43. package/lib/sync.js +350 -350
  44. package/lib/tasks.js +95 -95
  45. package/lib/telemetry.js +247 -247
  46. package/lib/terminal.js +205 -205
  47. package/lib/tui/flow.js +130 -130
  48. package/lib/tui/format.js +380 -380
  49. package/lib/tui/i18n.js +350 -350
  50. package/lib/tui/index.js +531 -531
  51. package/lib/tui/provider.js +344 -344
  52. package/lib/tui/scene.js +986 -986
  53. package/lib/update.js +490 -472
  54. package/lib/web-attach.js +860 -850
  55. package/lib/workspace-cleanup.js +337 -337
  56. package/package.json +103 -100
  57. package/node_modules/buildcheck/.eslintrc.js +0 -5
  58. package/node_modules/buildcheck/.github/workflows/ci.yml +0 -88
  59. package/node_modules/buildcheck/.github/workflows/lint.yml +0 -27
  60. package/node_modules/buildcheck/.npmignore +0 -3
  61. package/node_modules/buildcheck/LICENSE +0 -19
  62. package/node_modules/buildcheck/README.md +0 -106
  63. package/node_modules/buildcheck/deps/Find-VisualStudio.cs +0 -250
  64. package/node_modules/buildcheck/lib/findvs.js +0 -361
  65. package/node_modules/buildcheck/lib/index.js +0 -738
  66. package/node_modules/buildcheck/package.json +0 -36
  67. package/node_modules/buildcheck/test/test.js +0 -8
  68. package/node_modules/cpu-features/.eslintrc.js +0 -5
  69. package/node_modules/cpu-features/.github/workflows/ci.yml +0 -74
  70. package/node_modules/cpu-features/.github/workflows/lint.yml +0 -27
  71. package/node_modules/cpu-features/LICENSE +0 -19
  72. package/node_modules/cpu-features/README.md +0 -59
  73. package/node_modules/cpu-features/binding.gyp +0 -16
  74. package/node_modules/cpu-features/buildcheck.js +0 -32
  75. package/node_modules/cpu-features/deps/cpu_features/.clang-format +0 -4
  76. package/node_modules/cpu-features/deps/cpu_features/.dockerignore +0 -31
  77. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +0 -5
  78. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +0 -30
  79. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +0 -22
  80. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +0 -26
  81. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +0 -31
  82. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +0 -43
  83. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +0 -25
  84. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +0 -31
  85. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +0 -24
  86. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +0 -30
  87. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +0 -29
  88. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +0 -28
  89. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +0 -27
  90. package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +0 -21
  91. package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +0 -329
  92. package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +0 -261
  93. package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +0 -23
  94. package/node_modules/cpu-features/deps/cpu_features/LICENSE +0 -230
  95. package/node_modules/cpu-features/deps/cpu_features/README.md +0 -272
  96. package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +0 -19
  97. package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +0 -5
  98. package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +0 -11
  99. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +0 -3
  100. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +0 -3
  101. package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +0 -30
  102. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +0 -252
  103. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +0 -40
  104. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +0 -64
  105. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +0 -312
  106. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +0 -7
  107. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +0 -48
  108. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +0 -34
  109. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +0 -22
  110. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +0 -11
  111. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +0 -107
  112. package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +0 -15
  113. package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +0 -105
  114. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +0 -54
  115. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +0 -384
  116. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +0 -259
  117. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +0 -121
  118. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +0 -74
  119. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +0 -149
  120. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +0 -72
  121. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +0 -108
  122. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +0 -288
  123. package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +0 -40
  124. package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +0 -37
  125. package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +0 -39
  126. package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +0 -240
  127. package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +0 -49
  128. package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +0 -110
  129. package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +0 -70
  130. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +0 -60
  131. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +0 -4
  132. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +0 -205
  133. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +0 -320
  134. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +0 -12
  135. package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +0 -456
  136. package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +0 -165
  137. package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +0 -75
  138. package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +0 -490
  139. package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +0 -79
  140. package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +0 -19
  141. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +0 -86
  142. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +0 -26
  143. package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +0 -22
  144. package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +0 -62
  145. package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +0 -169
  146. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +0 -88
  147. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +0 -79
  148. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +0 -82
  149. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +0 -138
  150. package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +0 -212
  151. package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +0 -93
  152. package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +0 -163
  153. package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +0 -111
  154. package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +0 -120
  155. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +0 -2055
  156. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +0 -68
  157. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +0 -58
  158. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +0 -57
  159. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +0 -58
  160. package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +0 -132
  161. package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +0 -192
  162. package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +0 -461
  163. package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +0 -114
  164. package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +0 -53
  165. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +0 -396
  166. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +0 -384
  167. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +0 -176
  168. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +0 -131
  169. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +0 -180
  170. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +0 -82
  171. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +0 -1729
  172. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +0 -103
  173. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +0 -61
  174. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +0 -52
  175. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +0 -31
  176. package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +0 -132
  177. package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +0 -202
  178. package/node_modules/cpu-features/lib/index.js +0 -5
  179. package/node_modules/cpu-features/package.json +0 -40
  180. package/node_modules/cpu-features/src/binding.cc +0 -151
  181. package/node_modules/cpu-features/test/test.js +0 -12
package/README.en.md CHANGED
@@ -1,369 +1,370 @@
1
- **English** · [中文](./README.md)
2
-
3
- ---
4
-
5
- # dsh-remote
6
-
7
- [![npm version](https://img.shields.io/npm/v/dsh-remote)](https://www.npmjs.com/package/dsh-remote)
8
- [![downloads](https://img.shields.io/npm/dw/dsh-remote)](https://www.npmjs.com/package/dsh-remote)
9
- [![downloads](https://img.shields.io/npm/dm/dsh-remote)](https://www.npmjs.com/package/dsh-remote)
10
- [![license](https://img.shields.io/github/license/flymysql/dsh-remote)](LICENSE)
11
- [![dsh-plugin](https://img.shields.io/badge/topic-dsh--plugin-7a3ef3)](https://github.com/topics/dsh-plugin)
12
-
13
- 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) · [中文说明](./README.md)
14
-
15
- ![dsh-remote — make any SSH machine a real DSH workspace](docs/cover.png)
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
- ## Screen previews
26
-
27
- **Settings → 远程工作区** — hosts from `~/.ssh/config`, advanced config (key / jump host / agent), remote DSH Web UI, port forwarding, audit log, update:
28
-
29
- <img src="docs/shots/settings-panel.png" alt="dsh-remote settings: host list, connect, pick folder, remote DSH Web UI, port forwarding, audit log, update" width="612"/>
30
-
31
- The native **"Add workspace"** flow — a centered modal with two tabs, opening on Local; here switched to **Remote**:
32
-
33
- <img src="docs/shots/picker-dialog.png" alt="The 远程 (remote) tab of the workspace picker: machine select, recent workspaces, browse, set-as-remote-workspace" width="632"/>
34
-
35
- - The path field autocompletes live; on Windows hosts the root shows a multi-drive view; the floating browser fills the field without committing.
36
- - On confirm a **real local mirror** is created and adopted by the harness, kept in sync over SFTP; the choice persists on the machine.
37
- - A remote workspace is named **`<machine>-<folder>` at creation** (e.g. `code-server-xdfs`), so it never collides with a local folder of the same name; rename it later from the sidebar if you prefer.
38
-
39
- ---
40
-
41
- ## Features
42
-
43
- ![Capabilities at a glance — multi-machine SSH, live alias resolution, the two-tab picker, three-way sync, remote @ completion, a remote DSH Web UI in your local browser, audit, port forwarding, sidebar editing, self-update, and the 21 rw_* tools](docs/shots/features.png)
44
-
45
- The image above is the overview. What follows is only what the image does not make obvious.
46
-
47
- **Workspace picker** (fills the native "Add workspace" flow) — Local uses the system folder chooser; Remote browses inside the modal:
48
-
49
- <img src="docs/shots/picker-dialog.png" alt="The 远程 (remote) tab of the workspace picker: machine select, recent workspaces, browse, set-as-remote-workspace" width="632"/>
50
-
51
- - The path field autocompletes live; on Windows hosts the root shows a multi-drive view; the floating browser fills the field without committing.
52
- - On confirm a **real local mirror** is created and adopted by the harness, kept in sync over SFTP; the choice persists on the machine.
53
-
54
- **Settings** (hosts from `~/.ssh/config`, port forwarding, audit log, update mode):
55
-
56
- <img src="docs/shots/settings-panel.png" alt="dsh-remote settings: host list, connect, pick folder, remote DSH Web UI, port forwarding, audit log, update" width="612"/>
57
-
58
- The rest:
59
-
60
- - **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`.
61
- - **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.
62
- - **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.
63
- - **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.
64
- - **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.
65
- - **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).
66
- - **Cross-platform remotes** — all file access is SFTP-protocol-level (no POSIX shell), so Linux/macOS/Windows remotes all work.
67
- - **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.
68
- - **Async long tasks** — `rw_sync`/`rw_push` with `async: true` return a `taskId` with progress/result/cancel.
69
- - **Data lives under the harness home** — machines and mirrors follow `$DSH_HOME`; pre-0.6 data migrates automatically on first run.
70
- - **No `dsh-workspace` core changes** — everything ships as a normal plugin.
71
- - **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.
72
-
73
- ## Install
74
-
75
- ### DSH version compatibility
76
-
77
- 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):
78
-
79
- ```
80
- dsh: skipping profile bundle "dsh-remote": Error: Plugin dsh-remote@… is incompatible …
81
- ```
82
-
83
- A caret on `0.x` is locked to that minor line (`^0.1.x` cannot admit `0.2.x`, and vice versa), so since **0.8.29** the ranges are cross-line intervals: `>=0.1.0-rc.6 <0.3.0`. **If you are below 0.8.29, upgrade the plugin before you upgrade DSH.**
84
-
85
- ### Official Desktop compatibility (experimental)
86
-
87
- A compatibility path for the [official DeepSeek Harness Desktop](https://github.com/deepseek-ai/deepseek-harness), tested against the `0.1.5-rc.2` Host transport; it does not replace the harness core or require a listening Web server:
88
-
89
- - SSH settings and the directory picker use `/api/dsh-remote/*` over the Desktop's `dsh-app:` carrier (registered on `ctx.connection.fetch`).
90
- - A native Remote Files entry uses `sidebarRightTabs`, giving remote files session-scoped resource addresses instead of sending remote paths to the local Files viewer.
91
- - `dsh-better-sidebar` is not bundled; official Desktop uses the native right sidebar.
92
-
93
- Verified: host startup, IPC requests, real SSH read-only connect/list/read, and per-session routing (sidebar `/ls` `/read` `/write` `/fs` with `sessionId`). The native file-tab GUI, failed/cancelled dialogs and non-macOS hosts remain experimental. The Desktop installer may need an explicit policy for the optional `ssh2` / `cpu-features` build scripts.
94
-
95
- ### Published Web bundle
96
-
97
- ```bash
98
- dsh plugin add dsh-remote
99
- ```
100
-
101
- Since **v0.8.18** it installs and mounts only itself; the Web sidebar ([dsh-better-sidebar](https://www.npmjs.com/package/dsh-better-sidebar)) is optional. Install it separately if you want the Web remote file explorer/editor — without it the `rw_*` tools, settings UI, sync, audit log and port forwarding all still work.
102
-
103
- > **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.
104
-
105
- (or `npm install dsh-remote` + add `- id: dsh-remote / name: dsh-remote` in `cordis.patch.yml`).
106
-
107
- ## Quick start
108
-
109
- 1. **Connect a machine** — Settings → 远程工作区: the page **lists the hosts from your `~/.ssh/config`** (like VSCode Remote-SSH). Click **Connect** — it adopts the host, makes it current and probes it, with the result shown on that row. A machine that is *not* in your ssh config is added by **Open config** (edit a Host block, then Refresh). **Edit** on a saved machine is only for what ssh config cannot store (a password, the OpenSSH backend, the remote dsh command).
110
- > **Saved ≠ active:** a saved machine is only a standby connection; only Connect (or the agent's `rw_connect`) puts it into the session's remote context.
111
- 2. **Open a workspace** — the folder picker opens right after a successful connect (or click **选目录** on any saved machine):
112
- - **Remote** → browse to a remote directory (or type `/path`) → "设为远程工作区" ⇒ a local mirror workspace is created and adopted.
113
- - **Local** → system folder chooser (or type a path) → local workspace. Falls back to the in-app browser when no OS dialog exists.
114
- 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).
115
-
116
- > **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.
117
-
118
- ## Open a remote machine's DSH Web UI locally
119
-
120
- 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":
121
-
122
- > **The remote opens no port.** DSH deliberately refuses `--host 0.0.0.0` (it would put remote
123
- > code execution on the network), so the correct shape is: SSH out, start a `dsh web` on the remote
124
- > that listens on **127.0.0.1 only**, and carry its port back over the SSH connection to a loopback
125
- > port here.
126
-
127
- Usage: Settings → Remote workspaces → **"Remote DSH Web UI"** → pick a machine → **Connect & open**.
128
- A new tab opens showing that remote machine's full DSH interface (chat, tool tree, settings).
129
-
130
- - The URL looks like `http://127.0.0.1:3088/?token=…`. That token is a one-time credential the remote
131
- process prints at startup and is used once, on this machine, by that redirect: DSH exchanges it for a
132
- 30-day signed cookie and lands on a clean `/`. **Do not share that tokenized URL.**
133
- - "Disconnect" only closes the tunnel and deliberately does **not** kill the remote process (it may be
134
- an instance you use elsewhere). "Disconnect & stop remote" also ends the process — but only one this
135
- plugin started.
136
- - If the remote already runs an interface (for example one you started in a terminal), pick the machine
137
- and paste its `http://127.0.0.1:<port>/?token=…` into the field, then "Attach to running instance" —
138
- no second instance will be started.
139
- - When the remote `dsh` is not on the SSH login PATH, point `webAttachCommand` at its absolute path; to
140
- keep an attached instance out of the remote user's own sessions and settings, point `webAttachDshHome`
141
- at a scratch directory. This is **per machine**: Settings → Remote workspace → the machine card →
142
- expand "Advanced" → "Remote dsh command" (e.g.
143
- `/home/you/.nvm/versions/node/v22.19.0/bin/node /home/you/.dsh-remote/dsh/node_modules/@deepseek-ai/dsh/lib/bin.js`).
144
- Empty falls back to the global `webAttachCommand`.
145
- - The tunnel follows the SSH connection: when it drops, the UI shows "Disconnected" and the local DSH
146
- process is **not** affected. After the pool reconnects the plugin re-resolves the remote port (restarting
147
- the remote process it started, if that one died), so hitting "Reconnect" is enough to carry on.
148
- - The remote node must be **≥ 20.12** (booting dsh needs `parseEnv` from `node:util`, which only exists
149
- from 20.12). On an older node npm only warns (EBADENGINE) and installs anyway, and the crash arrives
150
- later as `does not provide an export named 'parseEnv'` — check the version before you install.
151
-
152
- ## Use it from the TUI (dsh-tui)
153
-
154
- The plugin ships a TUI adaptation layer: once installed into a `dsh-tui` profile, the same
155
- machine registry, SSH pool and remote workspaces work in the terminal UI — **without patching
156
- dsh-tui itself** (everything registers through its plugin seams).
157
-
158
- ```bash
159
- # On a machine that already runs dsh-tui this is the only step; a local checkout works too
160
- dsh plugin --profile dsh-tui add dsh-remote
161
- # or: dsh plugin --profile dsh-tui add /path/to/dsh-remote
162
- ```
163
-
164
- Restart dsh-tui afterwards. What you get:
165
-
166
- - `/dsh-remote` — a full-screen server page (add/edit/delete, connect, probe, browse, set-as-workspace, cleanup);
167
- - the `/workspace` picker lists remote projects directly (or go straight: `dshremote://<machine>/<path>`);
168
- - the status bar names the current remote machine (remote Sessions only; hover for details).
169
-
170
- Web profiles are unaffected: without the terminal seams the layer stays off, silently. Keymap,
171
- cleanup semantics, the host-API contract and the limits live in **[docs/tui.md](docs/tui.md)** (Chinese).
172
-
173
- ## CLI defaults (optional)
174
-
175
- Provide a default machine in `cordis.patch.yml`:
176
-
177
- ```yaml
178
- # Example only — use values for your own machine.
179
- - id: dsh-remote
180
- name: dsh-remote
181
- config:
182
- host: 203.0.113.10 # or your real host / hostname
183
- port: 22
184
- username: dev
185
- privateKeyPath: ~/.ssh/id_rsa
186
- # or password: '…'
187
- workspace: ~/project
188
- ```
189
-
190
- If `host` is empty the plugin starts disconnected and you configure machines in the UI.
191
-
192
- ## CLI quick reference
193
-
194
- 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`).
195
-
196
- ```bash
197
- # install the bundle into a profile (npm is pulled by pnpm; recommended)
198
- dsh plugin --profile web add dsh-remote
199
- # same but when `dsh` is not on PATH (e.g. Windows PowerShell inside a repo)
200
- npx --yes @deepseek-ai/dsh plugin --profile web add dsh-remote
201
-
202
- # confirm it is installed wire
203
- dsh plugin --profile web list
204
- npx --yes @deepseek-ai/dsh plugin --profile web list
205
-
206
- # start the web surface (reload profile; the plugin activates on boot)
207
- dsh --profile web
208
- npx --yes @deepseek-ai/dsh --profile web # http://127.0.0.1:3080
209
-
210
- # use a local checkout instead of the npm version (dev iteration)
211
- npx --yes @deepseek-ai/dsh plugin --profile web add /path/to/dsh-remote
212
- npx --yes @deepseek-ai/dsh plugin --profile web remove dsh-remote # back to release
213
- ```
214
-
215
- After a successful start, `Settings → 远程工作区` appears and the "Add workspace" flow gains the 本机 / 远程 tabs (screenshots above).
216
-
217
- ## Development (sandbox, not product)
218
-
219
- Iterate in the sandbox — hand-editing a product profile is reverted by the plugin manager on reinstall:
220
-
221
- ```bash
222
- scripts/dev-run.sh --restart # start / restart the isolated sandbox
223
- scripts/dev-run.sh --stop # stop it
224
- scripts/dev-run.sh --status # is it running?
225
- ```
226
-
227
- - The sandbox runs its own DSH instance (`dev-harness/harness`), serving on `http://127.0.0.1:50599`.
228
- - **Host-half** (`lib/index.js`) changes need `--restart`; **client-half** (`lib/client.js`) changes need only a page refresh.
229
- - The script hardlink-copies `lib/` into the sandbox rather than symlinking — a symlink breaks `@deepseek-ai/*` resolution.
230
- - Before committing: `node check.mjs` (framework-constraint gate) and `npm test`; `scripts/boot-smoke.sh` proves the plugin still starts.
231
- - Full rules live in `scripts/dev-standards.md`.
232
-
233
- Deploying to a product profile is a separate, explicit action (`./sync.sh`) for releases only.
234
-
235
- ## Configuration
236
-
237
- | Key | Type | Default | Meaning |
238
- | --- | --- | --- | --- |
239
- | `host` | string | `''` | default SSH host (else start disconnected) |
240
- | `port` | int | `22` | default SSH port |
241
- | `username` | string | `''` | default SSH user |
242
- | `password` | string | `''` | default SSH password (non-empty overrides key) |
243
- | `privateKeyPath` | string | `''` | private key path (used only when explicitly provided) |
244
- | `passphrase` | string | `''` | passphrase for an encrypted private key |
245
- | `workspace` | string | `''` | default remote workspace path |
246
- | `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`) |
247
- | `commandTimeoutMs` | int | 20000 | per remote command timeout |
248
- | `connectTimeoutMs` | int | 15000 | SSH connect timeout |
249
- | `maxOutputChars` | int | 200000 | cap on captured stdout/stderr per remote command |
250
- | `maxFileBytes` | int | 52428800 | skip mirroring/reading files larger than this (0 = no cap) |
251
- | `hostKeyMode` | string | `accept-new` | host-key policy: `accept-new` (TOFU), `verify` (reject unknown hosts), `off` (skip) |
252
- | `useAgent` | bool | `false` | authenticate via the OpenSSH agent (`SSH_AUTH_SOCK`) |
253
- | `keyboardInteractive` | bool | `false` | allow keyboard-interactive auth (OTP/MFA) with the configured password |
254
- | `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` |
255
- | `sshBinary` | string | `''` | the `ssh` executable the `openssh` backend drives (empty = the `ssh` on PATH) |
256
- | `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) |
257
- | `autoPush` | bool | `false` | auto-push edited mirror files back to the remote (watcher, debounced) |
258
- | `auditLog` | bool | `true` | append executed commands to `$DSH_HOME/remote-workspaces/audit.log` |
259
- | `encoding` | string | `utf-8` | text encoding for remote file reads/writes (e.g. `gbk`) |
260
- | `fileReference` | bool | `true` | remote `@` completion: in a remote session `@` lists the **remote** tree over SFTP (issue #39); off → only the local mirror |
261
- | `fileReferenceMaxResults` | int | `20` | max `@` candidates rendered for one query |
262
- | `fileReferenceMaxEntries` | int | `3000` | max entries retained in one remote workspace's `@` index |
263
- | `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 |
264
- | `fileReferenceTimeoutMs` | int | `4000` | wall-clock budget for one remote `@` index pass (on expiry the partial index answers rather than making the caret wait) |
265
- | `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). |
266
- | `searchMaxEntries` | int | `50000` | Max files `rw_search` scans before returning partial results. |
267
- | `updateMode` | string | `auto` | self-update behaviour: `auto` checks npm on load and every 6h 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 |
268
- | `updateCheckIntervalMs` | int | 21600000 (6h) | how often `auto` mode checks npm (floor 60000) |
269
- | `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` |
270
- | `webAttachPortStart` | int | `3088` | first local port for the "Remote DSH Web UI" tunnel (later ports are tried when taken; loopback only) |
271
- | `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) |
272
- | `webAttachDshHome` | string | `''` | `DSH_HOME` exported on the remote when attaching; empty reuses the remote user's own harness home |
273
- | `webAttachWaitSeconds` | int | `45` | how long to wait for a freshly started remote `dsh web` to print its launch token |
274
- | `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` |
275
- | `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 |
276
- | `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 |
277
- | `tui` | bool | `true` | master switch for the TUI (dsh-tui) layer; `false` registers no `/dsh-remote` page, workspace provider or status field |
278
- | `tuiProviderListRecent` | bool | `true` | list each machine's recent remote projects in the TUI workspace picker |
279
- | `tuiProviderRecentLimit` | int | `5` | recent remote projects listed per machine (1–20) |
280
- | `tuiAutoSwitchWorkspace` | bool | `true` | switch the session right after pressing `w` (set as workspace) in the directory browser |
281
- | `tuiLang` | string | `''` | language of the TUI layer's own copy: `''` = auto (zh, or en when `DSH_TUI_LANG=en`), `zh` / `en` pins it |
282
- | `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 |
283
- | `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 |
284
-
285
- > The authoritative list is the `Config` schema in `lib/index.js`; this table mirrors it.
286
-
287
- ## FAQ / troubleshooting
288
-
289
- Quick answers first — the long root-cause stories moved to [docs/troubleshooting.en.md](docs/troubleshooting.en.md):
290
-
291
- - **The built-in Files panel shows a LOCAL directory** — that is the mirror working copy (by design);
292
- the live remote tree lives in the Remote Files tab (auto-opens on remote Sessions since 0.8.82).
293
- - **Does the remote terminal still ask for the password?** — no: saved passwords are answered through
294
- the local credential bridge (0.8.81+); OTP codes excepted.
295
- - **A terminal in a remote Session opens on the remote host** — the shell menu's remote ssh is the
296
- default shell (0.8.75+; `remoteTerminalDefault: false` opts out).
297
- - **Host key changed** — `/remote forget-key` (or Settings → machine → trust again).
298
- - **Authentication failed** — check username/password/key path; encrypted keys need the passphrase;
299
- OTP needs keyboard-interactive.
300
- - **Unreachable intranet host** — fill the Jump host field (register the bastion itself first);
301
- multi-hop chains work (ProxyJump equivalent).
302
- - **A container as a workspace** — yes; two recipes by whether the container exposes a port, see the manual.
303
-
304
- The full troubleshooting handbook: **[docs/troubleshooting.en.md](docs/troubleshooting.en.md)**
305
- (including the "remote DSH UI won't connect" chapter).
306
-
307
- ## Safety
308
-
309
- 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.
310
-
311
- ## License
312
-
313
- MIT
314
-
315
- ## Contributing & credits
316
-
317
- Contributions are welcome — see [CONTRIBUTING.md](./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).
318
-
319
-
320
- Thanks to everyone who makes this project better (avatars link to profiles; bots excluded):
321
-
322
- <p align="left">
323
- <a href="https://github.com/flymysql"><img src="https://avatars.githubusercontent.com/u/37113068?s=80&v=4" width="40" height="40" alt="@flymysql" title="@flymysql" /></a>
324
- <a href="https://github.com/baiseraku"><img src="https://avatars.githubusercontent.com/u/139727690?s=80&v=4" width="40" height="40" alt="@baiseraku" title="@baiseraku" /></a>
325
- <a href="https://github.com/glzhangzhi"><img src="https://avatars.githubusercontent.com/u/36995275?s=80&v=4" width="40" height="40" alt="@glzhangzhi" title="@glzhangzhi" /></a>
326
- <a href="https://github.com/hjwsm1989"><img src="https://avatars.githubusercontent.com/u/1067541?s=80&v=4" width="40" height="40" alt="@hjwsm1989" title="@hjwsm1989" /></a>
327
- <a href="https://github.com/j10ha0"><img src="https://avatars.githubusercontent.com/u/72346906?s=80&v=4" width="40" height="40" alt="@j10ha0" title="@j10ha0" /></a>
328
- <a href="https://github.com/FoolishWiser"><img src="https://avatars.githubusercontent.com/u/104308087?s=80&v=4" width="40" height="40" alt="@FoolishWiser" title="@FoolishWiser" /></a>
329
- <a href="https://github.com/kakaa-nju"><img src="https://avatars.githubusercontent.com/u/79886619?s=80&v=4" width="40" height="40" alt="@kakaa-nju" title="@kakaa-nju" /></a>
330
- <a href="https://github.com/4FMTWRV"><img src="https://avatars.githubusercontent.com/u/190457700?s=80&v=4" width="40" height="40" alt="@4FMTWRV" title="@4FMTWRV" /></a>
331
- <a href="https://github.com/dahaipeng"><img src="https://avatars.githubusercontent.com/u/25660610?s=80&v=4" width="40" height="40" alt="@dahaipeng" title="@dahaipeng" /></a>
332
- <a href="https://github.com/davidlin2k"><img src="https://avatars.githubusercontent.com/u/17074619?s=80&v=4" width="40" height="40" alt="@davidlin2k" title="@davidlin2k" /></a>
333
- <a href="https://github.com/FlintyLemming"><img src="https://avatars.githubusercontent.com/u/19165511?s=80&v=4" width="40" height="40" alt="@FlintyLemming" title="@FlintyLemming" /></a>
334
- <a href="https://github.com/GDWhisper"><img src="https://avatars.githubusercontent.com/u/129148123?s=80&v=4" width="40" height="40" alt="@GDWhisper" title="@GDWhisper" /></a>
335
- <a href="https://github.com/YiHui-Liu"><img src="https://avatars.githubusercontent.com/u/30190271?s=80&v=4" width="40" height="40" alt="@YiHui-Liu" title="@YiHui-Liu" /></a>
336
- <a href="https://github.com/Minggle"><img src="https://avatars.githubusercontent.com/u/35053182?s=80&v=4" width="40" height="40" alt="@Minggle" title="@Minggle" /></a>
337
- <a href="https://github.com/nekomona"><img src="https://avatars.githubusercontent.com/u/25474483?s=80&v=4" width="40" height="40" alt="@nekomona" title="@nekomona" /></a>
338
- <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>
339
- </p>
340
-
341
- Recent highlight contributions (there is always room on this list):
342
-
343
- | Contributor | What they did |
344
- | --- | --- |
345
- | [@baiseraku](https://github.com/baiseraku) | the whole dsh-tui adaptation layer ([#92](https://github.com/flymysql/dsh-remote/pull/92)) + the status-bar fix ([#98](https://github.com/flymysql/dsh-remote/pull/98)) |
346
- | [@hjwsm1989](https://github.com/hjwsm1989) | both remote-.md renderer fixes: the memo guard ([#102](https://github.com/flymysql/dsh-remote/pull/102)) and the labels contract ([#107](https://github.com/flymysql/dsh-remote/pull/107)) |
347
- | [@shis23](https://github.com/shis23) | rw_sync path-mapping fix + SFTP timeout resilience ([#105](https://github.com/flymysql/dsh-remote/pull/105)) |
348
- | [@davidlin2k](https://github.com/davidlin2k) | dialing credential-less machines through the user's own ssh ([#100](https://github.com/flymysql/dsh-remote/pull/100)) |
349
- | [@GDWhisper](https://github.com/GDWhisper) | the per-keystroke completion reconnect fix ([#42](https://github.com/flymysql/dsh-remote/pull/42), issue #41) |
350
- | [@glzhangzhi](https://github.com/glzhangzhi) | the per-session SSH pool isolation behind issue #25 |
351
-
352
- The older hand-kept roll of merged PRs (with their numbers):
353
-
354
-
355
- [@dahaipeng](https://github.com/dahaipeng) (#31) ·
356
- [@YiHui-Liu](https://github.com/YiHui-Liu) (#28) ·
357
- [@nekomona](https://github.com/nekomona) (#24) ·
358
- [FoolishWiser](https://github.com/FoolishWiser) (#17) ·
359
- [@jace1cch](https://github.com/jace1cch) (#16) ·
360
- [@Minggle](https://github.com/Minggle) (#10) ·
361
- [4FMTWRV](https://github.com/4FMTWRV) (#6) ·
362
- [glzhangzhi](https://github.com/glzhangzhi) (per-session SSH pool fix)
363
-
364
- > The wall updates with releases; a well-written issue report, a repro, or a root-cause lead
365
- > is worth as much as a patch — about half of this repo's fixes started as a clear issue.
366
-
367
- ## Changelog
368
-
1
+ **English** · [中文](./README.md)
2
+
3
+ ---
4
+
5
+ # dsh-remote
6
+
7
+ [![npm version](https://img.shields.io/npm/v/dsh-remote)](https://www.npmjs.com/package/dsh-remote)
8
+ [![downloads](https://img.shields.io/npm/dw/dsh-remote)](https://www.npmjs.com/package/dsh-remote)
9
+ [![downloads](https://img.shields.io/npm/dm/dsh-remote)](https://www.npmjs.com/package/dsh-remote)
10
+ [![license](https://img.shields.io/github/license/flymysql/dsh-remote)](LICENSE)
11
+ [![dsh-plugin](https://img.shields.io/badge/topic-dsh--plugin-7a3ef3)](https://github.com/topics/dsh-plugin)
12
+
13
+ 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) · [中文说明](./README.md)
14
+
15
+ ![dsh-remote — make any SSH machine a real DSH workspace](docs/cover.png)
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
+ ## Screen previews
26
+
27
+ **Settings → 远程工作区** — hosts from `~/.ssh/config`, advanced config (key / jump host / agent), remote DSH Web UI, port forwarding, audit log, update:
28
+
29
+ <img src="docs/shots/settings-panel.png" alt="dsh-remote settings: host list, connect, pick folder, remote DSH Web UI, port forwarding, audit log, update" width="612"/>
30
+
31
+ The native **"Add workspace"** flow — a centered modal with two tabs, opening on Local; here switched to **Remote**:
32
+
33
+ <img src="docs/shots/picker-dialog.png" alt="The 远程 (remote) tab of the workspace picker: machine select, recent workspaces, browse, set-as-remote-workspace" width="632"/>
34
+
35
+ - The path field autocompletes live; on Windows hosts the root shows a multi-drive view; the floating browser fills the field without committing.
36
+ - On confirm a **real local mirror** is created and adopted by the harness, kept in sync over SFTP; the choice persists on the machine.
37
+ - A remote workspace is named **`<machine>-<folder>` at creation** (e.g. `code-server-xdfs`), so it never collides with a local folder of the same name; rename it later from the sidebar if you prefer.
38
+
39
+ ---
40
+
41
+ ## Features
42
+
43
+ ![Capabilities at a glance — multi-machine SSH, live alias resolution, the two-tab picker, three-way sync, remote @ completion, a remote DSH Web UI in your local browser, audit, port forwarding, sidebar editing, self-update, and the 21 rw_* tools](docs/shots/features.png)
44
+
45
+ The image above is the overview. What follows is only what the image does not make obvious.
46
+
47
+ **Workspace picker** (fills the native "Add workspace" flow) — Local uses the system folder chooser; Remote browses inside the modal:
48
+
49
+ <img src="docs/shots/picker-dialog.png" alt="The 远程 (remote) tab of the workspace picker: machine select, recent workspaces, browse, set-as-remote-workspace" width="632"/>
50
+
51
+ - The path field autocompletes live; on Windows hosts the root shows a multi-drive view; the floating browser fills the field without committing.
52
+ - On confirm a **real local mirror** is created and adopted by the harness, kept in sync over SFTP; the choice persists on the machine.
53
+
54
+ **Settings** (hosts from `~/.ssh/config`, port forwarding, audit log, update mode):
55
+
56
+ <img src="docs/shots/settings-panel.png" alt="dsh-remote settings: host list, connect, pick folder, remote DSH Web UI, port forwarding, audit log, update" width="612"/>
57
+
58
+ The rest:
59
+
60
+ - **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`.
61
+ - **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.
62
+ - **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.
63
+ - **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.
64
+ - **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.
65
+ - **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.
66
+ - **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).
67
+ - **Cross-platform remotes** — all file access is SFTP-protocol-level (no POSIX shell), so Linux/macOS/Windows remotes all work.
68
+ - **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.
69
+ - **Async long tasks** — `rw_sync`/`rw_push` with `async: true` return a `taskId` with progress/result/cancel.
70
+ - **Data lives under the harness home** — machines and mirrors follow `$DSH_HOME`; pre-0.6 data migrates automatically on first run.
71
+ - **No `dsh-workspace` core changes** — everything ships as a normal plugin.
72
+ - **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.
73
+
74
+ ## Install
75
+
76
+ ### DSH version compatibility
77
+
78
+ 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):
79
+
80
+ ```
81
+ dsh: skipping profile bundle "dsh-remote": Error: Plugin dsh-remote@… is incompatible …
82
+ ```
83
+
84
+ A caret on `0.x` is locked to that minor line (`^0.1.x` cannot admit `0.2.x`, and vice versa), so since **0.8.29** the ranges are cross-line intervals: `>=0.1.0-rc.6 <0.3.0`. **If you are below 0.8.29, upgrade the plugin before you upgrade DSH.**
85
+
86
+ ### Official Desktop compatibility (experimental)
87
+
88
+ A compatibility path for the [official DeepSeek Harness Desktop](https://github.com/deepseek-ai/deepseek-harness), tested against the `0.1.5-rc.2` Host transport; it does not replace the harness core or require a listening Web server:
89
+
90
+ - SSH settings and the directory picker use `/api/dsh-remote/*` over the Desktop's `dsh-app:` carrier (registered on `ctx.connection.fetch`).
91
+ - A native Remote Files entry uses `sidebarRightTabs`, giving remote files session-scoped resource addresses instead of sending remote paths to the local Files viewer.
92
+ - `dsh-better-sidebar` is not bundled; official Desktop uses the native right sidebar.
93
+
94
+ Verified: host startup, IPC requests, real SSH read-only connect/list/read, and per-session routing (sidebar `/ls` `/read` `/write` `/fs` with `sessionId`). The native file-tab GUI, failed/cancelled dialogs and non-macOS hosts remain experimental. The Desktop installer may need an explicit policy for the optional `ssh2` / `cpu-features` build scripts.
95
+
96
+ ### Published Web bundle
97
+
98
+ ```bash
99
+ dsh plugin add dsh-remote
100
+ ```
101
+
102
+ Since **v0.8.18** it installs and mounts only itself; the Web sidebar ([dsh-better-sidebar](https://www.npmjs.com/package/dsh-better-sidebar)) is optional. Install it separately if you want the Web remote file explorer/editor — without it the `rw_*` tools, settings UI, sync, audit log and port forwarding all still work.
103
+
104
+ > **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.
105
+
106
+ (or `npm install dsh-remote` + add `- id: dsh-remote / name: dsh-remote` in `cordis.patch.yml`).
107
+
108
+ ## Quick start
109
+
110
+ 1. **Connect a machine** — Settings → 远程工作区: the page **lists the hosts from your `~/.ssh/config`** (like VSCode Remote-SSH). Click **Connect** — it adopts the host, makes it current and probes it, with the result shown on that row. A machine that is *not* in your ssh config is added by **Open config** (edit a Host block, then Refresh). **Edit** on a saved machine is only for what ssh config cannot store (a password, the OpenSSH backend, the remote dsh command).
111
+ > **Saved ≠ active:** a saved machine is only a standby connection; only Connect (or the agent's `rw_connect`) puts it into the session's remote context.
112
+ 2. **Open a workspace** — the folder picker opens right after a successful connect (or click **选目录** on any saved machine):
113
+ - **Remote** → browse to a remote directory (or type `/path`) → "设为远程工作区" ⇒ a local mirror workspace is created and adopted.
114
+ - **Local** → system folder chooser (or type a path) → local workspace. Falls back to the in-app browser when no OS dialog exists.
115
+ 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).
116
+
117
+ > **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.
118
+
119
+ ## Open a remote machine's DSH Web UI locally
120
+
121
+ 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":
122
+
123
+ > **The remote opens no port.** DSH deliberately refuses `--host 0.0.0.0` (it would put remote
124
+ > code execution on the network), so the correct shape is: SSH out, start a `dsh web` on the remote
125
+ > that listens on **127.0.0.1 only**, and carry its port back over the SSH connection to a loopback
126
+ > port here.
127
+
128
+ Usage: Settings → Remote workspaces → **"Remote DSH Web UI"** → pick a machine → **Connect & open**.
129
+ A new tab opens showing that remote machine's full DSH interface (chat, tool tree, settings).
130
+
131
+ - The URL looks like `http://127.0.0.1:3088/?token=…`. That token is a one-time credential the remote
132
+ process prints at startup and is used once, on this machine, by that redirect: DSH exchanges it for a
133
+ 30-day signed cookie and lands on a clean `/`. **Do not share that tokenized URL.**
134
+ - "Disconnect" only closes the tunnel and deliberately does **not** kill the remote process (it may be
135
+ an instance you use elsewhere). "Disconnect & stop remote" also ends the process — but only one this
136
+ plugin started.
137
+ - If the remote already runs an interface (for example one you started in a terminal), pick the machine
138
+ and paste its `http://127.0.0.1:<port>/?token=…` into the field, then "Attach to running instance" —
139
+ no second instance will be started.
140
+ - When the remote `dsh` is not on the SSH login PATH, point `webAttachCommand` at its absolute path; to
141
+ keep an attached instance out of the remote user's own sessions and settings, point `webAttachDshHome`
142
+ at a scratch directory. This is **per machine**: Settings → Remote workspace → the machine card →
143
+ expand "Advanced" → "Remote dsh command" (e.g.
144
+ `/home/you/.nvm/versions/node/v22.19.0/bin/node /home/you/.dsh-remote/dsh/node_modules/@deepseek-ai/dsh/lib/bin.js`).
145
+ Empty falls back to the global `webAttachCommand`.
146
+ - The tunnel follows the SSH connection: when it drops, the UI shows "Disconnected" and the local DSH
147
+ process is **not** affected. After the pool reconnects the plugin re-resolves the remote port (restarting
148
+ the remote process it started, if that one died), so hitting "Reconnect" is enough to carry on.
149
+ - The remote node must be **≥ 20.12** (booting dsh needs `parseEnv` from `node:util`, which only exists
150
+ from 20.12). On an older node npm only warns (EBADENGINE) and installs anyway, and the crash arrives
151
+ later as `does not provide an export named 'parseEnv'` — check the version before you install.
152
+
153
+ ## Use it from the TUI (dsh-tui)
154
+
155
+ The plugin ships a TUI adaptation layer: once installed into a `dsh-tui` profile, the same
156
+ machine registry, SSH pool and remote workspaces work in the terminal UI — **without patching
157
+ dsh-tui itself** (everything registers through its plugin seams).
158
+
159
+ ```bash
160
+ # On a machine that already runs dsh-tui this is the only step; a local checkout works too
161
+ dsh plugin --profile dsh-tui add dsh-remote
162
+ # or: dsh plugin --profile dsh-tui add /path/to/dsh-remote
163
+ ```
164
+
165
+ Restart dsh-tui afterwards. What you get:
166
+
167
+ - `/dsh-remote` — a full-screen server page (add/edit/delete, connect, probe, browse, set-as-workspace, cleanup);
168
+ - the `/workspace` picker lists remote projects directly (or go straight: `dshremote://<machine>/<path>`);
169
+ - the status bar names the current remote machine (remote Sessions only; hover for details).
170
+
171
+ Web profiles are unaffected: without the terminal seams the layer stays off, silently. Keymap,
172
+ cleanup semantics, the host-API contract and the limits live in **[docs/tui.md](docs/tui.md)** (Chinese).
173
+
174
+ ## CLI defaults (optional)
175
+
176
+ Provide a default machine in `cordis.patch.yml`:
177
+
178
+ ```yaml
179
+ # Example only — use values for your own machine.
180
+ - id: dsh-remote
181
+ name: dsh-remote
182
+ config:
183
+ host: 203.0.113.10 # or your real host / hostname
184
+ port: 22
185
+ username: dev
186
+ privateKeyPath: ~/.ssh/id_rsa
187
+ # or password: '…'
188
+ workspace: ~/project
189
+ ```
190
+
191
+ If `host` is empty the plugin starts disconnected and you configure machines in the UI.
192
+
193
+ ## CLI quick reference
194
+
195
+ 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`).
196
+
197
+ ```bash
198
+ # install the bundle into a profile (npm is pulled by pnpm; recommended)
199
+ dsh plugin --profile web add dsh-remote
200
+ # same but when `dsh` is not on PATH (e.g. Windows PowerShell inside a repo)
201
+ npx --yes @deepseek-ai/dsh plugin --profile web add dsh-remote
202
+
203
+ # confirm it is installed wire
204
+ dsh plugin --profile web list
205
+ npx --yes @deepseek-ai/dsh plugin --profile web list
206
+
207
+ # start the web surface (reload profile; the plugin activates on boot)
208
+ dsh --profile web
209
+ npx --yes @deepseek-ai/dsh --profile web # http://127.0.0.1:3080
210
+
211
+ # use a local checkout instead of the npm version (dev iteration)
212
+ npx --yes @deepseek-ai/dsh plugin --profile web add /path/to/dsh-remote
213
+ npx --yes @deepseek-ai/dsh plugin --profile web remove dsh-remote # back to release
214
+ ```
215
+
216
+ After a successful start, `Settings → 远程工作区` appears and the "Add workspace" flow gains the 本机 / 远程 tabs (screenshots above).
217
+
218
+ ## Development (sandbox, not product)
219
+
220
+ Iterate in the sandbox — hand-editing a product profile is reverted by the plugin manager on reinstall:
221
+
222
+ ```bash
223
+ scripts/dev-run.sh --restart # start / restart the isolated sandbox
224
+ scripts/dev-run.sh --stop # stop it
225
+ scripts/dev-run.sh --status # is it running?
226
+ ```
227
+
228
+ - The sandbox runs its own DSH instance (`dev-harness/harness`), serving on `http://127.0.0.1:50599`.
229
+ - **Host-half** (`lib/index.js`) changes need `--restart`; **client-half** (`lib/client.js`) changes need only a page refresh.
230
+ - The script hardlink-copies `lib/` into the sandbox rather than symlinking — a symlink breaks `@deepseek-ai/*` resolution.
231
+ - Before committing: `node check.mjs` (framework-constraint gate) and `npm test`; `scripts/boot-smoke.sh` proves the plugin still starts.
232
+ - Full rules live in `scripts/dev-standards.md`.
233
+
234
+ Deploying to a product profile is a separate, explicit action (`./sync.sh`) for releases only.
235
+
236
+ ## Configuration
237
+
238
+ | Key | Type | Default | Meaning |
239
+ | --- | --- | --- | --- |
240
+ | `host` | string | `''` | default SSH host (else start disconnected) |
241
+ | `port` | int | `22` | default SSH port |
242
+ | `username` | string | `''` | default SSH user |
243
+ | `password` | string | `''` | default SSH password (non-empty overrides key) |
244
+ | `privateKeyPath` | string | `''` | private key path (used only when explicitly provided) |
245
+ | `passphrase` | string | `''` | passphrase for an encrypted private key |
246
+ | `workspace` | string | `''` | default remote workspace path |
247
+ | `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`) |
248
+ | `commandTimeoutMs` | int | 20000 | per remote command timeout |
249
+ | `connectTimeoutMs` | int | 15000 | SSH connect timeout |
250
+ | `maxOutputChars` | int | 200000 | cap on captured stdout/stderr per remote command |
251
+ | `maxFileBytes` | int | 52428800 | skip mirroring/reading files larger than this (0 = no cap) |
252
+ | `hostKeyMode` | string | `accept-new` | host-key policy: `accept-new` (TOFU), `verify` (reject unknown hosts), `off` (skip) |
253
+ | `useAgent` | bool | `false` | authenticate via the OpenSSH agent (`SSH_AUTH_SOCK`) |
254
+ | `keyboardInteractive` | bool | `false` | allow keyboard-interactive auth (OTP/MFA) with the configured password |
255
+ | `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` |
256
+ | `sshBinary` | string | `''` | the `ssh` executable the `openssh` backend drives (empty = the `ssh` on PATH) |
257
+ | `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) |
258
+ | `autoPush` | bool | `false` | auto-push edited mirror files back to the remote (watcher, debounced) |
259
+ | `auditLog` | bool | `true` | append executed commands to `$DSH_HOME/remote-workspaces/audit.log` |
260
+ | `encoding` | string | `utf-8` | text encoding for remote file reads/writes (e.g. `gbk`) |
261
+ | `fileReference` | bool | `true` | remote `@` completion: in a remote session `@` lists the **remote** tree over SFTP (issue #39); off → only the local mirror |
262
+ | `fileReferenceMaxResults` | int | `20` | max `@` candidates rendered for one query |
263
+ | `fileReferenceMaxEntries` | int | `3000` | max entries retained in one remote workspace's `@` index |
264
+ | `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 |
265
+ | `fileReferenceTimeoutMs` | int | `4000` | wall-clock budget for one remote `@` index pass (on expiry the partial index answers rather than making the caret wait) |
266
+ | `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). |
267
+ | `searchMaxEntries` | int | `50000` | Max files `rw_search` scans before returning partial results. |
268
+ | `updateMode` | string | `auto` | self-update behaviour: `auto` checks npm on load and every 6h 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 |
269
+ | `updateCheckIntervalMs` | int | 21600000 (6h) | how often `auto` mode checks npm (floor 60000) |
270
+ | `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` |
271
+ | `webAttachPortStart` | int | `3088` | first local port for the "Remote DSH Web UI" tunnel (later ports are tried when taken; loopback only) |
272
+ | `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) |
273
+ | `webAttachDshHome` | string | `''` | `DSH_HOME` exported on the remote when attaching; empty reuses the remote user's own harness home |
274
+ | `webAttachWaitSeconds` | int | `45` | how long to wait for a freshly started remote `dsh web` to print its launch token |
275
+ | `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` |
276
+ | `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 |
277
+ | `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 |
278
+ | `tui` | bool | `true` | master switch for the TUI (dsh-tui) layer; `false` registers no `/dsh-remote` page, workspace provider or status field |
279
+ | `tuiProviderListRecent` | bool | `true` | list each machine's recent remote projects in the TUI workspace picker |
280
+ | `tuiProviderRecentLimit` | int | `5` | recent remote projects listed per machine (1–20) |
281
+ | `tuiAutoSwitchWorkspace` | bool | `true` | switch the session right after pressing `w` (set as workspace) in the directory browser |
282
+ | `tuiLang` | string | `''` | language of the TUI layer's own copy: `''` = auto (zh, or en when `DSH_TUI_LANG=en`), `zh` / `en` pins it |
283
+ | `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 |
284
+ | `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 |
285
+
286
+ > The authoritative list is the `Config` schema in `lib/index.js`; this table mirrors it.
287
+
288
+ ## FAQ / troubleshooting
289
+
290
+ Quick answers first — the long root-cause stories moved to [docs/troubleshooting.en.md](docs/troubleshooting.en.md):
291
+
292
+ - **The built-in Files panel shows a LOCAL directory** — that is the mirror working copy (by design);
293
+ the live remote tree lives in the Remote Files tab (auto-opens on remote Sessions since 0.8.82).
294
+ - **Does the remote terminal still ask for the password?** — no: saved passwords are answered through
295
+ the local credential bridge (0.8.81+); OTP codes excepted.
296
+ - **A terminal in a remote Session opens on the remote host** — the shell menu's remote ssh is the
297
+ default shell (0.8.75+; `remoteTerminalDefault: false` opts out).
298
+ - **Host key changed** — `/remote forget-key` (or Settings → machine → trust again).
299
+ - **Authentication failed** — check username/password/key path; encrypted keys need the passphrase;
300
+ OTP needs keyboard-interactive.
301
+ - **Unreachable intranet host** — fill the Jump host field (register the bastion itself first);
302
+ multi-hop chains work (ProxyJump equivalent).
303
+ - **A container as a workspace** — yes; two recipes by whether the container exposes a port, see the manual.
304
+
305
+ The full troubleshooting handbook: **[docs/troubleshooting.en.md](docs/troubleshooting.en.md)**
306
+ (including the "remote DSH UI won't connect" chapter).
307
+
308
+ ## Safety
309
+
310
+ 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.
311
+
312
+ ## License
313
+
314
+ MIT
315
+
316
+ ## Contributing & credits
317
+
318
+ Contributions are welcome — see [CONTRIBUTING.md](./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).
319
+
320
+
321
+ Thanks to everyone who makes this project better (avatars link to profiles; bots excluded):
322
+
323
+ <p align="left">
324
+ <a href="https://github.com/flymysql"><img src="https://avatars.githubusercontent.com/u/37113068?s=80&v=4" width="40" height="40" alt="@flymysql" title="@flymysql" /></a>
325
+ <a href="https://github.com/baiseraku"><img src="https://avatars.githubusercontent.com/u/139727690?s=80&v=4" width="40" height="40" alt="@baiseraku" title="@baiseraku" /></a>
326
+ <a href="https://github.com/glzhangzhi"><img src="https://avatars.githubusercontent.com/u/36995275?s=80&v=4" width="40" height="40" alt="@glzhangzhi" title="@glzhangzhi" /></a>
327
+ <a href="https://github.com/hjwsm1989"><img src="https://avatars.githubusercontent.com/u/1067541?s=80&v=4" width="40" height="40" alt="@hjwsm1989" title="@hjwsm1989" /></a>
328
+ <a href="https://github.com/j10ha0"><img src="https://avatars.githubusercontent.com/u/72346906?s=80&v=4" width="40" height="40" alt="@j10ha0" title="@j10ha0" /></a>
329
+ <a href="https://github.com/FoolishWiser"><img src="https://avatars.githubusercontent.com/u/104308087?s=80&v=4" width="40" height="40" alt="@FoolishWiser" title="@FoolishWiser" /></a>
330
+ <a href="https://github.com/kakaa-nju"><img src="https://avatars.githubusercontent.com/u/79886619?s=80&v=4" width="40" height="40" alt="@kakaa-nju" title="@kakaa-nju" /></a>
331
+ <a href="https://github.com/4FMTWRV"><img src="https://avatars.githubusercontent.com/u/190457700?s=80&v=4" width="40" height="40" alt="@4FMTWRV" title="@4FMTWRV" /></a>
332
+ <a href="https://github.com/dahaipeng"><img src="https://avatars.githubusercontent.com/u/25660610?s=80&v=4" width="40" height="40" alt="@dahaipeng" title="@dahaipeng" /></a>
333
+ <a href="https://github.com/davidlin2k"><img src="https://avatars.githubusercontent.com/u/17074619?s=80&v=4" width="40" height="40" alt="@davidlin2k" title="@davidlin2k" /></a>
334
+ <a href="https://github.com/FlintyLemming"><img src="https://avatars.githubusercontent.com/u/19165511?s=80&v=4" width="40" height="40" alt="@FlintyLemming" title="@FlintyLemming" /></a>
335
+ <a href="https://github.com/GDWhisper"><img src="https://avatars.githubusercontent.com/u/129148123?s=80&v=4" width="40" height="40" alt="@GDWhisper" title="@GDWhisper" /></a>
336
+ <a href="https://github.com/YiHui-Liu"><img src="https://avatars.githubusercontent.com/u/30190271?s=80&v=4" width="40" height="40" alt="@YiHui-Liu" title="@YiHui-Liu" /></a>
337
+ <a href="https://github.com/Minggle"><img src="https://avatars.githubusercontent.com/u/35053182?s=80&v=4" width="40" height="40" alt="@Minggle" title="@Minggle" /></a>
338
+ <a href="https://github.com/nekomona"><img src="https://avatars.githubusercontent.com/u/25474483?s=80&v=4" width="40" height="40" alt="@nekomona" title="@nekomona" /></a>
339
+ <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>
340
+ </p>
341
+
342
+ Recent highlight contributions (there is always room on this list):
343
+
344
+ | Contributor | What they did |
345
+ | --- | --- |
346
+ | [@baiseraku](https://github.com/baiseraku) | the whole dsh-tui adaptation layer ([#92](https://github.com/flymysql/dsh-remote/pull/92)) + the status-bar fix ([#98](https://github.com/flymysql/dsh-remote/pull/98)) |
347
+ | [@hjwsm1989](https://github.com/hjwsm1989) | both remote-.md renderer fixes: the memo guard ([#102](https://github.com/flymysql/dsh-remote/pull/102)) and the labels contract ([#107](https://github.com/flymysql/dsh-remote/pull/107)) |
348
+ | [@shis23](https://github.com/shis23) | rw_sync path-mapping fix + SFTP timeout resilience ([#105](https://github.com/flymysql/dsh-remote/pull/105)) |
349
+ | [@davidlin2k](https://github.com/davidlin2k) | dialing credential-less machines through the user's own ssh ([#100](https://github.com/flymysql/dsh-remote/pull/100)) |
350
+ | [@GDWhisper](https://github.com/GDWhisper) | the per-keystroke completion reconnect fix ([#42](https://github.com/flymysql/dsh-remote/pull/42), issue #41) |
351
+ | [@glzhangzhi](https://github.com/glzhangzhi) | the per-session SSH pool isolation behind issue #25 |
352
+
353
+ The older hand-kept roll of merged PRs (with their numbers):
354
+
355
+
356
+ [@dahaipeng](https://github.com/dahaipeng) (#31) ·
357
+ [@YiHui-Liu](https://github.com/YiHui-Liu) (#28) ·
358
+ [@nekomona](https://github.com/nekomona) (#24) ·
359
+ [FoolishWiser](https://github.com/FoolishWiser) (#17) ·
360
+ [@jace1cch](https://github.com/jace1cch) (#16) ·
361
+ [@Minggle](https://github.com/Minggle) (#10) ·
362
+ [4FMTWRV](https://github.com/4FMTWRV) (#6) ·
363
+ [glzhangzhi](https://github.com/glzhangzhi) (per-session SSH pool fix)
364
+
365
+ > The wall updates with releases; a well-written issue report, a repro, or a root-cause lead
366
+ > is worth as much as a patch — about half of this repo's fixes started as a clear issue.
367
+
368
+ ## Changelog
369
+
369
370
  See [CHANGELOG.md](./CHANGELOG.md).