乐于分享
好东西不私藏

OpenClaw 常用命令速查表:一篇搞定所有核心操作

OpenClaw 常用命令速查表:一篇搞定所有核心操作

说实话,刚用 OpenClaw 那会儿,我最头疼的就是记不住命令。(别问我怎么知道的)

>

今天整理了一份完整的命令速查表,从安装到日常使用,一篇全搞定。

---

📦 一、安装与初始化

快速安装

npm install -g openclaw@latest
curl -fsSL https://openclaw.ai/install.sh | bash

初始化配置

openclaw onboard

openclaw onboard --install-daemon

openclaw --version
💡 提示

:首次运行

onboard

会引导你:

  • 选择 AI 模型提供商
  • 配置 API Key
  • 绑定聊天频道(Telegram/WhatsApp/Discord 等)
  • ---

  • 🚀 二、Gateway 管理

  • Gateway 是 OpenClaw 的核心服务,负责连接聊天应用和 AI 代理。

  • openclaw gateway
    

    openclaw gateway --port 18789 --verbose

    openclaw gateway status

    openclaw gateway start

    openclaw gateway stop

    openclaw gateway restart

    openclaw dashboard
  • 📱 控制面板
  • http://127.0.0.1:18789/
  • ---

  • 🤖 三、Agent 管理

  • 每个 Agent 都有独立的工作区和配置。

  • openclaw agents list
    

    openclaw agents list --verbose --bindings

    openclaw agents add my-bot

    openclaw agents set-identity my-bot --name "工作助手" --emoji "💼"

    openclaw agents delete my-bot
  • 模型配置

  • openclaw models list
    

    openclaw models set bailian/qwen3.5-plus

    openclaw models auth setup-token --provider bailian
  • ---

  • 💬 四、频道管理

  • 支持 WhatsApp、Telegram、Discord、iMessage 等。

  • openclaw channels list
    

    openclaw channels status --probe

    openclaw channels status --deep

    openclaw channels add --channel telegram --token $TOKEN

    openclaw channels login

    openclaw channels logs --channel telegram

    openclaw channels remove --channel discord
  • 配对审批

  • openclaw pairing list
    openclaw pairing approve  
  • ---

  • ⚙️ 五、配置管理

  • 配置文件位于 ~/.openclaw/openclaw.json

  • openclaw config get agents.defaults.model.primary
    

    openclaw config set agents.defaults.model.primary bailian/qwen3.5-plus

    openclaw config unset agents.defaults.model.fallbacks
  • 常用配置示例

  • openclaw config set agents.defaults.model.primary bailian/qwen3.5-plus
    

    openclaw config set agents.defaults.model.fallbacks '["ollama-cloud/minimax-m2.7:cloud"]'

    openclaw config set agents.defaults.workspace /root/.openclaw/workspace
  • ---

  • 🔧 六、诊断与排错

  • openclaw doctor
    

    openclaw doctor --fix

    openclaw doctor --deep

    openclaw logs --follow

    openclaw security audit

    openclaw reset --scope sessions

    openclaw reset --scope config
  • 内存管理

  • openclaw memory status
    openclaw memory index
  • ---

  • 🧩 七、技能与插件

  • Skills(技能)

  • openclaw skills list
    

    openclaw skills install wechat-publish

    openclaw skills update

    openclaw skills remove wechat-publish
  • Plugins(插件)

  • openclaw plugins list
    

    openclaw plugins install qqbot

    openclaw plugins update --all

    openclaw plugins remove qqbot
  • ---

  • 📊 八、聊天命令(在聊天中发送)

  • 这些命令直接在聊天窗口发送(以 / 开头):

  • /status
    

    /new

    /reset

    /compact

    /think off

    /think minimal

    /verbose on

    /usage tokens

    /tools

    /help

    /restart
  • 群聊激活

  • /activation mention
    /activation always
  • ---

  • 🔄 九、更新与备份

  • 系统更新

  • openclaw update
    openclaw update run
  • 备份恢复

  • openclaw backup create
    

    openclaw backup create --verify

    tar -xzf openclaw-backup-*.tar.gz
  • ⚠️ 重要
  • :备份包含 API Key 等敏感信息,请妥善保管!
  • ---

  • 🎯 十、日常使用频率 TOP 10

  • 根据实际使用情况,这些命令最常用:

  • | 排名 | 命令 | 用途 |
    |------|------|------|
    | 1 | openclaw doctor | 诊断系统问题 |
    | 2 | openclaw gateway restart | 重启网关服务 |
    | 3 | openclaw logs --follow | 查看实时日志 |
    | 4 | openclaw dashboard | 打开控制面板 |
    | 5 | openclaw status | 查看系统状态 |
    | 6 | openclaw config set | 修改配置项 |
    | 7 | openclaw channels status | 检查频道状态 |
    | 8 | openclaw models set | 切换 AI 模型 |
    | 9 | openclaw plugins update --all | 更新所有插件 |
    | 10 | openclaw backup create | 备份系统配置 |

  • ---

  • 💡 使用技巧

  • 1. 快速访问控制面板

  • alias claw="openclaw dashboard"
    
  • 2. 日志过滤

  • openclaw logs --follow | grep ERROR
    openclaw logs --follow | grep telegram
  • 3. 配置模板

  • cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak
    

    cp ~/.openclaw/openclaw.json.bak ~/.openclaw/openclaw.json

    openclaw gateway restart
  • ---

  • 📱 移动端支持

  • OpenClaw 支持 iOS 和 Android 节点:

  • openclaw nodes list
    

    openclaw nodes pairing

    openclaw nodes status
  • 配对后可在手机上使用:

  • 📷 相机功能

  • 🎤 语音输入

  • 🖼️ Canvas 画布
  • ---

  • 🆘 常见问题

  • Q: Gateway 启动失败?

  • openclaw doctor --fix
    openclaw gateway restart
  • Q: 频道无法连接?

  • openclaw channels status --deep
    openclaw channels logs --channel telegram
  • Q: 模型调用失败?

  • openclaw models auth setup-token --provider bailian
    openclaw config set agents.defaults.model.primary bailian/qwen3.5-plus
  • Q: 配置改乱了?

  • openclaw reset --scope config
    openclaw onboard
  • ---

  • 📚 官方文档

  • 完整文档:https://docs.openclaw.ai/
  • GitHub: https://github.com/openclaw/openclaw
  • 社区:https://discord.gg/clawd
  • ---

  • 总结

  • OpenClaw 的命令设计很直观,遵循 名词 + 动词 的模式:

  • openclaw <模块> <操作> [参数]
    
  • 记住这三个命令就够了
  • openclaw doctor
    

    openclaw gateway restart

    openclaw logs --follow
  • ---

  • 觉得有用?点个赞👍 收藏一下,哪天用得上!
  • 有问题?评论区见!