Token导航 LogoToken导航TokenDH.com
Tui Pilot logo
AI代理未说明官方级别未说明来源级核验

Tui Pilot

MCP Server

tui-pilot是一个MCP服务器,允许AI代理在macOS上启动、观察和与真实终端应用程序交互,通过tmux和终端窗口实现精确控制。

工具数

6

提示词数

0

GitHub Stars

2

资源数

0
自动化测试TypeScriptClaudeAI代理Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

SaladDay

提供方

SaladDay

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

tui-pilot

Give your AI agent eyes and hands inside any terminal UI.

= 20.19" />

中文文档

思考 剧作家,但适用于终端应用程序而不是浏览器。

tui-pilot 是一个 主控程序 允许AI代理在macOS上启动、观察和与真实终端应用程序交互的服务器。它在内部运行目标应用程序 tmux,在真实的终端窗口中渲染,通过macOS原生API捕获像素完美的PNG屏幕截图,并通过一套干净的MCP工具公开所有内容。

没有ANSI重新渲染。没有虚假的终端模拟。你的代理人所看到的正是人类所看到的。

建筑

三个平面在统一的MCP接口下协同工作:

飞机以责任为后盾
控制tmux会话生命周期、密钥分发、文本捕获
渲染WezTerm/GGhosttyGPU加速的真实终端渲染
截图Swift+CoreGraphics原生窗口发现和像素完美的PNG捕获

工作流程

A real session: OpenCode drives cc-switch through tui-pilot, with the agent trace on the left and the live terminal window on the right.

步骤工具发生了什么
预检tui_doctor验证依赖关系和权限
发射tui_start创建tmux会话+附加终端窗口
快照tui_snapshot捕获纯文本+ANSI文本+真实PNG屏幕截图
互动tui_send_keys / tui_type发送按键或键入文本
清理tui_stop优雅的会议拆卸

步骤3-4形成一个 观察动作循环:快照当前状态,决定输入,发送它,然后再次快照——根据需要多次。

工具

工具说明
tui_doctor检查依赖关系、后端选择、GUI启发式和权限检查
tui_start启动tmux支持的会话并附加新的终端窗口
tui_send_keys发送指定按键-- Down, Up, Enter, Escape等等。
tui_type通过发送文字文本 tmux send-keys -l
tui_snapshot在一次调用中捕获纯文本、ANSI文本和PNG屏幕截图
tui_stop停止tmux会话并释放所有资源
\[!提示\] 跑 tui_doctor 首先如果 tui_starttui_snapshot 失败。它会告诉您选择了哪个后端,并提醒您授予屏幕录制权限。

需求

  • macOS 具有活动的GUI会话
  • Node.js 20.19+
  • 子速率复用器
  • WezTerm幽灵
  • Swiftc (Xcode命令行工具附带)
  • 屏幕录制 启动应用程序的权限 tui-pilot
\[!注意\] 如果屏幕截图因权限错误而失败,请将屏幕录制授予生成服务器的任何应用程序——终端、iTerm或您的MCP客户端。

入门

1.让你的AI安装它(推荐)

如果您使用Claude Code、OpenCode或其他支持MCP的代理,请粘贴其中一个提示。

仅限MCP

Install `tui-pilot` into my MCP client. Use `/absolute/path/to/tui-pilot` as the project path, build anything that is needed, register it as a local stdio MCP server, and then run `tui_doctor`. Do not install the optional skill.

MCP+可选技能

Install `tui-pilot` into my MCP client. Use `/absolute/path/to/tui-pilot` as the project path, build anything that is needed, register it as a local stdio MCP server, and also install the optional local skill `tui-pilot-visual-check` if my client supports skills. After setup, run `tui_doctor` and tell me what still needs manual approval.

仅当您的客户支持本地技能时,才安装可选技能。

Other installation options

构建服务器

npm install
./scripts/build-window-helper.sh
npm run build

注册MCP服务器

将MCP客户端指向内置服务器:

node /absolute/path/to/tui-pilot/dist/index.js

对于开发,您可以将客户指向 npm run dev 相反。在分别存储命令和参数的客户端中,将其作为命令输入 npm 带args rundev.

OpenCode示例:

{
  "mcp": {
    "tui-pilot": {
      "type": "local",
      "enabled": true,
      "command": ["node", "/absolute/path/to/tui-pilot/dist/index.js"],
      "timeout": 30000
    }
  }
}

克劳德桌面示例:

{
  "mcpServers": {
    "tui-pilot": {
      "command": "node",
      "args": ["/absolute/path/to/tui-pilot/dist/index.js"]
    }
  }
}

如果要强制此服务器进程使用渲染后端,请设置 TUI_PILOT_TERMINAL_BACKENDweztermghostty 在您的客户端配置中。

可选技能

回购包括一项本地技能 .agents/skills/tui-pilot-visual-check.

mkdir -p ~/.config/opencode/skills
cp -R .agents/skills/tui-pilot-visual-check ~/.config/opencode/skills/

重新启动MCP客户端,或打开一个新会话,以便重新加载MCP配置和可选技能。

验证安装

tui_doctor 没有争论。

确认:

  • automaticChecksPassedtrue
  • backend.selected 是您期望的终端后端吗
  • manualChecksRequired 包括 screen-recording

tui_doctor 不会自动验证屏幕录制权限,因此请与进行一次实时检查 tui_snapshot 设置后。

用法

开发模式 (保存时自动重新加载):

npm run dev

生产模式:

npm run build
node dist/index.js

后端选择

tui-pilot 自动按以下顺序检测渲染后端:WezTerm→ 幽灵。

用环境变量覆盖:

TUI_PILOT_TERMINAL_BACKEND=ghostty npm run dev

支持的值: auto, wezterm, ghostty.

快速示例

回购包括 fixtures/mini-tui.ts,用于测试的键盘驱动菜单:

1. tui_doctor      → confirm automaticChecksPassed is true
2. tui_start       → launch the fixture app
3. tui_snapshot    → read textView + inspect the PNG
4. tui_send_keys   → send "Down"
5. tui_snapshot    → confirm the selection moved
6. tui_stop        → clean up

屏幕截图和辅助二进制文件位于 .tui-pilot/.

测试

npm test              # run all tests
npm run typecheck     # type-check without emitting

路线图

  • \[x\] macOS支持(WezTerm/GGhostty)
  • \[\]Linux支持(X11/Wayland截图后端)
  • \[\]Windows支持(Windows终端+本机捕获)
\[!注意\] 计划为Linux和Windows提供跨平台支持。敬请期待!

进一步阅读

目录标签

目录标签

自动化测试TypeScriptClaudeAI代理终端控制本地部署MCP协议macOS工具

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

6

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明session部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP