Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

putty-for-agent

只能打开 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  ← 人的终端(默认:命令打进同一条壳,屏幕上看得见)

快速使用

  1. 构建或解压绿色包,得到 putty.exeputtyai.exe不要改名 putty.exe
  2. 用公司堡垒机唤起这个 putty.exe 并登录,直到出现 shell 提示符。
  3. 本机:
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

About

Attach a local CLI/MCP agent to a live putty.exe session when a bastion only allows PuTTY.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages