agent-ssh-cli 0.3.4 → 0.3.6

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 CHANGED
@@ -12,7 +12,7 @@
12
12
  <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-%3E%3D18-339933?logo=node.js&logoColor=white" alt="Node.js >=18"></a>
13
13
  <a href="https://www.npmjs.com/"><img src="https://img.shields.io/badge/npm-%3E%3D8-CB3837?logo=npm&logoColor=white" alt="npm >=8"></a>
14
14
  <a href="https://github.com/sleepinginsummer/agent-ssh-cli"><img src="https://img.shields.io/badge/sys-win%2Fmac%2Flinux-0078D6" alt="sys win/mac/linux"></a>
15
- <a href="https://github.com/sleepinginsummer/agent-ssh-cli/releases"><img src="https://img.shields.io/badge/release-v0.3.3-blue" alt="release v0.3.3"></a>
15
+ <a href="https://github.com/sleepinginsummer/agent-ssh-cli/releases"><img src="https://img.shields.io/badge/release-v0.3.6-blue" alt="release v0.3.6"></a>
16
16
  <a href="https://github.com/sleepinginsummer/agent-ssh-cli/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen" alt="PRs welcome"></a>
17
17
  </p>
18
18
 
@@ -33,11 +33,17 @@
33
33
  #### 他的能力:
34
34
  - 列出本地配置中的 SSH 服务器连接
35
35
  - 在指定远端服务器上执行命令
36
- - 上传本地文件到远端服务器
36
+ - 上传本地文件到远端服务器,支持临时文件、断点续传和失败重试
37
37
  - 从远端服务器下载文件到本地
38
38
  - 通过命令黑白名单限制可执行命令
39
39
  - 通过本地路径白名单限制上传和下载访问范围
40
40
 
41
+ ## 上传稳定性
42
+
43
+ 上传会先写入远端 `<remotePath>.part` 临时文件,并写入 `<remotePath>.part.meta` 续传元数据;完成后校验大小,再 rename 为正式目标文件。上传中断后,下次上传同一个本地文件到同一个远端路径会从已有 `.part` 大小继续。
44
+
45
+ `--no-cache` 上传可用 `Ctrl+C` 停止当前进程;daemon 模式可用 `agentsshcli stop-daemon` 停止连接池进程,但它会影响同一 daemon 内其它任务,不是精确取消单个上传。
46
+
41
47
  ## AI 一键安装
42
48
 
43
49
  ```
@@ -91,6 +97,8 @@ AGENT_SSH_CONFIG=/path/to/config.json
91
97
  - `password` / `passwordRef` / `privateKey`: 认证方式,密码、密码引用、私钥三类认证只能保留一种
92
98
  - `port`: SSH 端口,默认 `22`
93
99
  - `passphrase`: 私钥口令,仅配合 `privateKey` 使用
100
+ - `socksProxy`: SOCKS5 代理地址,例如 `socks5://127.0.0.1:1080`;也可省略协议写成 `127.0.0.1:1080`
101
+ - `jumpHost`: 跳板机连接名,填写配置文件中另一台机器的 `name`
94
102
  - `pty`: 是否分配伪终端,默认 `false`,也可通过 `exec --pty` 临时开启
95
103
  - `allowedLocalPaths`: 额外允许上传或下载写入的本地路径
96
104
  - `commandWhitelist`: 命令白名单正则数组
@@ -113,12 +121,22 @@ AGENT_SSH_CONFIG=/path/to/config.json
113
121
  "username": "root",
114
122
  "password": "",
115
123
  "passwordRef": "agentsshcli:密码服务器",
124
+ "jumpHost": "jump-server",
116
125
  "commandBlacklist": [
117
126
  "(^|[;&|()\\s])rm(\\s|$)",
118
127
  "(^|[;&|()\\s])shutdown(\\s|$)",
119
128
  "(^|[;&|()\\s])reboot(\\s|$)"
120
129
  ]
121
130
  },
131
+ {
132
+ "name": "jump-server",
133
+ "host": "198.51.100.20",
134
+ "port": 22,
135
+ "username": "ubuntu",
136
+ "privateKey": "/path/to/jump_key",
137
+ "passphrase": "******",
138
+ "socksProxy": "socks5://127.0.0.1:1080"
139
+ },
122
140
  {
123
141
  "name": "密钥服务器",
124
142
  "host": "198.51.100.10",
@@ -6,6 +6,7 @@
6
6
  "username": "root",
7
7
  "password": "",
8
8
  "passwordRef": "agentsshcli:密码服务器",
9
+ "jumpHost": "跳板机",
9
10
  "allowedLocalPaths": [
10
11
  "./tmp"
11
12
  ],
@@ -15,6 +16,15 @@
15
16
  "(^|[;&|()\\s])reboot(\\s|$)"
16
17
  ]
17
18
  },
19
+ {
20
+ "name": "跳板机",
21
+ "host": "198.51.100.20",
22
+ "port": 22,
23
+ "username": "ubuntu",
24
+ "privateKey": "/path/to/jump_key",
25
+ "passphrase": "******",
26
+ "socksProxy": "socks5://127.0.0.1:1080"
27
+ },
18
28
  {
19
29
  "name": "密钥服务器",
20
30
  "host": "198.51.100.10",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-ssh-cli",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "基于 CLI 的 SSH 代理工具,按 ssh-mcp-server 的能力一一映射",
5
5
  "type": "module",
6
6
  "engines": {
@@ -27,10 +27,10 @@
27
27
  "build:native-package": "npm run build:native-bin && node scripts/build-native-package.js"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@agent-ssh-cli/darwin-arm64": "0.3.4",
31
- "@agent-ssh-cli/darwin-x64": "0.3.4",
32
- "@agent-ssh-cli/linux-arm64": "0.3.4",
33
- "@agent-ssh-cli/linux-x64": "0.3.4",
34
- "@agent-ssh-cli/win32-x64": "0.3.4"
30
+ "@agent-ssh-cli/darwin-arm64": "0.3.6",
31
+ "@agent-ssh-cli/darwin-x64": "0.3.6",
32
+ "@agent-ssh-cli/linux-arm64": "0.3.6",
33
+ "@agent-ssh-cli/linux-x64": "0.3.6",
34
+ "@agent-ssh-cli/win32-x64": "0.3.6"
35
35
  }
36
36
  }