這份速查手冊詳細介紹了OpenClaw中文漢化版2026.4.1-zh.2及以上的命令使用方法,涵蓋了終端CLI操作、聊天斜杠指令、實用技巧與常見問題解決等內(nèi)容,幫助用戶高效操作和維護該軟件
適用版本:OpenClaw 中文漢化版 v2026.4.1-zh.2 及以上
命令前綴說明:
- 終端命令:使用
openclaw-cn(漢化版專屬命令,官方版為 openclaw) - 聊天斜杠指令:在Web控制臺/微信/釘釘/飛書聊天窗口直接輸入,以
/ 開頭
第一部分:終端 CLI 操作命令大全
基礎(chǔ)全局命令
| 命令 | 說明 | 示例 |
|---|
openclaw-cn --version | 查看當前版本號 | openclaw-cn --version |
openclaw-cn --help | 查看所有命令幫助 | openclaw-cn --help |
openclaw-cn <command> --help | 查看指定命令的詳細幫助 | openclaw-cn gateway --help |
openclaw-cn tui | 啟動終端圖形交互界面(新手友好) | openclaw-cn tui |
openclaw-cn dashboard | 自動打開瀏覽器訪問Web控制臺 | openclaw-cn dashboard |
openclaw-cn docs <query> | 內(nèi)置文檔搜索 | openclaw-cn docs "微信接入" |
全局通用標志:
--json:輸出JSON格式,適合腳本調(diào)用--verbose:顯示詳細日志--dev:開發(fā)模式,狀態(tài)隔離到 ~/.openclaw-dev--profile <name>:多實例隔離,狀態(tài)存儲在 ~/.openclaw-<name>
安裝與初始化
| 命令 | 說明 | 示例 |
|---|
openclaw-cn onboard | 啟動交互式初始化配置向?qū)?/td> | openclaw-cn onboard |
openclaw-cn onboard --install-daemon | 初始化并安裝系統(tǒng)后臺服務(wù)(開機自啟) | openclaw-cn onboard --install-daemon |
openclaw-cn configure | 重新進入配置向?qū)?/td> | openclaw-cn configure |
openclaw-cn update | 一鍵更新到最新穩(wěn)定版 | openclaw-cn update |
openclaw-cn update --nightly | 更新到每日構(gòu)建版 | openclaw-cn update --nightly |
openclaw-cn uninstall --all --yes | 徹底卸載,刪除所有數(shù)據(jù) | openclaw-cn uninstall --all --yes |
網(wǎng)關(guān)服務(wù)管理(核心)
| 命令 | 說明 | 示例 |
|---|
openclaw-cn gateway run | 前臺啟動網(wǎng)關(guān)服務(wù)(調(diào)試用) | openclaw-cn gateway run |
openclaw-cn gateway start | 后臺啟動網(wǎng)關(guān)服務(wù) | openclaw-cn gateway start |
openclaw-cn gateway stop | 停止網(wǎng)關(guān)服務(wù) | openclaw-cn gateway stop |
openclaw-cn gateway restart | 重啟網(wǎng)關(guān)服務(wù)(配置修改后必用) | openclaw-cn gateway restart |
openclaw-cn gateway status | 查看網(wǎng)關(guān)運行狀態(tài)、端口占用、鏈路健康度 | openclaw-cn gateway status |
openclaw-cn gateway install | 注冊網(wǎng)關(guān)為系統(tǒng)服務(wù),實現(xiàn)開機自啟 | openclaw-cn gateway install |
openclaw-cn gateway uninstall | 卸載系統(tǒng)服務(wù) | openclaw-cn gateway uninstall |
openclaw-cn gateway probe | 深度探測網(wǎng)關(guān)連通性,排查網(wǎng)絡(luò)攔截問題 | openclaw-cn gateway probe |
配置管理
| 命令 | 說明 | 示例 |
|---|
openclaw-cn config show | 查看當前完整配置 | openclaw-cn config show |
openclaw-cn config get <key> | 查詢指定配置項的值 | openclaw-cn config get language |
openclaw-cn config set <key> <value> | 快速修改單條配置 | openclaw-cn config set language zh-CN |
openclaw-cn config edit | 調(diào)用系統(tǒng)編輯器修改配置文件 | openclaw-cn config edit |
openclaw-cn config validate | 校驗配置文件語法與合法性 | openclaw-cn config validate |
openclaw-cn config reset | 重置為默認配置(會覆蓋所有修改) | openclaw-cn config reset |
模型管理
| 命令 | 說明 | 示例 |
|---|
openclaw-cn models list | 列出所有已配置的模型 | openclaw-cn models list |
openclaw-cn models set <model-name> | 設(shè)置默認使用的模型 | openclaw-cn models set claude-4-sonnet-20260301 |
openclaw-cn models add <provider> <api-key> | 添加新的模型提供商 | openclaw-cn models add openai sk-xxx |
openclaw-cn models remove <model-name> | 刪除指定模型 | openclaw-cn models remove gpt-3.5-turbo |
openclaw-cn models status | 查看所有模型的連接狀態(tài) | openclaw-cn models status |
openclaw-cn models scan | 自動掃描本地Ollama模型 | openclaw-cn models scan |
openclaw-cn models usage | 查看模型API用量和剩余配額 | openclaw-cn models usage |
技能與插件管理
| 命令 | 說明 | 示例 |
|---|
openclaw-cn skills list | 列出所有已安裝的技能 | openclaw-cn skills list |
openclaw-cn skills install <skill-name> | 從ClawHub安裝技能 | openclaw-cn skills install pdf-processor |
openclaw-cn skills install <local-path> | 從本地目錄安裝技能 | openclaw-cn skills install ./my-skill |
openclaw-cn skills update <skill-name> | 更新指定技能 | openclaw-cn skills update pdf-processor |
openclaw-cn skills update --all | 更新所有已安裝的技能 | openclaw-cn skills update --all |
openclaw-cn skills uninstall <skill-name> | 卸載指定技能 | openclaw-cn skills uninstall pdf-processor |
openclaw-cn plugins list | 列出所有已安裝的插件 | openclaw-cn plugins list |
openclaw-cn plugins install <plugin-name> | 安裝插件 | openclaw-cn plugins install vscode-bridge |
渠道平臺管理(微信/釘釘/飛書)
| 命令 | 說明 | 示例 |
|---|
openclaw-cn channels list | 列出所有已配置的聊天渠道 | openclaw-cn channels list |
openclaw-cn channels add --channel <name> | 添加新的聊天渠道 | openclaw-cn channels add --channel wechat |
openclaw-cn channels remove --channel <name> | 刪除指定渠道 | openclaw-cn channels remove --channel telegram |
openclaw-cn channels status | 查看所有渠道的連接狀態(tài) | openclaw-cn channels status |
openclaw-cn channels logs --channel <name> | 查看指定渠道的日志 | openclaw-cn channels logs --channel dingtalk |
openclaw-cn message send --channel <name> --target <id> --message <text> | 發(fā)送消息 | openclaw-cn message send --channel wechat --target "張三" --message "你好" |
Agent 與會話管理
| 命令 | 說明 | 示例 |
|---|
openclaw-cn agents list | 列出所有已創(chuàng)建的Agent | openclaw-cn agents list |
openclaw-cn agents add <name> --workspace <path> | 創(chuàng)建新的Agent | openclaw-cn agents add work --workspace ~/projects |
openclaw-cn agents delete <id> --force | 刪除指定Agent | openclaw-cn agents delete 1 --force |
openclaw-cn agent --message <text> | 向默認Agent發(fā)送消息 | openclaw-cn agent --message "列出當前目錄文件" |
openclaw-cn sessions list | 列出所有會話 | openclaw-cn sessions list |
openclaw-cn sessions delete <id> | 刪除指定會話 | openclaw-cn sessions delete 1 |
openclaw-cn sessions export <id> --format markdown | 導(dǎo)出會話為Markdown文件 | openclaw-cn sessions export 1 --format markdown |
數(shù)據(jù)與記憶管理
| 命令 | 說明 | 示例 |
|---|
openclaw-cn memory status | 查看記憶系統(tǒng)狀態(tài) | openclaw-cn memory status |
openclaw-cn memory index | 重建向量索引(修復(fù)記憶Bug必用) | openclaw-cn memory index |
openclaw-cn memory search "<query>" | 向量搜索長期記憶 | openclaw-cn memory search "Python" |
openclaw-cn memory clear | 清除所有長期記憶 | openclaw-cn memory clear |
openclaw-cn directory add <path> | 添加目錄到文件訪問白名單 | openclaw-cn directory add ~/Documents |
openclaw-cn directory list | 列出所有允許訪問的目錄 | openclaw-cn directory list |
診斷與維護(遇到問題先執(zhí)行這些)
| 命令 | 說明 | 示例 |
|---|
openclaw-cn doctor | 全面健康檢查(配置、端口、依賴) | openclaw-cn doctor |
openclaw-cn doctor --fix | 健康檢查+自動修復(fù)常見錯誤 | openclaw-cn doctor --fix |
openclaw-cn status --all | 完整系統(tǒng)狀態(tài)診斷 | openclaw-cn status --all |
openclaw-cn status --deep | 深度探測所有組件狀態(tài) | openclaw-cn status --deep |
openclaw-cn logs | 查看最近100行日志 | openclaw-cn logs |
openclaw-cn logs --follow | 實時查看日志(排查問題必備) | openclaw-cn logs --follow |
openclaw-cn logs --level error | 只查看錯誤日志 | openclaw-cn logs --level error |
備份與恢復(fù)
| 命令 | 說明 | 示例 |
|---|
openclaw-cn backup create | 創(chuàng)建完整數(shù)據(jù)備份 | openclaw-cn backup create |
openclaw-cn backup list | 列出所有備份 | openclaw-cn backup list |
openclaw-cn backup restore <backup-id> | 從指定備份恢復(fù) | openclaw-cn backup restore 20260413-120000 |
openclaw-cn backup delete <backup-id> | 刪除指定備份 | openclaw-cn backup delete 20260413-120000 |
高級命令
| 命令 | 說明 | 示例 |
|---|
openclaw-cn cron list | 列出所有定時任務(wù) | openclaw-cn cron list |
openclaw-cn cron add "0 9 * * *" "發(fā)送每日日報" | 添加定時任務(wù) | openclaw-cn cron add "0 9 * * *" "發(fā)送每日日報" |
openclaw-cn security audit | 執(zhí)行安全審計 | openclaw-cn security audit |
openclaw-cn sandbox run <command> | 在沙箱中執(zhí)行命令 | openclaw-cn sandbox run "ls -la" |
openclaw-cn mcp list | 列出所有已連接的MCP服務(wù)器 | openclaw-cn mcp list |
第二部分:聊天斜杠指令大全
(在Web控制臺/微信/釘釘/飛書聊天窗口直接輸入)
基礎(chǔ)控制指令
| 指令 | 說明 | 示例 |
|---|
/help | 顯示所有可用斜杠命令 | /help |
/help <command> | 查看指定命令的詳細用法 | /help model |
/new 或 /clear | 開啟新會話,清除上下文緩存 | /new |
/reset | 重置會話到初始狀態(tài)(恢復(fù)默認參數(shù)) | /reset |
/stop | 強制停止當前正在生成的內(nèi)容或任務(wù) | /stop |
/status | 顯示當前對話狀態(tài)、模型、Token使用量 | /status |
/context | 詳細展示當前對話的上下文構(gòu)成 | /context |
/whoami | 顯示當前發(fā)送者的身份標識 | /whoami |
/export | 將當前會話導(dǎo)出為Markdown文件 | /export |
模型與參數(shù)調(diào)整
| 指令 | 說明 | 示例 |
|---|
/model <model-name> | 臨時切換當前會話使用的模型 | /model claude-4-opus |
/think <level> | 設(shè)置思考深度:off/minimal/low/medium/high/xhigh | /think high |
/temperature <value> | 調(diào)整生成溫度(0-2),值越高越隨機 | /temperature 0.7 |
/maxtokens <value> | 設(shè)置最大生成Token數(shù) | /maxtokens 2048 |
/fast on/off | 開啟/關(guān)閉快速響應(yīng)模式 | /fast on |
/compact | 壓縮當前會話上下文(用摘要替代歷史,節(jié)省Token) | /compact |
工具與技能
| 指令 | 說明 | 示例 |
|---|
/tools | 列出當前可用的所有工具及其描述 | /tools |
/skills | 列出所有已安裝的技能 | /skills |
/skill <skill-name> <args> | 手動調(diào)用指定技能 | /skill pdf-extract test.pdf |
/bash <command> | 在主機上執(zhí)行Shell命令 | /bash ls -la |
/file list | 列出當前工作目錄的文件 | /file list |
/file read <filename> | 讀取指定文件內(nèi)容 | /file read README.md |
/file write <filename> <content> | 寫入內(nèi)容到指定文件 | /file write test.txt "Hello World" |
系統(tǒng)管理
| 指令 | 說明 | 示例 |
|---|
/restart | 重啟網(wǎng)關(guān)服務(wù)(僅管理員可用) | /restart |
/config get <key> | 讀取指定配置項的值 | /config get language |
/config set <key> <value> | 修改指定配置項 | /config set default_model gpt-4o |
/usage off/tokens/full | 控制Token用量顯示的詳細程度 | /usage full |
/verbose on/off | 開關(guān)詳細模式,顯示工具調(diào)用和推理步驟 | /verbose on |
/tts on/off | 開啟/關(guān)閉語音回復(fù) | /tts on |
高級功能
| 指令 | 說明 | 示例 |
|---|
/subagent spawn <role> | 生成并啟動一個子代理處理復(fù)雜任務(wù) | /subagent spawn "前端工程師" |
/btw <question> | 詢問一個臨時問題,不被加入長期對話記憶 | /btw "今天是幾號?" |
/activation mention/always | 切換激活模式:僅@提及觸發(fā)/所有消息都觸發(fā) | /activation always |
/elevated | 臨時提升Agent權(quán)限(需管理員密碼) | /elevated |
/mcp list | 列出所有已連接的MCP服務(wù)器 | /mcp list |
第三部分:實用技巧與常見問題
命令別名設(shè)置(提高效率)
Linux/macOS
# 添加到 ~/.bashrc 或 ~/.zshrc
alias oc='openclaw-cn'
alias ocg='openclaw-cn gateway'
alias ocs='openclaw-cn status'
alias ocd='openclaw-cn doctor --fix'
alias ocl='openclaw-cn logs --follow'
# 生效
source ~/.bashrc
Windows PowerShell
# 添加到 $PROFILE
Set-Alias oc openclaw-cn
Set-Alias ocg openclaw-cn-gateway
Set-Alias ocs openclaw-cn-status
Set-Alias ocd openclaw-cn-doctor
Set-Alias ocl openclaw-cn-logs
萬能問題排查命令組合
遇到任何問題,先執(zhí)行這三條命令,能解決80%的常見錯誤:
openclaw-cn doctor --fix && \
openclaw-cn gateway restart && \
openclaw-cn logs --follow
常見問題快速解決
- 服務(wù)啟動失敗:先執(zhí)行
openclaw-cn doctor --fix,再重啟服務(wù) - 漢化不生效:執(zhí)行
openclaw-cn config set language zh-CN,然后重啟服務(wù) - AI不回復(fù):執(zhí)行
openclaw-cn models status 檢查模型連接狀態(tài) - 技能安裝失敗:配置國內(nèi)技能鏡像:
openclaw-cn config set skillRegistry https://openclaw.cn/skills - 無法訪問本地文件:添加目錄到白名單:
openclaw-cn directory add ~/Documents
總結(jié)
這份速查手冊涵蓋了OpenClaw中文漢化版99%的常用操作命令,建議收藏并打印出來放在電腦旁,遇到問題隨時查閱。記?。?strong>遇到問題先執(zhí)行 openclaw-cn doctor --fix,這是解決大多數(shù)問題的最快方法。
如果需要更詳細的命令說明,可以執(zhí)行 openclaw-cn <command> --help 查看官方幫助文檔
到此這篇關(guān)于OpenClaw常用操作命令完整速查手冊(2026最新漢化版)的文章就介紹到這了,更多相關(guān)OpenClaw常用操作命令內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!