共计 5449 个字符,预计需要花费 14 分钟才能阅读完成。
🛠️ OpenClaw 常用命令完全指南
从入门到精通,快速掌握 OpenClaw 核心命令
🚀 网关管理
网关是 OpenClaw 的核心服务,负责消息接收、路由和发送。
-
openclaw gateway
启动网关服务(前台运行) -
openclaw gateway status
查看网关运行状态 -
openclaw gateway restart
重启网关服务(配置修改后必用) -
openclaw gateway stop
停止网关服务 -
openclaw gateway install
安装网关为系统服务(开机自启) -
openclaw logs –follow
实时查看网关日志(调试必备)
💡 提示: 修改任何配置后,记得运行
openclaw gateway restart 使其生效!🤖 Agent 管理
管理多个独立的 AI 智能体。
-
openclaw agents list
列出所有 Agent -
openclaw agents list –bindings
查看 Agent 路由规则 -
openclaw agents add <name>
创建新 Agent(使用向导) -
openclaw agents delete <name>
删除 Agent
多 Agent 配置示例
创建 Amazon 专用 Agent:
openclaw agents add amazon
--workspace ~/.openclaw/workspace-amazon
--model bailian/qwen3.5-plus
📱 渠道配置
配置消息渠道(飞书、Discord、Telegram 等)。
-
openclaw channels add
添加新渠道(使用向导) -
openclaw channels status
查看渠道状态 -
openclaw channels status –probe
实时检测渠道健康状态 -
openclaw channels login –channel whatsapp –account <name>
登录 WhatsApp 账号
💡 提示: 飞书渠道配置后,需要在飞书开放平台发布应用才能生效。
🔧 技能管理
安装和管理 AI 技能。
-
openclaw skills list
列出所有技能及状态 -
npx clawhub search <keyword>
搜索 ClawHub 技能市场 -
npx clawhub install <skill-name>
安装技能(需要网络) -
npx clawhub sync
同步已安装技能到最新版本
⚠️ 注意:ClawHub API 可能限流,如安装失败请等待 10-15 分钟后重试。
🔌 插件管理
管理 OpenClaw 插件。
-
openclaw plugins list
列出所有插件 -
openclaw plugins info <plugin-name>
查看插件详细信息 -
openclaw plugins doctor
诊断插件问题 -
openclaw plugins install <plugin>
安装新插件
🧠 记忆系统
管理 AI 记忆和记忆插件。
-
openclaw memory-pro list
列出 LanceDB 记忆 -
openclaw memory-pro search “query”
搜索记忆 -
openclaw memory-pro stats
查看记忆统计 -
openclaw memory-pro delete <id>
删除指定记忆 -
openclaw memory-pro delete-bulk –scope global
批量删除记忆 -
openclaw memory-pro export –output memories.json
导出记忆 -
openclaw memory-pro import memories.json
导入记忆
🔐 配对管理
管理飞书用户配对(私聊权限)。
-
openclaw pairing list feishu
列出待处理的配对请求 -
openclaw pairing approve feishu <code>
批准配对请求 -
openclaw pairing reject feishu <code>
拒绝配对请求
💡 提示: 配对码有效期有限,收到后请尽快批准。
⚙️ 配置管理
查看和修改 OpenClaw 配置。
-
openclaw config get <key>
查看配置项 -
openclaw config get plugins.slots.memory
查看记忆插件配置 -
openclaw doctor –fix
自动修复配置问题
配置文件位置
| 文件 | 路径 | 说明 |
|---|---|---|
| 主配置 | ~/.openclaw/openclaw.json |
主要配置文件 |
| 工作区 | ~/.openclaw/workspace |
Agent 工作目录 |
| 记忆文件 | ~/.openclaw/workspace/MEMORY.md |
长期记忆 |
| 会话存储 | ~/.openclaw/agents/<id>/sessions/ |
会话历史 |
💬 会话管理
管理 AI 会话。
-
openclaw sessions list
列出所有会话 -
openclaw sessions history <session-key>
查看会话历史
🔒 安全审计
检查系统安全配置。
-
openclaw security audit
执行安全审计 -
openclaw security audit –deep
深度安全审计 -
openclaw status
查看系统状态(含安全摘要) -
openclaw status –all
查看详细系统状态
💡 实用技巧
快速诊断流程
- 遇到问题先运行
openclaw status查看整体状态 - 使用
openclaw logs --follow实时查看日志 - 运行
openclaw doctor --fix自动修复配置 - 检查
openclaw plugins doctor诊断插件问题
配置修改后
永远记住: 修改配置后必须重启网关!
openclaw gateway restart
多 Agent 调试
查看 Agent 路由规则:
openclaw agents list --bindings
技能安装失败
ClawHub API 限流时:
- 等待 10-15 分钟
- 或手动从 GitHub 下载技能到
skills/目录
💡 最佳实践: 所有纠正和反馈必须写入文件(MEMORY.md、AGENTS.md 等),否则下次会话就不存在了。
正文完