openclaw常用命令

OpenClaw 常用命令速查手冊(cè)

OpenClaw 是一款運(yùn)行在本地電腦上的 AI 助手,通過(guò) WhatsApp、Telegram、Discord 等聊天應(yīng)用與你交互,幫助處理郵件、日歷、文件等日常事務(wù)。本文檔整理了 OpenClaw 最常用的命令,供日常參考使用。


一、基礎(chǔ)命令

基礎(chǔ)命令是日常使用中最頻繁的操作,涵蓋服務(wù)狀態(tài)查看、初始化配置等核心功能。

命令 功能說(shuō)明
openclaw status 查看 Gateway 當(dāng)前運(yùn)行狀態(tài),包含健康度與上下文信息
openclaw health 健康檢查,檢測(cè) core、依賴與運(yùn)行環(huán)境
openclaw doctor 綜合診斷與修復(fù)建議,支持 --deep 深度檢查
openclaw onboard 交互式初始化向?qū)?,首次使用推薦執(zhí)行
openclaw onboard --install-daemon 安裝系統(tǒng)守護(hù)進(jìn)程,后臺(tái)常駐運(yùn)行 Gateway
openclaw onboard --uninstall-daemon 卸載守護(hù)進(jìn)程,不刪除數(shù)據(jù)
openclaw configure 交互式配置向?qū)?,可配置模型、通道、憑據(jù)等
openclaw dashboard 獲取 Web UI 訪問(wèn)鏈接
openclaw update 更新到最新版本
openclaw security audit --deep 安全審計(jì),深度檢查系統(tǒng)安全

二、Gateway 服務(wù)管理

Gateway 是 OpenClaw 的核心服務(wù)組件,負(fù)責(zé)維持 AI 助手的持續(xù)運(yùn)行。

命令 功能說(shuō)明
openclaw gateway start 啟動(dòng) Gateway 服務(wù)
openclaw gateway stop 停止 Gateway 服務(wù)
openclaw gateway restart 重啟 Gateway 服務(wù),配置變更后使用
openclaw gateway status 查看 Gateway 系統(tǒng)服務(wù)狀態(tài)
openclaw gateway install 安裝 Gateway 系統(tǒng)服務(wù),注冊(cè)為系統(tǒng)守護(hù)進(jìn)程
openclaw gateway 運(yùn)行 WebSocket 網(wǎng)關(guān)服務(wù)(可加 --port 指定端口)

提示:如果端口 18789 被占用,可以使用其他端口啟動(dòng)服務(wù):openclaw gateway --port 18790


三、通道管理

通道是指 OpenClaw 連接的聊天平臺(tái),如 WhatsApp、Telegram、Discord 等。

命令 功能說(shuō)明
openclaw channels list 列出已登錄的通道(WhatsApp/Telegram/Discord 等)
openclaw channels login 登錄新的通道賬號(hào)(WhatsApp 掃碼或授權(quán)流程)
openclaw channels add 添加通道,如 Telegram/Discord/Slack
openclaw channels add --channel telegram 添加 Telegram 通道(需 Bot Token)
openclaw channels add --channel discord 添加 Discord 通道(需 Bot Token)
openclaw channels add --channel slack 添加 Slack 通道(需 Bot Token)
openclaw channels status --probe 通道健康檢測(cè),檢查連接可達(dá)性

四、配置管理

通過(guò)命令行直接讀取或修改 OpenClaw 的配置項(xiàng)。

命令 功能說(shuō)明
openclaw config get <path> 獲取配置值,支持 JSON Path 語(yǔ)法
openclaw config set <path> <value> 設(shè)置配置項(xiàng),支持 JSON5 或 raw 文本
openclaw config unset <path> 清除配置項(xiàng),移除單個(gè)鍵值

五、技能與插件管理

技能(Skills)和插件(Plugins)擴(kuò)展了 OpenClaw 的功能。

命令 功能說(shuō)明
openclaw skills list 列出已安裝和可用的技能
openclaw skills info <skill> 查看技能詳情,包括參數(shù)和版本信息
clawhub install <slug> 從 ClawHub 官方技能市場(chǎng)安裝技能
openclaw hooks list 列出 Hook 列表,事件鉤子機(jī)制
openclaw plugins list 列出已安裝的插件
openclaw plugins install <id> 安裝插件,例如 @openclaw/voice-call
openclaw plugins enable <id> 啟用插件,通常需要重啟 Gateway

六、模型管理

OpenClaw 支持多種 AI 模型,以下是模型相關(guān)的管理命令。

命令 功能說(shuō)明
openclaw models list 列出可用模型,包含鑒權(quán)狀態(tài)
openclaw models status 查看模型當(dāng)前可用性狀態(tài)
openclaw models auth setup-token 配置模型鑒權(quán),推薦使用 Cheatsheet 方式

七、日志與診斷

排查問(wèn)題時(shí),日志和診斷命令非常有用。

命令 功能說(shuō)明
openclaw logs 查看日志,默認(rèn)聚合輸出
openclaw logs --follow 實(shí)時(shí)日志滾動(dòng)輸出
openclaw logs --json JSON 格式輸出日志
openclaw logs --plain 純文本格式輸出日志
openclaw logs --limit 限制日志輸出數(shù)量
openclaw doctor --deep 深度診斷問(wèn)題

八、內(nèi)存與定時(shí)任務(wù)

命令 功能說(shuō)明
openclaw memory search "X" 搜索長(zhǎng)期記憶,向量搜索功能
openclaw memory index 重建記憶索引,修復(fù) memory 異常
openclaw subagents list 列出子代理
openclaw cron list 列出定時(shí)任務(wù)
openclaw cron run <id> 執(zhí)行指定定時(shí)任務(wù)

九、瀏覽器與自動(dòng)化

命令 功能說(shuō)明
openclaw browser start 啟動(dòng)瀏覽器代理,開啟 Automation 能力
openclaw browser screenshot 網(wǎng)頁(yè)截圖

十、卸載命令

命令 功能說(shuō)明
openclaw uninstall 卸載 Gateway 服務(wù)及數(shù)據(jù)
openclaw uninstall --all --yes --non-interactive 全自動(dòng)卸載(狀態(tài)/workspace/插件)
openclaw uninstall --dry-run 模擬卸載,僅展示結(jié)果不實(shí)際刪除
openclaw uninstall --state 刪除狀態(tài)文件,不刪除 workspace
openclaw uninstall --workspace 刪除工作區(qū)(agent/workspace 數(shù)據(jù))
openclaw uninstall --service 僅卸載系統(tǒng)服務(wù),不刪除數(shù)據(jù)

十一、聊天內(nèi)斜杠命令

在聊天界面中可使用的斜杠命令。

命令 功能說(shuō)明
/status 查看健康狀態(tài)和上下文信息
/context list 查看上下文貢獻(xiàn)者
/model <m> 切換 AI 模型
/compact 釋放窗口空間
/new 全新會(huì)話
/stop 中止當(dāng)前運(yùn)行
/tts on / tts off 開啟/關(guān)閉語(yǔ)音合成
/think 切換推理模式

快速入門指南

對(duì)于新用戶,建議按照以下順序操作:

  1. 運(yùn)行 openclaw onboard 進(jìn)入交互式配置向?qū)?/li>
  2. 使用 openclaw gateway start 啟動(dòng)服務(wù)
  3. 通過(guò) openclaw channels loginopenclaw channels add 配置聊天通道
  4. 使用 openclaw status 確認(rèn)服務(wù)正常運(yùn)行

附錄:常用命令速查表

分類 命令 用途
啟動(dòng) openclaw gateway start 啟動(dòng) OpenClaw 服務(wù)
停止 openclaw gateway stop 停止 OpenClaw 服務(wù)
狀態(tài) openclaw status 查看運(yùn)行狀態(tài)
配置 openclaw onboard 重新配置向?qū)?/td>
診斷 openclaw doctor 排查問(wèn)題
更新 openclaw update 更新版本
日志 openclaw logs 查看日志
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容