OpenClaw命令速查手冊(cè)20+(核心命令 + 實(shí)戰(zhàn)示例)

OpenClaw 是一個(gè)強(qiáng)大的 AI 助手框架,但有 40+ 核心命令,記不住怎么辦?
別擔(dān)心!本文為你整理了 20+ 最常用的 OpenClaw 命令,按功能分類(lèi),并提供實(shí)戰(zhàn)示例,讓你的日常工作效率提升 5 倍!
無(wú)論是配置管理、消息發(fā)送、技能部署,還是 Gateway 控制,都能在這里找到快速答案。
一、快速入門(mén)
1.1 查看幫助信息
# 查看所有命令 openclaw --help # 查看版本號(hào) openclaw --version # 查看特定命令的幫助 openclaw <command> --help # 示例:查看 config 命令幫助 openclaw config --help
1.2 初始化配置
# 首次安裝后初始化配置 openclaw setup # 交互式引導(dǎo)配置(推薦新手) openclaw onboard #配置 + 安裝系統(tǒng)后臺(tái)服務(wù)(開(kāi)機(jī)自啟) openclaw onboard --install-daemon # 打開(kāi)控制面板 openclaw dashboard
二、配置管理命令
2.1 查看配置
# 查看完整配置 openclaw config get # 查看特定配置項(xiàng) openclaw config get models.default openclaw config get providers.mistral.apiKey # 查看特定部分配置 openclaw config get --section models openclaw config get --section providers
示例輸出:
{
"models": {
"default": "mistral:mixtral-8x7b"
},
"providers": {
"mistral": {
"apiKey": "***REDACTED***"
}
}
}2.2 設(shè)置配置
# 設(shè)置默認(rèn)模型 openclaw config set models.default mistral:mixtral-8x7b # 設(shè)置快速模型 openclaw config set models.fast mistral:mistral-7b # 配置 Mistral API Key openclaw config set providers.mistral.apiKey YOUR_API_KEY_HERE # 啟用緩存 openclaw config set cache.enabled true openclaw config set cache.maxSize 5000
2.3 刪除配置
# 刪除特定配置項(xiàng) openclaw config unset models.fast # 重置某個(gè)節(jié)點(diǎn) openclaw config unset models
2.4 配置向?qū)?/h3>
# 打開(kāi)完整配置向?qū)?
openclaw configure
# 打開(kāi)特定部分配置向?qū)?
openclaw configure --section models
openclaw configure --section providers
openclaw configure --section channels
# 打開(kāi)完整配置向?qū)? openclaw configure # 打開(kāi)特定部分配置向?qū)? openclaw configure --section models openclaw configure --section providers openclaw configure --section channels
三、Gateway 控制命令
3.1 啟動(dòng)/停止 Gateway
# 啟動(dòng) Gateway(默認(rèn)端口 18789) openclaw gateway start # 自定義端口啟動(dòng) openclaw gateway start --port 19000 # 強(qiáng)制啟動(dòng)(殺死占用進(jìn)程) openclaw gateway start --force # 停止 Gateway openclaw gateway stop # 重啟 Gateway openclaw gateway restart # 查看運(yùn)行狀態(tài) openclaw gateway status
3.2 運(yùn)行時(shí) Gateway
# 前臺(tái)運(yùn)行 Gateway(調(diào)試用) openclaw gateway # 開(kāi)發(fā)模式運(yùn)行(隔離狀態(tài)) openclaw --dev gateway # 查看健康狀態(tài) openclaw health
3.3 查看日志
# 查看實(shí)時(shí)日志 openclaw logs # 查看最近 50 行日志 openclaw logs --lines 50 # 查看錯(cuò)誤日志 openclaw logs --filter error # 持續(xù)監(jiān)控日志 openclaw logs --follow
3.4 系統(tǒng)服務(wù)管理
# 使用 systemd 管理(推薦生產(chǎn)環(huán)境) sudo systemctl start openclaw-gateway sudo systemctl stop openclaw-gateway sudo systemctl restart openclaw-gateway sudo systemctl status openclaw-gateway # 開(kāi)機(jī)自啟動(dòng) sudo systemctl enable openclaw-gateway
四、消息發(fā)送命令
4.1 發(fā)送消息
# 發(fā)送消息到當(dāng)前會(huì)話(huà) openclaw message send --message "Hello" # 發(fā)送到特定目標(biāo)(Telegram) openclaw message send \ --channel telegram \ --target @mychat \ --message "Hello from OpenClaw" # 發(fā)送到特定目標(biāo)(WhatsApp) openclaw message send \ --channel whatsapp \ --target +8613800138000 \ --message "您好" # 發(fā)送到 Slack 頻道 openclaw message send \ --channel slack \ --target C1234567890 \ --message "@channel 重要通知"
4.2 發(fā)送媒體文件
# 發(fā)送圖片 openclaw message send \ --channel telegram \ --target @mychat \ --media /tmp/photo.jpg \ --caption "這是一張圖片" # 發(fā)送音頻 openclaw message send \ --channel whatsapp \ --target +8613800138000 \ --media /tmp/voice.mp3 # 發(fā)送文檔 openclaw message send \ --channel telegram \ --target @mychat \ --media /tmp/report.pdf
4.3 高級(jí)消息功能
# 發(fā)送 JSON 格式(腳本自動(dòng)化) openclaw message send \ --target @mychat \ --message "Hello" \ --json # 回復(fù)消息 openclaw message send \ --target @mychat \ --message "收到" \ --replyTo 12345 # 指定頻道 openclaw message send \ --channel discord \ --target channel:1234567890 \ --message "Hello"
4.4 頻道動(dòng)作(投票、反應(yīng)等)
# 創(chuàng)建投票(Telegram) openclaw message send \ --channel telegram \ --target @mychat \ --pollQuestion "OpenClaw 好用嗎?" \ --pollOption 非常好用 \ --pollOption 一般 \ --pollOption 還需要改進(jìn) \ --pollDurationHours 24 # 發(fā)送反應(yīng)(Discord) openclaw message send \ --channel discord \ --messageId 1234567890 \ --emoji ?? \ --action react
五、技能管理命令
5.1 查看技能列表
# 查看所有已安裝技能 openclaw skills list # 搜索技能 openclaw skills search weather # 查看技能詳情 openclaw skills show weather
5.2 安裝/卸載技能
# 安裝技能 openclaw skills install weather # 從指定來(lái)源安裝 openclaw skills install weather --source github # 指定版本安裝 openclaw skills install weather@1.2.0 # 卸載技能 openclaw skills uninstall weather
5.3 更新技能
# 更新所有技能 openclaw skills update # 更新特定技能 openclaw skills update weather # 同步技能 openclaw skills sync
5.4 技能開(kāi)發(fā)
# 創(chuàng)建新技能 openclaw skills create my-skill # 驗(yàn)證技能 openclaw skills validate my-skill # 打包技能 openclaw skills pack my-skill
六、模型配置命令
6.1 查看模型
# 查看所有配置的模型 openclaw models list # 查看默認(rèn)模型 openclaw models default # 查看模型詳情 openclaw models show mistral:mixtral-8x7b
6.2 配置模型
# 設(shè)置默認(rèn)模型 openclaw models set-default mistral:mixtral-8x7b # 添加新模型 openclaw models add \ --name my-model \ --provider mistral \ --id mistral-medium \ --maxTokens 8192 # 測(cè)試模型 openclaw models test \ --model mistral:mixtral-8x7b \ --prompt "Hello, OpenClaw!"
6.3 模型切換
# 臨時(shí)指定模型 openclaw agent \ --model mistral:mistral-7b \ --message "快速響應(yīng)" # 使用內(nèi)置模型別名 openclaw agent --model fast --message "這個(gè)用fast模型" openclaw agent --model premium --message "這個(gè)用premium模型"
七、頻道管理命令
7.1 查看頻道
# 查看所有配置的頻道 openclaw channels list # 查看頻道狀態(tài) openclaw channels status # 查看特定頻道詳情 openclaw channels show telegram
7.2 登錄頻道
# Telegram 登錄 openclaw channels login --channel telegram # WhatsApp 登錄(會(huì)顯示 QR 碼) openclaw channels login --channel whatsapp --verbose # Slack 登錄 openclaw channels login --channel slack # Discord 登錄 openclaw channels login --channel discord
7.3 頻道測(cè)試
# 測(cè)試頻道連接 openclaw channels test --channel telegram # 發(fā)送測(cè)試消息 openclaw channels test \ --channel telegram \ --target @mychat \ --message "測(cè)試消息"
7.4 頻道配置
# 配置頻道 openclaw channels configure --channel telegram # 更新頻道 Token openclaw channels update \ --channel telegram \ --token NEW_TOKEN # 啟用/禁用頻道 openclaw channels enable telegram openclaw channels disable telegram
八、會(huì)話(huà)管理命令
8.1 查看會(huì)話(huà)
# 列出所有會(huì)話(huà) openclaw sessions # 列出活躍會(huì)話(huà) openclaw sessions --active # 列出特定頻道的會(huì)話(huà) openclaw sessions --channel telegram # 顯示最近 10 個(gè)會(huì)話(huà) openclaw sessions --limit 10
8.2 查看會(huì)話(huà)歷史
# 查看特定會(huì)話(huà)的歷史 openclaw sessions history <session-key> # 查看最近的消息 openclaw sessions history <session-key> --limit 20 # 導(dǎo)出會(huì)話(huà)歷史 openclaw sessions history <session-key> --export > history.json
8.3 會(huì)話(huà)操作
# 發(fā)送消息到會(huì)話(huà) openclaw sessions send \ --session <session-key> \ --message "你好" # 重置會(huì)話(huà) openclaw sessions reset <session-key> # 刪除會(huì)話(huà) openclaw sessions delete <session-key>
九、節(jié)點(diǎn)管理命令(智能家居控制)
9.1 查看節(jié)點(diǎn)
# 查看所有配對(duì)的節(jié)點(diǎn) openclaw nodes list # 查看節(jié)點(diǎn)狀態(tài) openclaw nodes status # 描述節(jié)點(diǎn)詳情 openclaw nodes describe <node-id>
9.2 節(jié)點(diǎn)操作
# 發(fā)送通知到節(jié)點(diǎn) openclaw nodes notify \ --node my-phone \ --title "提醒" \ --body "該吃飯了" # 設(shè)置推送優(yōu)先級(jí) openclaw nodes notify \ --node my-phone \ --priority timeSensitive \ --title "緊急通知" \ --body "快遞到了" # 查看相冊(cè)(手機(jī)) openclaw nodes camera-list --node my-phone # 拍照 openclaw nodes camera-snap \ --node my-phone \ --facing back \ --output /tmp/photo.jpg
9.3 節(jié)點(diǎn)配對(duì)
# 啟動(dòng)配對(duì) openclaw node pairing start # 查看待配對(duì)節(jié)點(diǎn) openclaw nodes pending # 批準(zhǔn)配對(duì) openclaw nodes approve --node <node-id> # 拒絕配對(duì) openclaw nodes reject --node <node-id>
十、記憶管理命令
10.1 搜索記憶
# 搜索記憶 openclaw memory search "OpenClaw 配置" # 搜索并顯示多行上下文 openclaw memory search "配置" --lines 5 # 搜索特定路徑的記憶 openclaw memory search "配置" --path MEMORY.md # 限制結(jié)果數(shù)量 openclaw memory search "配置" --maxResults 10
10.2 記憶操作
# 查看記憶統(tǒng)計(jì) openclaw memory stats # 清理過(guò)期記憶 openclaw memory clean # 備份記憶 openclaw memory backup --output /tmp/memory-backup.json
十一、Cron 定時(shí)任務(wù)命令
11.1 查看 Cron 任務(wù)
# 列出所有任務(wù) openclaw cron list # 查看任務(wù)運(yùn)行歷史 openclaw cron runs <job-id> # 查看調(diào)度器狀態(tài) openclaw cron status
11.2 創(chuàng)建 Cron 任務(wù)
# 創(chuàng)建定時(shí)任務(wù)(每天凌晨觸發(fā)) openclaw cron add \ --name "daily-report" \ --schedule "0 0 * * *" \ --text "生成每日?qǐng)?bào)告" # 創(chuàng)建重復(fù)任務(wù)(每 30 分鐘) openclaw cron add \ --name "check-notifications" \ --schedule "*/30 * * * *" \ --text "檢查通知" # 創(chuàng)建單次任務(wù)(特定時(shí)間) openclaw cron add \ --name "special-task" \ --schedule "at" \ --at "2026-03-01T10:00:00" \ --text "執(zhí)行特殊任務(wù)"
11.3 Cron 任務(wù)操作
# 立即運(yùn)行任務(wù) openclaw cron run <job-id> # 更新任務(wù) openclaw cron update <job-id> --schedule "0 6 * * *" # 刪除任務(wù) openclaw cron remove <job-id> # 發(fā)送喚醒事件 openclaw cron wake --text "檢查新消息"
十二、系統(tǒng)命令
12.1 健康檢查
# 運(yùn)行健康檢查 openclaw doctor # 快速修復(fù)常見(jiàn)問(wèn)題 openclaw doctor --fix # 檢查特定組件 openclaw doctor --check gateway openclaw doctor --check channels
12.2 系統(tǒng)狀態(tài)
# 查看頻道健康狀態(tài) openclaw status # 查看系統(tǒng)事件 openclaw system events # 查看心跳狀態(tài) openclaw system heartbeat
12.3 安全檢查
# 運(yùn)行安全檢查 openclaw security audit # 檢查權(quán)限配置 openclaw security check-permissions # 檢查 API Key 有效性 openclaw security verify-keys
十三、插件管理命令
13.1 查看插件
# 查看已安裝插件 openclaw plugins list # 查看插件詳情 openclaw plugins show <plugin-name> # 檢查插件狀態(tài) openclaw plugins status
13.2 插件操作
# 啟用插件 openclaw plugins enable feishu # 禁用插件 openclaw plugins disable feishu # 重啟插件 openclaw plugins restart feishu # 更新插件 openclaw plugins update
十四、瀏覽器控制命令
14.1 啟動(dòng)/停止瀏覽器
# 啟動(dòng)瀏覽器 openclaw browser start # 停止瀏覽器 openclaw browser stop # 切換配置 openclaw browser start --profile chrome openclaw browser start --profile openclaw
14.2 瀏覽器操作
# 打開(kāi)網(wǎng)頁(yè) openclaw browser open https://example.com # 截圖 openclaw browser screenshot --output /tmp/screenshot.png # 獲取快照 openclaw browser snapshot --target main # 查看標(biāo)簽頁(yè) openclaw browser tabs
十五、更新與維護(hù)命令
15.1 更新 OpenClaw
# 查看更新 openclaw update --dry-run # 執(zhí)行更新 openclaw update # 更新到特定版本 openclaw update --tag 2026.2.22 # 更新到 Beta 版 openclaw update --channel beta
15.2 配置文件管理
# 備份配置 cp ~/.openclaw/config.json ~/.openclaw/config.json.backup # 重置配置(保留 CLI) openclaw reset # 完全卸載(包括數(shù)據(jù)) openclaw uninstall
15.3 Shell 自動(dòng)補(bǔ)全
# 生成 Bash 補(bǔ)全腳本 openclaw completion bash > ~/.openclaw-completion # 生成 Zsh 補(bǔ)全腳本 openclaw completion zsh > ~/.zsh-completion # 應(yīng)用補(bǔ)全(Bash) echo "source ~/.openclaw-completion" >> ~/.bashrc source ~/.bashrc
十六、常用組合命令
16.1 快速部署新技能
# 一鍵創(chuàng)建、開(kāi)發(fā)、測(cè)試技能 openclaw skills create my-new-skill \ && cd ~/.openclaw/workspace/skills/my-new-skill \ && vim SKILL.md
16.2 批量發(fā)送通知
# 發(fā)送到多個(gè)目標(biāo) openclaw message send --target @user1 --message "通知內(nèi)容" openclaw message send --target @user2 --message "通知內(nèi)容" openclaw message send --target @user3 --message "通知內(nèi)容" # 使用循環(huán)批量發(fā)送(需要腳本配合) for target in user1 user2 user3; do openclaw message send --target @$target --message "通知內(nèi)容" done
16.3 Gateway 重啟 + 驗(yàn)證
# 重啟并驗(yàn)證 openclaw gateway restart \ && sleep 5 \ && openclaw gateway status \ && openclaw health
16.4 配置備份 + 更新
# 安全更新流程 cp ~/.openclaw/config.json ~/.openclaw/config.json.backup \ && openclaw update --dry-run \ && openclaw update \ && openclaw gateway restart
16.5 每日?qǐng)?bào)告生成
# 生成每日?qǐng)?bào)告(Cron 腳本) 0 9 * * * openclaw cron add \ --name daily-report \ --schedule "0 9 * * *" \ --text "生成昨日數(shù)據(jù)分析報(bào)告"
十七、故障排除命令
17.1 Gateway 無(wú)法啟動(dòng)
# 檢查端口占用 sudo lsof -i :18789 # 強(qiáng)制重啟 openclaw gateway start --force # 查看錯(cuò)誤日志 openclaw logs --filter error # 運(yùn)行健康檢查 openclaw doctor
17.2 消息發(fā)送失敗
# 檢查頻道狀態(tài) openclaw channels status # 測(cè)試頻道 openclaw channels test --channel telegram # 重新登錄頻道 openclaw channels login --channel telegram # 查看詳細(xì)日志 openclaw message send --target @mychat --message "Test" --verbose
17.3 模型調(diào)用失敗
# 檢查 API Key openclaw config get providers.openai.apiKey # 測(cè)試模型 openclaw models test --model mistral:mixtral-8x7b --prompt "test" # 檢查網(wǎng)絡(luò)連接 ping api.openai.com # 運(yùn)行診斷 openclaw doctor --check models
17.4 技能加載失敗
# 檢查技能列表 openclaw skills list # 驗(yàn)證技能 openclaw skills validate my-skill # 重新安裝技能 openclaw skills uninstall my-skill openclaw skills install my-skill # 查看錯(cuò)誤日志 openclaw logs --filter skill
十八、生產(chǎn)環(huán)境最佳實(shí)踐
18.1 使用環(huán)境變量
# 推薦方式:使用環(huán)境變量存儲(chǔ)敏感信息 export OPENAI_API_KEY="sk-xxx" export MISTRAL_API_KEY="xxx" export TELEGRAM_BOT_TOKEN="xxx" # 然后啟動(dòng) Gateway openclaw gateway start
18.2 配置文件權(quán)限
# 限制配置文件權(quán)限 chmod 600 ~/.openclaw/config.json # 檢查權(quán)限 ls -la ~/.openclaw/config.json
18.3 日志管理
# 配置日志輪轉(zhuǎn)
sudo tee /etc/logrotate.d/openclaw <<EOF
~/.openclaw/logs/*.log {
daily
rotate 7
compress
missingok
notifempty
}
EOF18.4 監(jiān)控與告警
# 檢查 Gateway 狀態(tài)(Cron 腳本) */5 * * * * openclaw health || \ openclaw message send --target @admin --message "Gateway 宕機(jī)!"
十九、快捷別名配置
19.1 創(chuàng)建常用別名
# 添加到 ~/.bashrc 或 ~/.zshrc alias oc='openclaw' alias ocg='openclaw gateway' alias ocgl='openclaw logs --follow' alias ocs='openclaw sessions' alias ocm='openclaw message send' alias occ='openclaw channels' # 應(yīng)用別名 source ~/.bashrc # Bash source ~/.zshrc # Zsh
19.2 使用別名
# 啟動(dòng) Gateway ocg start # 查看實(shí)時(shí)日志 ocgl # 發(fā)送消息 ocm --target @mychat --message "Hello" # 查看會(huì)話(huà) ocs
二十、命令速查表


總結(jié)
OpenClaw 提供了豐富的命令行工具,掌握這些命令可以大幅提升工作效率。
相關(guān)文章
還在為記不住 OpenClaw 命令煩惱?這份CLI 命令 + 聊天斜杠命令 + 關(guān)鍵路徑 + 急救流程一站式手冊(cè),幫你快速上手、高效排錯(cuò),輕松駕馭全功能2026-03-09
OpenClaw遠(yuǎn)程瀏覽器從入門(mén)到踩坑完整使用指南
OpenClaw是一款強(qiáng)大的AI助手框架,支持瀏覽器自動(dòng)化,這篇文章主要介紹了OpenClaw遠(yuǎn)程瀏覽器從入門(mén)到踩坑完整使用的相關(guān)資料,并分享了在使用過(guò)程中遇到的問(wèn)題和解決方案,需要2026-03-09
OpenClaw 安裝與配置實(shí)戰(zhàn)指南(含常用命令 + 故障排查)
OpenClaw安裝與配置實(shí)戰(zhàn),涵蓋了從安裝到故障排查的詳細(xì)流程,重點(diǎn)包括通道配置、模型接入和網(wǎng)關(guān)排障,提供了常用命令速查和故障排查步驟,幫助用戶(hù)順利上手和解決常見(jiàn)問(wèn)題,本2026-03-06
OpenClaw 本地安裝與配置十分鐘完成(附常用命令速查)
OpenClaw 是一個(gè)開(kāi)源的個(gè)人 AI 助手,支持系統(tǒng)操作、文件讀寫(xiě)、代碼執(zhí)行等,它可以通過(guò)配置文件進(jìn)行各種設(shè)置,這篇文章給大家介紹OpenClaw 快速入門(mén):10 分鐘完成本地安裝與配2026-03-06
OpenClaw最強(qiáng)插件庫(kù):5400+Skills,22.7K Star,一條命令全搞定強(qiáng)的離譜
最近一段時(shí)間,一個(gè)叫OpenClaw(前身是 Clawdbot / Moltbot)的本地 AI Agent 項(xiàng)目突然爆火,技術(shù)圈幾乎人人都在討論,下面給大家分享OpenClaw最強(qiáng)插件庫(kù),5400+Skills,22.2026-03-05
OpenClaw 是一款功能強(qiáng)大的開(kāi)源 AI 助手框架,支持對(duì)接多種大模型和通訊平臺(tái),下面就來(lái)介紹一下openclaw常用指令,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2026-03-04
OpenClaw安裝排錯(cuò)方法筆記(含基本使用命令)
OpenClaw(原Clawdbot/Moltbot)是一款開(kāi)源的本地優(yōu)先AI代理與自動(dòng)化平臺(tái),支持多渠道通信集成、大模型調(diào)用及自動(dòng)化任務(wù)執(zhí)行,可滿(mǎn)足個(gè)人與小型團(tuán)隊(duì)的智能輔助需求,這篇文章主2026-03-02
OpenClaw千帆模型切換:精準(zhǔn)配置步驟與關(guān)鍵命令詳解
本文圍繞OpenClaw千帆模型切換展開(kāi),系統(tǒng)梳理從環(huán)境準(zhǔn)備到配置落地的全流程,精準(zhǔn)拆解關(guān)鍵配置步驟與核心命令,涵蓋模型選擇、授權(quán)登錄、配置生效等環(huán)節(jié),為開(kāi)發(fā)者提供實(shí)操2026-03-02
OpenClaw 的命令行工具非常強(qiáng)大,覆蓋了從安裝配置到日常使用的方方面面,為了讓你能快速上手,我將最常用的命令整理為以下分類(lèi)速查表,你可以將它看作一份隨時(shí)查閱的急救手2026-03-01
OpenClaw常用操作命令完整速查手冊(cè):從入門(mén)到精通的終端 CLI & 聊天指令全解析
作為 OpenClaw 生態(tài)(包括 PicoClaw、ZeroClaw、losterAI、EasyClaw 等系列開(kāi)源應(yīng)用)的核心用戶(hù),我根據(jù)開(kāi)源資料和個(gè)人使用體驗(yàn)整理了這份全網(wǎng)最全的命令速查手冊(cè)2026-03-09











