dsh-remote 0.5.8 → 0.5.9
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.md +133 -113
- package/README.zh.md +134 -114
- package/lib/client.js +466 -260
- package/lib/index.js +124 -12
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -1,113 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
The
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
#
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
1
|
+
**English** · [中文](./README.zh.md)
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# dsh-remote
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/dsh-remote)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](https://github.com/topics/dsh-plugin)
|
|
10
|
+
|
|
11
|
+
**Remote-work assistant for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH).**
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
## Screen previews
|
|
18
|
+
|
|
19
|
+
Settings → **远程工作区** — a multi-machine SSH registry (add / edit / delete / set-current, password stored locally):
|
|
20
|
+
|
|
21
|
+
<img src="https://cdn.jsdelivr.net/gh/flymysql/dsh-remote@main/docs/ui-settings-panel.png" alt="dsh-remote settings — multi-machine registry (light theme, host scrubbed)" width="720"/>
|
|
22
|
+
|
|
23
|
+
The native **"Add workspace" / "Select workspace"** flow — a centered modal, two tabs, opens on **本机 (local)**; switch to **远程 (remote)**:
|
|
24
|
+
|
|
25
|
+
- **远程** — a **machine `<select>`**, a path field that **auto-prefills `/` and live-completes** directories (picking one immediately reveals its next level, OS/VSCode-style), plus a **浏览…** floating browser that fills the field without committing — you review, edit, then **设为远程工作区**.
|
|
26
|
+
|
|
27
|
+
Real capture (host scrubbed to a placeholder):
|
|
28
|
+
|
|
29
|
+
<img src="https://cdn.jsdelivr.net/gh/flymysql/dsh-remote@main/docs/ui-picker-panel.png" alt="dsh-remote workspace picker — real dialog; 本机 (local) tab; 远程 machine select + prefilled root path + autocomplete" width="720"/>
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- **Multi-machine SSH** — save any number of hosts (`host`/`port`/`user` + **private key** or **password**). Passwords are stored locally and never shown back in the UI. Switch with one click in Settings.
|
|
36
|
+
- **Two-tab workspace picker** (fills the native "Add workspace" flow):
|
|
37
|
+
- **本机 / Local** — opens the **native OS folder chooser** over the host, or lets you type a local path → adopted directly as a normal DSH local workspace (local workspaces fully coexist).
|
|
38
|
+
- **远程 / Remote** — the picker is a **centered modal** (never squeezed into a narrow sidebar). Pick a **machine** → the path field is **pre-filled with `/`** and live **autocompletes** directories; **selecting a directory immediately lists its next level** (OS/VSCode-style cascade). A **浏览…** floating browser (opaque, height-capped, scrollable, follows symlinks) fills the field without committing — you review, edit, then confirm. On confirm it creates a **real local mirror** (`~/.dsh/remote-workspaces/<host>/<base>-<hash>`) that passes `fs.realpath` → the harness adopts it as a real workspace while dsh-remote keeps it synced over SFTP.
|
|
39
|
+
- **Bidirectional SFTP sync** — `rw_sync` (remote → mirror) and `rw_push` (mirror → remote) round-trip your local-mirror edits back to the machine.
|
|
40
|
+
- **Model tools** — `rw_info`, `rw_connect`, `rw_pick_workspace`, `rw_list_dir`, `rw_read_file`, `rw_write_file`, `rw_exec`, `rw_sync`, `rw_push`, `rw_disconnect`.
|
|
41
|
+
- **Write directly to a remote file** — `rw_write_file` creates or overwrites a remote file (making parent directories), so you don't have to round-trip through a local mirror for a single-file edit.
|
|
42
|
+
- **Connection health** — a **「测试连接」 test-connection** button in the Settings page validates host/user/key/password before you save a machine.
|
|
43
|
+
- The active `user@host:/path` is injected into every system prompt so the agent knows its working root.
|
|
44
|
+
- **No official `dsh-workspace` core is modified** — everything is delivered as a normal plugin (directory-flow holes filled by the client half at `priority -100`).
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
dsh plugin add dsh-remote # add the bundle
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
(or `npm install dsh-remote` + add `- id: dsh-remote / name: dsh-remote` in `cordis.patch.yml`).
|
|
53
|
+
|
|
54
|
+
## Quick start
|
|
55
|
+
|
|
56
|
+
1. **Add a machine** — Settings → 远程工作区 → add host/port/user + key or password → (optional) set it current.
|
|
57
|
+
2. **Open a workspace** — click **Add workspace** in the sidebar / conversation:
|
|
58
|
+
- **本机** → system folder chooser (or type a local path) → local workspace.
|
|
59
|
+
- **远程** → choose the machine → browse to a remote directory (or type `/path`) → "设为远程工作区" ⇒ a local mirror workspace is created and adopted.
|
|
60
|
+
3. **Work with the agent** — treat it like any workspace:
|
|
61
|
+
- `rw_list_dir(path?)`/`rw_read_file` — inspect remote files
|
|
62
|
+
- `rw_write_file(path, content)` — create or overwrite a remote file directly
|
|
63
|
+
- `rw_exec(command)` — run remote shell commands
|
|
64
|
+
- `rw_sync` / `rw_push` — pull/push the local mirror to and from the remote
|
|
65
|
+
|
|
66
|
+
## CLI defaults (optional)
|
|
67
|
+
|
|
68
|
+
Provide a default machine in `cordis.patch.yml`:
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
# Example only — use values for your own machine.
|
|
72
|
+
- id: dsh-remote
|
|
73
|
+
name: dsh-remote
|
|
74
|
+
config:
|
|
75
|
+
host: 203.0.113.10 # or your real host / hostname
|
|
76
|
+
port: 22
|
|
77
|
+
username: dev
|
|
78
|
+
privateKeyPath: ~/.ssh/id_rsa
|
|
79
|
+
# or password: '…'
|
|
80
|
+
workspace: ~/project
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
If `host` is empty the plugin starts disconnected and you configure machines in the UI.
|
|
84
|
+
|
|
85
|
+
## CLI quick reference
|
|
86
|
+
|
|
87
|
+
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`).
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# install the bundle into a profile (npm is pulled by pnpm; recommended)
|
|
91
|
+
dsh plugin --profile web add dsh-remote
|
|
92
|
+
# same but when `dsh` is not on PATH (e.g. Windows PowerShell inside a repo)
|
|
93
|
+
npx --yes @deepseek-ai/dsh plugin --profile web add dsh-remote
|
|
94
|
+
|
|
95
|
+
# confirm it is installed wire
|
|
96
|
+
dsh plugin --profile web list
|
|
97
|
+
npx --yes @deepseek-ai/dsh plugin --profile web list
|
|
98
|
+
|
|
99
|
+
# start the web surface (reload profile; the plugin activates on boot)
|
|
100
|
+
dsh --profile web
|
|
101
|
+
npx --yes @deepseek-ai/dsh --profile web # http://127.0.0.1:3080
|
|
102
|
+
|
|
103
|
+
# use a local checkout instead of the npm version (dev iteration)
|
|
104
|
+
npx --yes @deepseek-ai/dsh plugin --profile web add /path/to/dsh-remote
|
|
105
|
+
npx --yes @deepseek-ai/dsh plugin --profile web remove dsh-remote # back to release
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
After a successful start, `Settings → 远程工作区` appears and the "Add workspace" flow gains the 本机 / 远程 tabs (screenshots above).
|
|
109
|
+
|
|
110
|
+
## Configuration
|
|
111
|
+
|
|
112
|
+
| Key | Type | Default | Meaning |
|
|
113
|
+
| --- | --- | --- | --- |
|
|
114
|
+
| `host` | string | `''` | default SSH host (else start disconnected) |
|
|
115
|
+
| `port` | int | `22` | default SSH port |
|
|
116
|
+
| `username` | string | `''` | default SSH user |
|
|
117
|
+
| `password` | string | `''` | default SSH password (non-empty overrides key) |
|
|
118
|
+
| `privateKeyPath` | string | `''` | private key path (`~/.ssh/id_rsa` when empty) |
|
|
119
|
+
| `workspace` | string | `''` | default remote workspace path |
|
|
120
|
+
| `commandTimeoutMs` | int | 20000 | per remote command timeout |
|
|
121
|
+
| `connectTimeoutMs` | int | 15000 | SSH connect timeout |
|
|
122
|
+
|
|
123
|
+
## Safety
|
|
124
|
+
|
|
125
|
+
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 are saved on the local machine file; treat it as sensitive (you may lock file ACLs).
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
MIT
|
|
130
|
+
|
|
131
|
+
## Changelog
|
|
132
|
+
|
|
133
|
+
See [CHANGELOG.md](./CHANGELOG.md).
|
package/README.zh.md
CHANGED
|
@@ -1,114 +1,134 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
#
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
#
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
1
|
+
[English](./README.md) · **中文**
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# dsh-remote
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/dsh-remote)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](https://github.com/topics/dsh-plugin)
|
|
10
|
+
|
|
11
|
+
**为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)打造的远程工作助手。**
|
|
12
|
+
|
|
13
|
+
维护多台 SSH 机器,然后在「选择工作区」时选一个**远程工作区**(或**本地工作区**),Agent 就能在不离开 harness 的情况下直接操作——列文件、读代码、在远程主机上跑构建/命令,并把远程目录镜像成一个真实的本地工作区对象。
|
|
14
|
+
|
|
15
|
+
DSH 的 Web 界面刻意只监听 `127.0.0.1`(CLI 为安全拒绝 `--host 0.0.0.0`)。本插件反过来:**由你主动连出**到你维护的机器,选一个工作区,然后通过 DSH 原生的工作区 + 文件流来工作——**不改动 `dsh-workspace` 核心**。
|
|
16
|
+
|
|
17
|
+
## 界面预览
|
|
18
|
+
|
|
19
|
+
设置 → **远程工作区** —— 多机 SSH 列表(增/删/改/设为当前,密码本地保存、不回显):
|
|
20
|
+
|
|
21
|
+
<img src="https://cdn.jsdelivr.net/gh/flymysql/dsh-remote@main/docs/ui-settings-panel.png" alt="dsh-remote 设置页 — 多机列表(浅色主题,主机已打码)" width="720"/>
|
|
22
|
+
|
|
23
|
+
原生 **「Add workspace / 选择工作区」** 流程 —— **居中弹窗**、两个 tab,**默认落在「本机」**;切到 **「远程」**:
|
|
24
|
+
|
|
25
|
+
- **远程** —— 一个**机器下拉**;路径输入框**自动预填 `/` 并实时补全目录**(点选一个目录后**立即列出它的下一级**,像系统/VSCode 逐级选目录);另外有**「浏览…」浮窗**,选中仅回填到输入框(不直接提交),你复核 / 修改后点「设为远程工作区」。
|
|
26
|
+
|
|
27
|
+
真实截图(机器已打码为占位):
|
|
28
|
+
|
|
29
|
+
<img src="https://cdn.jsdelivr.net/gh/flymysql/dsh-remote@main/docs/ui-picker-panel.png" alt="dsh-remote 工作区选择 — 真实弹窗;默认本机 tab;远程:机器下拉 + 预填根路径 + 自动补全" width="720"/>
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 功能
|
|
34
|
+
|
|
35
|
+
- **多机 SSH** —— 可存任意多台主机(host/port/user + **私钥**或**密码**)。密码只存在本地,界面不回显;在设置里一键切当前机。
|
|
36
|
+
- **双 tab 工作区选择器**(填充原生「Add workspace」流程):
|
|
37
|
+
- **本机** —— 走 **host 端原生系统文件夹对话框**选本地目录(或直接输入本地路径)→ 直接成为普通 DSH 本地工作区(与本地工作区共存)。
|
|
38
|
+
- **远程** —— 选择器是**居中弹窗**(窄侧边栏也不会被挤压)。先**选机器** → 路径框**自动预填 `/`** 并**实时补全**目录;**选中一个目录立即列出它下一级**(OS/VSCode 式级联)。另有 **「浏览…」浮层**(不透明、定高、内部滚动、跟随软链),选中**回填输入框不提交**,你复核/修改后再确定。确定会创建**真实本地镜像**(`~/.dsh/remote-workspaces/<host>/<basename>-<hash>`,`fs.realpath` 通过)→ harness 把它当真实工作区收养,同时 dsh-remote 通过 SFTP 保持同步。
|
|
39
|
+
- **双向 SFTP 同步** —— `rw_sync`(远程→镜像)、`rw_push`(镜像→远程),本地镜像改动可回传机器。
|
|
40
|
+
- **模型工具** —— `rw_info`、`rw_connect`、`rw_pick_workspace`、`rw_list_dir`、`rw_read_file`、`rw_write_file`、`rw_exec`、`rw_sync`、`rw_push`、`rw_disconnect`。
|
|
41
|
+
- **直接写远程文件** —— `rw_write_file` 直接创建/覆盖远程文件(自动建父目录),单个文件改动不必绕本地镜像来回同步。
|
|
42
|
+
- **连接体检** —— 设置页提供「测试连接」按钮,在保存机器之前先验证 host/user/密码/私钥是否可用。
|
|
43
|
+
- 当前 `user@host:/path` 会注入每次系统提示,让 Agent 明确自己的工作根。
|
|
44
|
+
- **不改任何 `dsh-workspace` 官方代码** —— 全部作为普通插件实现(client 半以 `priority -100` 填充 directory-flow holes)。
|
|
45
|
+
|
|
46
|
+
## 安装
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
dsh plugin add dsh-remote # 添加 bundle
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
(或 `npm install dsh-remote`,再在 `cordis.patch.yml` 加 `- id: dsh-remote / name: dsh-remote`。)
|
|
53
|
+
|
|
54
|
+
## 快速上手
|
|
55
|
+
|
|
56
|
+
1. **加一台机器** —— 设置 → 远程工作区 → 填 host/port/user + 密码或 key →(可选)设为当前。
|
|
57
|
+
2. **选工作区** —— 点侧边栏/会话的 **Add workspace**:
|
|
58
|
+
- **本机** → 系统文件夹选择(或输入本地路径)→ 本地工作区。
|
|
59
|
+
- **远程** → 选机器 → 浏览到远程目录(或输入 `/path`)→ 「设为远程工作区」⇒ 创建并收养一个本地镜像工作区。
|
|
60
|
+
3. **让 Agent 工作** —— 把它当普通工作区用:
|
|
61
|
+
- `rw_list_dir(path?)` / `rw_read_file` —— 查看远程文件
|
|
62
|
+
- `rw_write_file(path, content)` —— 直接创建或覆盖远程文件
|
|
63
|
+
- `rw_exec(command)` —— 在远程执行命令
|
|
64
|
+
- `rw_sync` / `rw_push` —— 拉取/推送本地镜像 <-> 远程
|
|
65
|
+
|
|
66
|
+
## 可选:CLI 默认机
|
|
67
|
+
|
|
68
|
+
可在 `cordis.patch.yml` 提供默认机:
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
# 示例:请换成你自己的机器
|
|
72
|
+
- id: dsh-remote
|
|
73
|
+
name: dsh-remote
|
|
74
|
+
config:
|
|
75
|
+
host: 203.0.113.10 # 或你的真实主机 / hostname
|
|
76
|
+
port: 22
|
|
77
|
+
username: dev
|
|
78
|
+
privateKeyPath: ~/.ssh/id_rsa
|
|
79
|
+
# 或用密码登录:
|
|
80
|
+
# password: '…'
|
|
81
|
+
workspace: ~/project
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
若 `host` 为空,插件启动时处于断开状态,在 UI 里配置机器即可。
|
|
85
|
+
|
|
86
|
+
## 常用命令(安装 / 查看 / 启动)
|
|
87
|
+
|
|
88
|
+
DSH 的 `dsh` 可能不在某些 shell 的 PATH(比如 Windows PowerShell 里在某个仓库目录下),所以同时列出 `dsh` 与 `npx` 两种写法。操作都要用 `--profile <name>` 指定 profile(一般 `web`):
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# 安装(从 npm 拉到 profile)
|
|
92
|
+
dsh plugin --profile web add dsh-remote
|
|
93
|
+
# 同一效果:当 `dsh` 不在 PATH 时用 npx
|
|
94
|
+
npx --yes @deepseek-ai/dsh plugin --profile web add dsh-remote
|
|
95
|
+
|
|
96
|
+
# 确认已装
|
|
97
|
+
dsh plugin --profile web list
|
|
98
|
+
npx --yes @deepseek-ai/dsh plugin --profile web list
|
|
99
|
+
|
|
100
|
+
# 启动 web 界面(重载 profile,新插件在启动时生效)
|
|
101
|
+
dsh --profile web
|
|
102
|
+
npx --yes @deepseek-ai/dsh --profile web # 访问 http://127.0.0.1:3080
|
|
103
|
+
|
|
104
|
+
# 迭代用本地源码替换 npm 版(便于改 dsh 插件代码后即测)
|
|
105
|
+
npx --yes @deepseek-ai/dsh plugin --profile web add D:/path/to/dsh-remote
|
|
106
|
+
npx --yes @deepseek-ai/dsh plugin --profile web remove dsh-remote # 恢复用发行版
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
启动成功后,设置 →「远程工作区」会出现;「Add workspace」流程会带「本机 / 远程」两个 tab(见上方效果图)。
|
|
110
|
+
|
|
111
|
+
## 配置
|
|
112
|
+
|
|
113
|
+
| 键 | 类型 | 默认 | 说明 |
|
|
114
|
+
| --- | --- | --- | --- |
|
|
115
|
+
| `host` | string | `''` | 默认 SSH 主机(空=断开) |
|
|
116
|
+
| `port` | int | `22` | 默认 SSH 端口 |
|
|
117
|
+
| `username` | string | `''` | 默认 SSH 用户 |
|
|
118
|
+
| `password` | string | `''` | 默认 SSH 密码(非空覆盖 key) |
|
|
119
|
+
| `privateKeyPath` | string | `''` | 私钥路径(空=`~/.ssh/id_rsa`) |
|
|
120
|
+
| `workspace` | string | `''` | 默认远程工作区路径 |
|
|
121
|
+
| `commandTimeoutMs` | int | 20000 | 单条远程命令超时 |
|
|
122
|
+
| `connectTimeoutMs` | int | 15000 | SSH 连接超时 |
|
|
123
|
+
|
|
124
|
+
## 安全提醒
|
|
125
|
+
|
|
126
|
+
把机器凭据交给插件,等于允许 Agent 以你的用户身份在主机上执行 **shell 命令**。只添加你可信的机器。密码保存在本机文件里,请当作敏感数据处理(可收紧文件 ACL)。
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT
|
|
131
|
+
|
|
132
|
+
## 变更记录
|
|
133
|
+
|
|
134
|
+
见 [CHANGELOG.md](./CHANGELOG.md)。
|