rcoder 1.0.0__tar.gz

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.
rcoder-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Trae Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
rcoder-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,442 @@
1
+ Metadata-Version: 2.4
2
+ Name: rcoder
3
+ Version: 1.0.0
4
+ Summary: 远程代码执行与管理系统,支持低带宽场景和中转服务器场景
5
+ Home-page: https://github.com/trae-team/rcoder
6
+ Author: Trae Team
7
+ Author-email: Trae Team <support@trae.io>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Trae Team
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+
30
+ Project-URL: Homepage, https://github.com/trae-team/rcoder
31
+ Project-URL: Documentation, https://docs.trae.io/rcoder
32
+ Project-URL: Source, https://github.com/trae-team/rcoder
33
+ Project-URL: Tracker, https://github.com/trae-team/rcoder/issues
34
+ Keywords: remote,code,execution,management,proxy,low-bandwidth
35
+ Classifier: Development Status :: 5 - Production/Stable
36
+ Classifier: Intended Audience :: Developers
37
+ Classifier: Intended Audience :: System Administrators
38
+ Classifier: License :: OSI Approved :: MIT License
39
+ Classifier: Operating System :: OS Independent
40
+ Classifier: Programming Language :: Python :: 3
41
+ Classifier: Programming Language :: Python :: 3.7
42
+ Classifier: Programming Language :: Python :: 3.8
43
+ Classifier: Programming Language :: Python :: 3.9
44
+ Classifier: Programming Language :: Python :: 3.10
45
+ Classifier: Programming Language :: Python :: 3.11
46
+ Classifier: Topic :: System :: Systems Administration
47
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
48
+ Classifier: Topic :: Internet :: WWW/HTTP
49
+ Requires-Python: >=3.7
50
+ Description-Content-Type: text/markdown
51
+ License-File: LICENSE
52
+ Requires-Dist: psutil>=5.9.8
53
+ Requires-Dist: python-daemon>=3.0.1
54
+ Dynamic: author
55
+ Dynamic: home-page
56
+ Dynamic: license-file
57
+ Dynamic: requires-python
58
+
59
+ # Rcoder 功能文档
60
+
61
+ ## 1. 系统概述
62
+
63
+ Rcoder 是一个强大的远程代码执行与管理系统,专为低带宽场景和中转服务器场景优化设计。系统支持异步通讯、批量执行、实时监控等功能,提供了友好的用户界面和完善的系统进程管理能力。
64
+
65
+ ### 核心特性
66
+
67
+ - ✅ 低带宽场景优化(数据压缩、连接池)
68
+ - ✅ 中转服务器场景支持(异步通讯机制)
69
+ - ✅ 消息队列机制(确保命令顺序执行)
70
+ - ✅ 系统进程管理(守护进程、系统服务)
71
+ - ✅ 服务器别名管理(方便编程引用)
72
+ - ✅ 跨平台支持(Linux、Windows、Mac)
73
+
74
+ ## 2. 功能详细说明
75
+
76
+ ### 2.1 主菜单功能
77
+
78
+ ```
79
+ === Rcoder 主界面 ===
80
+ 1. 对话式配置
81
+ 2. 自动优化连接
82
+ 3. 异步代理测试
83
+ 4. 管理服务器和中转服务器
84
+ 5. 系统进程管理
85
+ 6. 退出
86
+ ```
87
+
88
+ #### 1. 对话式配置
89
+ - 交互式配置系统参数
90
+ - 支持服务器连接设置
91
+ - 自动保存配置信息
92
+
93
+ #### 2. 自动优化连接
94
+ - 智能检测网络场景
95
+ - 自动应用优化策略
96
+ - 支持中转服务器配置
97
+
98
+ #### 3. 异步代理测试
99
+ - 测试四步异步通讯流程
100
+ - 支持批量命令执行
101
+ - 实时显示执行状态
102
+
103
+ #### 4. 管理服务器和中转服务器
104
+ - 添加服务器(目标服务器或中转服务器)
105
+ - 修改服务器配置
106
+ - 查看服务器列表
107
+ - 删除服务器
108
+
109
+ #### 5. 系统进程管理
110
+ - 启动守护进程(后台运行)
111
+ - 停止进程
112
+ - 删除系统进程(完全移除)
113
+ - 重启进程
114
+ - 查看进程状态
115
+ - 注册系统服务(开机自启)
116
+ - 注销系统服务
117
+
118
+ ### 2.2 服务器管理功能
119
+
120
+ ```
121
+ === 服务器和中转服务器管理 ===
122
+ 1. 添加服务器
123
+ 2. 修改服务器配置
124
+ 3. 查看服务器列表
125
+ 4. 删除服务器
126
+ 5. 返回主菜单
127
+ ```
128
+
129
+ #### 1. 添加服务器
130
+ - 输入服务器别名(方便编程引用)
131
+ - 输入服务器地址和端口
132
+ - 设置服务器密码
133
+ - 指定服务器类型(目标服务器或中转服务器)
134
+
135
+ #### 2. 修改服务器配置
136
+ - 选择要修改的服务器别名
137
+ - 修改服务器地址、端口、密码等配置
138
+ - 支持修改服务器类型
139
+
140
+ #### 3. 查看服务器列表
141
+ - 显示所有已配置的服务器
142
+ - 展示详细配置信息
143
+ - 区分目标服务器和中转服务器
144
+
145
+ #### 4. 删除服务器
146
+ - 输入要删除的服务器别名
147
+ - 确认删除操作
148
+ - 自动清理服务器配置
149
+
150
+ ### 2.3 系统进程管理功能
151
+
152
+ ```
153
+ === 系统进程管理 ===
154
+ 1. 启动守护进程
155
+ 2. 停止进程
156
+ 3. 删除系统进程
157
+ 4. 重启进程
158
+ 5. 查看进程状态
159
+ 6. 注册系统服务
160
+ 7. 注销系统服务
161
+ 8. 返回主菜单
162
+ ```
163
+
164
+ #### 1. 启动守护进程
165
+ - 以后台模式启动Rcoder
166
+ - 自动创建PID文件和日志文件
167
+ - 支持后台监控和任务执行
168
+
169
+ #### 2. 停止进程
170
+ - 停止正在运行的Rcoder进程
171
+ - 清理进程资源
172
+ - 保留配置信息
173
+
174
+ #### 3. 删除系统进程
175
+ - 完全移除Rcoder进程
176
+ - 清理PID文件
177
+ - 释放系统资源
178
+
179
+ #### 4. 重启进程
180
+ - 先停止现有进程
181
+ - 启动新的进程实例
182
+ - 保持配置不变
183
+
184
+ #### 5. 查看进程状态
185
+ - 显示进程PID
186
+ - 展示内存和CPU使用情况
187
+ - 显示进程启动时间
188
+
189
+ #### 6. 注册系统服务
190
+ - 支持 Linux (systemd)、Windows、Mac (launchd)
191
+ - 实现开机自启
192
+ - 系统级进程管理
193
+
194
+ #### 7. 注销系统服务
195
+ - 停止系统服务
196
+ - 移除服务注册
197
+ - 清理相关文件
198
+
199
+ ### 2.4 异步通讯机制
200
+
201
+ #### 四步通讯流程
202
+ 1. **Trae → 中转服务器**:发送命令并等待
203
+ 2. **中转服务器 → 目标服务器**:推送命令执行
204
+ 3. **目标服务器 → 中转服务器**:执行完成后发送反馈
205
+ 4. **中转服务器 → Trae**:将结果返回给Trae
206
+
207
+ #### 消息队列机制
208
+ - 确保命令按顺序执行
209
+ - 防止命令丢失
210
+ - 支持命令重试
211
+ - 批量命令并发执行
212
+
213
+ ## 3. 使用方法
214
+
215
+ ### 3.1 基本使用
216
+
217
+ ```bash
218
+ # 启动Rcoder主界面
219
+ python rcoder.py
220
+
221
+ # 以守护进程模式运行
222
+ python rcoder.py --daemon
223
+
224
+ # 查看进程状态
225
+ python rcoder.py --status
226
+
227
+ # 停止进程
228
+ python rcoder.py --stop
229
+ ```
230
+
231
+ ### 3.2 服务器配置
232
+
233
+ 1. 启动Rcoder主界面
234
+ 2. 选择 "4. 管理服务器和中转服务器"
235
+ 3. 选择 "1. 添加服务器"
236
+ 4. 输入服务器别名、地址、端口、密码
237
+ 5. 指定服务器类型(目标服务器或中转服务器)
238
+
239
+ ### 3.3 系统服务注册
240
+
241
+ ```bash
242
+ # 注册为系统服务(开机自启)
243
+ python rcoder.py --register-service
244
+
245
+ # 注销系统服务
246
+ python rcoder.py --unregister-service
247
+ ```
248
+
249
+ ### 3.4 编程引用
250
+
251
+ ```python
252
+ from rcoder.core_optimized import get_remote_host
253
+
254
+ # 通过服务器别名连接
255
+ host_config = SERVER_ALIASES.get('proxy_server')
256
+ if host_config:
257
+ remote = get_remote_host(
258
+ host=host_config['host'],
259
+ port=host_config['port'],
260
+ password=host_config['password']
261
+ )
262
+ result = remote.run('ls -la')
263
+ print(result)
264
+ ```
265
+
266
+ ## 4. 配置选项
267
+
268
+ ### 4.1 核心配置参数
269
+
270
+ | 参数 | 描述 | 默认值 |
271
+ |------|------|--------|
272
+ | host | 服务器地址 | 192.168.1.8 |
273
+ | port | 服务器端口 | 443 |
274
+ | use_https_disguise | HTTPS伪装 | True |
275
+ | enable_compression | 数据压缩 | True |
276
+ | enable_connection_pool | 连接池 | True |
277
+ | connection_pool_size | 连接池大小 | 5 |
278
+ | password | 认证密码 | None |
279
+ | proxy_server | 中转服务器 | None |
280
+
281
+ ### 4.2 网络优化参数
282
+
283
+ | 参数 | 描述 | 默认值 |
284
+ |------|------|--------|
285
+ | enable_minimal_payload | 最小化负载 | False |
286
+ | enable_exponential_backoff | 指数退避 | False |
287
+ | enable_breakpoint_resume | 断点续传 | False |
288
+
289
+ ## 5. 依赖管理
290
+
291
+ ### 5.1 必要依赖
292
+
293
+ ```
294
+ # requirements.txt
295
+ psutil==5.9.8
296
+ python-daemon==3.0.1
297
+ ```
298
+
299
+ ### 5.2 安装依赖
300
+
301
+ ```bash
302
+ pip install -r requirements.txt
303
+ ```
304
+
305
+ ## 6. 安全风险说明
306
+
307
+ ### 6.1 潜在安全风险
308
+
309
+ 1. **远程代码执行风险**
310
+ - 系统允许执行远程命令,可能被恶意利用
311
+ - 建议只在受信任的网络环境中使用
312
+ - 确保服务器密码强度
313
+
314
+ 2. **网络传输风险**
315
+ - 虽然支持HTTPS伪装,但仍可能被网络监控
316
+ - 建议在安全的网络环境中使用
317
+ - 避免传输敏感信息
318
+
319
+ 3. **系统服务风险**
320
+ - 注册为系统服务后,进程具有较高权限
321
+ - 确保系统服务配置正确
322
+ - 定期检查服务状态
323
+
324
+ 4. **密码存储风险**
325
+ - 服务器密码以明文形式存储在内存中
326
+ - 建议使用强密码
327
+ - 避免在公共环境中使用
328
+
329
+ ### 6.2 安全建议
330
+
331
+ - **使用强密码**:为所有服务器配置强密码
332
+ - **网络隔离**:在隔离网络环境中使用
333
+ - **定期更新**:保持系统和依赖包更新
334
+ - **权限控制**:限制Rcoder的运行权限
335
+ - **日志监控**:定期检查系统日志
336
+
337
+ ## 7. 法律责任声明
338
+
339
+ ### 7.1 使用责任
340
+
341
+ 1. **用户责任**
342
+ - 用户必须合法使用本软件,遵守相关法律法规
343
+ - 不得用于任何违法活动
344
+ - 对使用本软件产生的后果负全部责任
345
+
346
+ 2. **免责声明**
347
+ - 本软件仅供技术研究和合法用途
348
+ - 作者不对任何滥用行为负责
349
+ - 使用本软件即表示同意本声明
350
+
351
+ ### 7.2 许可证
352
+
353
+ 本软件采用 MIT 许可证开源,具体条款如下:
354
+
355
+ ```
356
+ MIT License
357
+
358
+ Permission is hereby granted, free of charge, to any person obtaining a copy
359
+ of this software and associated documentation files (the "Software"), to deal
360
+ in the Software without restriction, including without limitation the rights
361
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
362
+ copies of the Software, and to permit persons to whom the Software is
363
+ furnished to do so, subject to the following conditions:
364
+
365
+ The above copyright notice and this permission notice shall be included in all
366
+ copies or substantial portions of the Software.
367
+
368
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
369
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
370
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
371
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
372
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
373
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
374
+ SOFTWARE.
375
+ ```
376
+
377
+ ### 7.3 限制条款
378
+
379
+ - **不得用于违法目的**:包括但不限于未授权访问、数据窃取等
380
+ - **不得损害他人利益**:尊重他人知识产权和隐私
381
+ - **不得规避安全措施**:遵守网络安全法规
382
+ - **不得滥用系统资源**:合理使用服务器资源
383
+
384
+ ## 8. 故障排除
385
+
386
+ ### 8.1 常见问题
387
+
388
+ | 问题 | 可能原因 | 解决方案 |
389
+ |------|----------|----------|
390
+ | 连接失败 | 服务器未运行 | 启动服务器服务 |
391
+ | 认证失败 | 密码错误 | 检查服务器密码 |
392
+ | 进程启动失败 | 权限不足 | 使用管理员权限运行 |
393
+ | 系统服务注册失败 | 权限不足 | 使用sudo或管理员权限 |
394
+ | 命令执行超时 | 网络不稳定 | 检查网络连接或增加超时时间 |
395
+
396
+ ### 8.2 日志查看
397
+
398
+ ```bash
399
+ # 查看Rcoder日志
400
+ cat rcoder.log
401
+
402
+ # 查看系统服务日志(Linux)
403
+ systemctl status rcoder.service
404
+
405
+ # 查看Windows服务日志
406
+ eventvwr.msc
407
+ ```
408
+
409
+ ## 9. 版本信息
410
+
411
+ ### 9.1 当前版本
412
+
413
+ - **版本号**:1.0.0
414
+ - **发布日期**:2026-02-22
415
+ - **开发团队**:Trae Team
416
+
417
+ ### 9.2 更新日志
418
+
419
+ #### v1.0.0 (2026-02-22)
420
+ - ✅ 初始版本发布
421
+ - ✅ 低带宽场景优化
422
+ - ✅ 中转服务器场景支持
423
+ - ✅ 系统进程管理
424
+ - ✅ 服务器别名管理
425
+ - ✅ 异步通讯机制
426
+ - ✅ 消息队列机制
427
+
428
+ ## 10. 联系方式
429
+
430
+ ### 10.1 技术支持
431
+
432
+ - **GitHub**:https://github.com/trae-team/rcoder
433
+ - **Email**:support@trae.io
434
+ - **文档**:https://docs.trae.io/rcoder
435
+
436
+ ### 10.2 贡献指南
437
+
438
+ 欢迎贡献代码、报告问题或提出建议!请访问 GitHub 仓库了解详细的贡献流程。
439
+
440
+ ---
441
+
442
+ **使用本软件即表示您已阅读并同意本文档中的安全风险说明和法律责任声明。**
rcoder-1.0.0/README.md ADDED
@@ -0,0 +1,164 @@
1
+ # OpenClaw SSH 会话管理器
2
+
3
+ 这是一个基于 asyncssh 的长期稳定 SSH 会话管理器,用于管理远程 OpenClaw 主机并进行配置。
4
+
5
+ ## 功能特性
6
+
7
+ - ✅ 基于 asyncssh 的异步 SSH 连接
8
+ - ✅ 长期稳定的会话管理
9
+ - ✅ 远程命令执行
10
+ - ✅ 文件上传/下载
11
+ - ✅ OpenClaw 状态检查
12
+ - ✅ OpenClaw 配置管理
13
+ - ✅ OpenClaw 服务启动/停止
14
+
15
+ ## 安装依赖
16
+
17
+ ```bash
18
+ pip install -r requirements.txt
19
+ ```
20
+
21
+ ## 快速使用
22
+
23
+ ### 基本用法
24
+
25
+ ```python
26
+ import asyncio
27
+ from ssh_manager import SSHSessionManager, OpenClawManager
28
+
29
+ async def main():
30
+ # 创建SSH会话管理器
31
+ ssh_manager = SSHSessionManager()
32
+
33
+ try:
34
+ # 连接到远程主机
35
+ session_id = await ssh_manager.connect(
36
+ host="192.168.1.8",
37
+ username="yupeng",
38
+ password="Ykx130729!",
39
+ alias="openclaw-host"
40
+ )
41
+
42
+ # 创建OpenClaw管理器
43
+ openclaw_manager = OpenClawManager(ssh_manager)
44
+
45
+ # 检查openclaw状态
46
+ status = await openclaw_manager.check_openclaw_status(session_id)
47
+ print("状态检查结果:")
48
+ for cmd, result in status.items():
49
+ print(f"命令: {cmd}")
50
+ print(f" stdout: {result['stdout']}")
51
+ print(f" stderr: {result['stderr']}")
52
+ print(f" 退出码: {result['exit_code']}")
53
+ print()
54
+
55
+ # 配置openclaw
56
+ config_result = await openclaw_manager.configure_openclaw(session_id, {})
57
+ print("配置结果:")
58
+ for cmd, result in config_result.items():
59
+ print(f"命令: {cmd}")
60
+ print(f" 退出码: {result['exit_code']}")
61
+ print()
62
+
63
+ # 启动openclaw
64
+ start_result = await openclaw_manager.start_openclaw(session_id)
65
+ print(f"启动结果 - 退出码: {start_result['exit_code']}")
66
+
67
+ # 检查启动状态
68
+ check_result = await ssh_manager.execute(session_id, "ps aux | grep openclaw | grep -v grep")
69
+ print(f"运行状态:")
70
+ print(check_result['stdout'])
71
+
72
+ finally:
73
+ # 关闭所有会话
74
+ await ssh_manager.close_all()
75
+
76
+ if __name__ == "__main__":
77
+ asyncio.run(main())
78
+ ```
79
+
80
+ ### 直接运行示例
81
+
82
+ ```bash
83
+ python ssh_manager.py
84
+ ```
85
+
86
+ ## 配置说明
87
+
88
+ ### OpenClaw 配置文件
89
+
90
+ 默认配置文件位于 `~/.openclaw/config.yaml`,包含以下内容:
91
+
92
+ ```yaml
93
+ # OpenClaw配置文件
94
+
95
+ # 服务器配置
96
+ server:
97
+ host: 0.0.0.0
98
+ port: 3000
99
+
100
+ # 认证配置
101
+ auth:
102
+ enabled: true
103
+ users:
104
+ - username: admin
105
+ password: admin123
106
+
107
+ # 模型配置
108
+ models:
109
+ default: claude-3-opus-20240229
110
+
111
+ # 日志配置
112
+ logging:
113
+ level: info
114
+ ```
115
+
116
+ ## 注意事项
117
+
118
+ 1. **安全性**:请确保在生产环境中修改默认的认证密码
119
+ 2. **网络**:确保远程主机的 SSH 服务已启动且可访问
120
+ 3. **权限**:确保用户有足够的权限执行相关操作
121
+ 4. **依赖**:远程主机需要已安装 OpenClaw
122
+
123
+ ## 故障排查
124
+
125
+ ### 常见问题
126
+
127
+ 1. **SSH 连接失败**:检查网络连接、主机地址、用户名和密码
128
+ 2. **OpenClaw 未找到**:检查远程主机是否已安装 OpenClaw
129
+ 3. **配置文件写入失败**:检查用户权限
130
+ 4. **服务启动失败**:查看日志文件 `~/.openclaw/openclaw.log`
131
+
132
+ ### 日志查看
133
+
134
+ ```bash
135
+ # 查看本地日志
136
+ python ssh_manager.py 2>&1 | tee ssh_manager.log
137
+
138
+ # 查看远程OpenClaw日志
139
+ ssh yupeng@192.168.1.8 'cat ~/.openclaw/openclaw.log'
140
+ ```
141
+
142
+ ## 高级用法
143
+
144
+ ### 多会话管理
145
+
146
+ ```python
147
+ # 连接多个主机
148
+ session1 = await ssh_manager.connect("192.168.1.8", "user1", "pass1", alias="host1")
149
+ session2 = await ssh_manager.connect("192.168.1.9", "user2", "pass2", alias="host2")
150
+
151
+ # 执行不同操作
152
+ await ssh_manager.execute(session1, "command1")
153
+ await ssh_manager.execute(session2, "command2")
154
+ ```
155
+
156
+ ### 文件传输
157
+
158
+ ```python
159
+ # 上传文件
160
+ await ssh_manager.upload_file(session_id, "local_config.yaml", "~/.openclaw/config.yaml")
161
+
162
+ # 下载文件
163
+ await ssh_manager.download_file(session_id, "~/.openclaw/openclaw.log", "local_openclaw.log")
164
+ ```