mirror of
https://github.com/val1813/kwcode.git
synced 2026-09-07 00:18:18 +08:00
- Add kaiwu/tools/ssh_session.py: SSHSession class with connect/exec/upload/download/close
- Integrate into ToolExecutor: ssh_connect/ssh_exec/ssh_upload/ssh_download/ssh_close
- Guardrails apply to remote commands too (rm -rf blocked on SSH)
- Persistent connection: connect once, exec multiple commands without reconnecting
- Supports password auth and SSH key auth
Usage flow:
executor.ssh_connect("183.222.230.89", port=22102, username="linux", password="xxx")
executor.ssh_exec("systemctl status nginx")
executor.ssh_exec("cd /app && cat config.yml")
executor.ssh_close()
311 tests passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
10 KiB
10 KiB