openclaw tui

打开连接到 Gateway 的终端 UI,或以本地嵌入模式运行。

别名:openclaw chat 和 openclaw terminal(均等同于 openclaw tui --local)

选项

标志默认值说明
--localfalse使用本地嵌入 agent runtime,不连接 Gateway
--url <url>config 中的 gateway.remote.urlGateway WebSocket URL
--token <token>无Gateway token
--password <pass>无Gateway 密码
--session <key>mainSession key
--deliverfalse通过配置的 channel 投递 assistant 回复
--thinking <level>模型默认思考级别覆盖
--message <text>无连接后发送初始消息
--timeout-ms <ms>agents.defaults.timeoutSecondsAgent 超时
--history-limit <n>200加载的历史条数

使用示例

openclaw chat                                          # 本地模式
openclaw tui --local
openclaw tui                                           # 连接 Gateway
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"
openclaw tui --session bugfix                          # 在 agent workspace 内自动推断 agent

注意事项

  • --local 不能与 --url、--token、--password 同时使用
  • 本地模式下 Gateway 专属功能不可用
  • 本地模式增加 /auth [provider] 命令
  • Plugin approval gates 在本地模式下仍然生效,不会自动跳过
  • 在 agent workspace 目录内启动时,自动选择该 agent 作为 session key 默认值

配置修复工作流

当 openclaw config validate 已通过时,用本地模式让 agent 检查并修复配置:

openclaw chat

在 TUI 内执行:

!openclaw config file
!openclaw docs gateway auth token secretref
!openclaw config validate
!openclaw doctor

若 config validate 失败,先用 openclaw configure 或 openclaw doctor --fix 修复,再启动 TUI。

相关链接