CLI commands
終端介面
openclaw tui
開啟連接到閘道的終端 UI,或以本機嵌入模式執行。
相關:
- 終端介面指南:終端介面
選項
| 旗標 | 預設值 | 說明 |
|---|---|---|
--local |
false |
針對本機嵌入式代理執行階段執行,而不是針對閘道。 |
--url <url> |
設定中的 gateway.remote.url |
閘道 WebSocket URL。 |
--token <token> |
(無) | 需要時使用的閘道權杖。 |
--password <pass> |
(無) | 需要時使用的閘道密碼。 |
--session <key> |
main(或範圍為全域時的 global) |
工作階段鍵。在代理工作區內,除非加上前綴,否則會自動選取該代理。 |
--deliver |
false |
透過已設定的頻道傳遞助理回覆。 |
--thinking <level> |
(模型預設值) | 覆寫思考層級。 |
--message <text> |
(無) | 連線後傳送初始訊息。 |
--timeout-ms <ms> |
agents.defaults.timeoutSeconds |
代理逾時。無效值會記錄警告並被忽略。 |
--history-limit <n> |
200 |
連接時要載入的歷史項目數。 |
別名:openclaw chat 和 openclaw terminal 會呼叫相同命令,並隱含使用 --local。
注意事項:
chat和terminal是openclaw tui --local的別名。--local不能與--url、--token或--password搭配使用。- 可行時,
tui會為權杖/密碼驗證解析已設定的閘道驗證 SecretRefs(env/file/exec提供者)。 - 從已設定的代理工作區目錄內啟動時,終端介面會自動為工作階段鍵預設值選取該代理(除非
--session明確為agent:<id>:...)。 - 若要在非本機、URL 支援的連線頁尾中顯示閘道主機名稱,請執行
openclaw config set tui.footer.showRemoteHost true。主機標籤預設關閉,且絕不會出現在回送或嵌入式本機連線中。 - 本機模式會直接使用嵌入式代理執行階段。大多數本機工具都可運作,但僅限閘道的功能無法使用。
- 本機模式會在終端介面命令介面中加入
/auth [provider]。 - 外掛核准閘門在本機模式中仍然適用。需要核准的工具會在終端機中提示做出決定;不會因為未涉及閘道就默默自動核准任何內容。
- 工作階段目標會顯示在頁尾,並可使用
/goal管理。
範例
openclaw chatopenclaw tui --localopenclaw tuiopenclaw tui --url ws://127.0.0.1:18789 --token <token>openclaw tui --session main --deliveropenclaw chat --message "Compare my config to the docs and tell me what to fix"# when run inside an agent workspace, infers that agent automaticallyopenclaw tui --session bugfix設定修復迴圈
當目前設定已通過驗證,而你想要讓嵌入式代理從同一個終端機檢查設定、與文件比較,並協助修復時,請使用本機模式:
如果 openclaw config validate 已經失敗,請先使用 openclaw configure 或 openclaw doctor --fix。openclaw chat 不會繞過無效設定防護。
openclaw chat接著在終端介面中:
!openclaw config file!openclaw docs gateway auth token secretref!openclaw config validate!openclaw doctor使用 openclaw config set 或 openclaw configure 套用目標修復,然後重新執行 openclaw config validate。請參閱終端介面和設定。
相關
Was this useful?