TUI 是 OpenClaw 的终端聊天界面,支持 Gateway 模式和本地嵌入模式。
快速启动
# Gateway 模式
openclaw gateway # 先启动 Gateway
openclaw tui # 连接本地 Gateway
# 远程 Gateway
openclaw tui --url ws://<host>:<port> --token <gateway-token>
# 本地模式(无 Gateway)
openclaw chat # 或 openclaw tui --localopenclaw chat、openclaw terminal 是 openclaw tui --local 的别名。
界面布局
- Header:连接 URL、当前 agent、当前 session
- Chat log:用户消息、助手回复、系统通知、工具卡片
- Status line:连接/运行状态
- Footer:连接状态 + agent + session + model + 功能开关 + token 计数
- Input:带自动补全的文本编辑器
键盘快捷键
| 快捷键 | 功能 |
|---|---|
| Enter | 发送消息 |
| Esc | 中止活跃运行 |
| Ctrl+C | 清空输入(按两次退出) |
| Ctrl+L | 模型选择器 |
| Ctrl+G | Agent 选择器 |
| Ctrl+P | Session 选择器 |
| Ctrl+O | 切换工具输出展开 |
| Ctrl+T | 切换思考可见性 |
Slash 命令
/agent <id> /session <key> /model <provider/model>
/think <level> /fast <on|off> /verbose <on|off>
/new /reset /abort
/deliver <on|off>
本地 Shell 命令
以 ! 前缀运行本地 shell 命令(每 session 提示一次授权):
!openclaw config file
!openclaw config validate
!openclaw doctor
配置修复工作流
openclaw chat
# 在 TUI 中:
# 1. 询问 agent 检查配置
# 2. 用 !openclaw config validate 验证
# 3. 用 openclaw config set 应用修改
# 4. 用 !openclaw doctor --fix 执行自动修复选项
| 选项 | 说明 |
|---|---|
--local | 使用本地嵌入 agent 运行时 |
--url <url> | Gateway WebSocket URL |
--token <token> | Gateway token |
--session <key> | Session 键(默认 main) |
--deliver | 开启回复投递(默认关闭) |
--history-limit <n> | 加载历史条数(默认 200) |
相关页面
- web-control-ui — 浏览器控制界面
- web-dashboard — Gateway 仪表板