跳转到主要内容

openclaw tui

打开连接到 Gateway 网关的终端 UI,或以本地嵌入式模式运行它。 相关指南:TUI

选项

标志默认值描述
--localfalse使用本地嵌入式智能体运行时,而不是 Gateway 网关运行。
--url <url>配置中的 gateway.remote.urlGateway 网关 WebSocket URL。
--token <token>(无)如有需要,使用 Gateway 网关令牌。
--password <pass>(无)如有需要,使用 Gateway 网关密码。
--session <key>main(或当作用域为全局时为 global会话键。在智能体工作区内,除非添加前缀,否则它会自动选择该智能体。
--deliverfalse通过已配置的渠道发送助手回复。
--thinking <level>(模型默认值)思考级别覆盖。
--message <text>(无)连接后发送初始消息。
--timeout-ms <ms>agents.defaults.timeoutSeconds智能体超时。无效值会记录警告并被忽略。
--history-limit <n>200附加时加载的历史条目数。
别名:openclaw chatopenclaw terminal 会调用此命令,并隐含 --local

说明

  • --local 不能与 --url--token--password 组合使用。
  • tui 会在可能时解析已配置的 Gateway 网关认证 SecretRefs,用于令牌/密码认证 (env/file/exec 提供商)。
  • 如果没有显式 URL 或端口,tui 会跟随正在运行的 Gateway 网关记录的活动本地 Gateway 网关端口。 显式 --urlOPENCLAW_GATEWAY_URLOPENCLAW_GATEWAY_PORT 和远程 Gateway 网关配置保持优先级。
  • 从已配置的智能体工作区目录内启动时,TUI 会自动选择 该智能体作为会话键默认值(除非 --session 显式为 agent:<id>:...)。
  • 若要在页脚中为非本地 URL 支持的连接显示 Gateway 网关主机名, 请运行 openclaw config set tui.footer.showRemoteHost true。默认关闭; 对 local loopback 或嵌入式本地连接绝不显示。
  • 本地模式直接使用嵌入式智能体运行时。大多数本地工具可用, 但仅 Gateway 网关支持的功能不可用。
  • 本地模式会向 TUI 命令界面添加 /auth [provider]
  • 插件审批门禁在本地模式下仍然适用:需要审批的工具 会在终端中提示决策,不会静默自动批准任何内容。
  • 会话目标会显示在页脚中,并可通过 /goal 管理。

示例

openclaw chat
openclaw tui --local
openclaw tui
openclaw tui --url ws://127.0.0.1:18789 --token <token>
openclaw tui --session main --deliver
openclaw chat --message "Compare my config to the docs and tell me what to fix"
# when run inside an agent workspace, infers that agent automatically
openclaw tui --session bugfix

配置修复循环

使用本地模式让嵌入式智能体检查当前配置,将其与文档对比, 并从同一个终端帮助修复它。 如果 openclaw config validate 已经失败,请先运行 openclaw configureopenclaw doctor --fixopenclaw chat 不会绕过 无效配置保护。
openclaw chat
然后在 TUI 内:
!openclaw config file
!openclaw docs gateway auth token secretref
!openclaw config validate
!openclaw doctor
使用 openclaw config setopenclaw configure 应用定向修复,然后 重新运行 openclaw config validate。请参阅 TUI配置

相关