TUI
openclaw tui 的 CLI 参考(由 Gateway 网关支持或本地嵌入式终端 UI)
打开连接到 Gateway 网关的终端 UI,或以本地嵌入模式运行。
相关指南:TUI
选项
| 标志 | 默认值 | 描述 |
|---|---|---|
--local | false | 使用本地嵌入式智能体运行时,而不是 Gateway 网关。 |
--url <url> | 配置中的 gateway.remote.url | Gateway 网关 WebSocket URL。 |
--token <token> | (无) | Gateway 网关令牌(如果需要)。 |
--password <pass> | (无) | Gateway 网关密码(如果需要)。 |
--tls-fingerprint <sha256> | gateway.remote.tlsFingerprint | 固定 wss:// Gateway 网关的预期 TLS 证书指纹。 |
--session <key> | main(范围为全局时使用 global) | 会话键。在 Agent 工作区内,除非添加前缀,否则会自动选择该智能体。 |
--deliver | false | 通过已配置的渠道发送助手回复。 |
--thinking <level> | (模型默认值) | 覆盖思考级别。 |
--message <text> | (无) | 连接后发送初始消息。 |
--timeout-ms <ms> | agents.defaults.timeoutSeconds | 智能体超时时间。无效值会记录警告并被忽略。 |
--history-limit <n> | 200 | 连接时加载的历史记录条目数。 |
别名:openclaw chat 和 openclaw terminal 会调用此命令,并隐含使用
--local。
注意事项
--local不能与--url、--token、--password或--tls-fingerprint组合使用。- 在可能的情况下,
tui会解析为令牌/密码身份验证配置的 Gateway 网关身份验证 SecretRefs (env/file/exec提供商)。 - 未显式指定 URL 或端口时,
tui会采用正在运行的 Gateway 网关所记录的活动本地 Gateway 网关端口。 显式的--url、OPENCLAW_GATEWAY_URL、OPENCLAW_GATEWAY_PORT和远程 Gateway 网关配置仍具有优先权。 - 从已配置的 Agent 工作区目录内启动时,TUI 会自动选择
该智能体作为会话键的默认值(除非将
--session显式设为agent:<id>:...)。 - 本地模式直接使用嵌入式智能体运行时。大多数本地工具都可使用, 但仅限 Gateway 网关的功能不可用。
- 本地模式会将
/auth [provider]添加到 TUI 命令界面。 - 插件审批门控在本地模式下仍然适用:需要审批的工具 会在终端中提示作出决定,不会静默自动批准任何操作。
- 会话目标显示在页脚中,并可使用
/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 "将我的配置与文档进行比较,并告诉我需要修复什么"
# 在智能体工作区内运行时,会自动推断该智能体
openclaw tui --session bugfix配置修复循环
使用本地模式,让嵌入式智能体检查当前配置,将其与文档进行比较, 并协助在同一个终端中修复配置。
如果 openclaw config validate 已经失败,请先运行 openclaw configure 或
openclaw doctor --fix;openclaw chat 不会绕过
无效配置保护。
openclaw chat然后在 TUI 内:
!openclaw config file
!openclaw docs gateway auth token secretref
!openclaw config validate
!openclaw doctor使用 openclaw config set 或 openclaw configure 应用针对性修复,然后
重新运行 openclaw config validate。请参阅 TUI 和
配置。