给 只能打开 putty.exe 的堡垒机环境 用的 Agent 通道。
人继续用 PuTTY 登录和看屏幕。本机上的 Grok / Claude / Cursor 通过 puttyai.exe(CLI 或 MCP)附着到已经登录的那条 SSH,像在那台服务器上干活。不能另开 SSH,也不能在服务器上装东西。
窗口就是原版 PuTTY,没有内置聊天。
为什么做、做什么、不做什么 → docs/PURPOSE.md
本机 Agent
│ puttyai.exe 或 puttyai mcp
▼
\\.\pipe\PuttyAI.{pid}
▼
putty.exe ← 人的终端(默认:命令打进同一条壳,屏幕上看得见)
- 构建或解压绿色包,得到
putty.exe和puttyai.exe。不要改名putty.exe。 - 用公司堡垒机唤起这个
putty.exe并登录,直到出现 shell 提示符。 - 本机:
puttyai sessions
puttyai exec uname -a
puttyai mcp
MCP:command 指向 puttyai.exe,参数 mcp。
给 Agent 的操作说明:docs/AGENT.md(绿色包里也有一份)。
默认 exec |
键入当前交互壳,和人操作混在一起 |
--isolated |
独立 SSH exec,真实 exit_code,适合 du/find |
| 文件 | 优先 exec。SFTP 在部分堡垒机上会超时 |
| 多会话 | 必须 --pid / MCP session_id |
| 审计 | %TEMP%\puttyai-audit.log;CLI 不拦截危险命令 |
cli/ puttyai.exe(CLI + stdio MCP)
common/ 命名管道帧与 JSON RPC
putty-core/ larryli/PuTTY 0.84-cn + 管道/exec/SFTP
docs/PURPOSE.md 初衷与目标
docs/AGENT.md Agent 手册
docs/BUILD.md 构建
scripts/ build-all.ps1 / test-puttyai.ps1
基于 larryli/PuTTY(0.84 中文版),源码在本仓库的 putty-core/ 中,不是运行时再拉子模块。
需要 Windows x64、VS 2022(C++ 桌面)、CMake ≥ 3.21。细节见 docs/BUILD.md。
powershell -ExecutionPolicy Bypass -File scripts\build-all.ps1
powershell -ExecutionPolicy Bypass -File scripts\test-puttyai.ps1产物:dist\PuttyAI\ 与 dist\PuttyAI-green.zip(不进 git)。
PuTTY:见 putty-core/LICENCE(Simon Tatham;中文版 李峰)。本仓库新增部分见根目录 LICENSE。