微信扫码
添加专属顾问
我要投稿
掌握OpenClaw核心命令,轻松驾驭AI助手平台,工作效率翻倍!核心内容: 1. OpenClaw基础命令:版本查看、状态诊断、日志追踪 2. Gateway服务管理:启停控制、系统服务安装 3. 配置与模型管理:交互式配置向导、默认模型设置
OpenClaw 是一款强大的 AI 助手平台,通过命令行(CLI)可以管理 AI 对话、频道连接、定时任务、浏览器控制等功能。掌握常用命令,能让你更高效地使用 OpenClaw。
openclaw --version
# 或简写
openclaw -v
# 快速查看运行状态
openclaw status
# 深度诊断(包含频道连通性检测)
openclaw status --deep
# 查看模型用量
openclaw status --usage
# 输出完整诊断信息(方便粘贴给技术支持)
openclaw status --all
openclaw health
# 实时追踪日志
openclaw logs --follow
# 查看最近 200 条日志
openclaw logs --limit 200
# 输出纯文本格式
openclaw logs --plain
Gateway 是 OpenClaw 的核心服务,负责处理所有 AI 对话和消息路由。
openclaw gateway status
# 启动服务
openclaw gateway start
# 停止服务
openclaw gateway stop
# 重启服务
openclaw gateway restart
# 安装为系统服务(开机自启)
openclaw gateway install
# 卸载系统服务
openclaw gateway uninstall
# 查看某个配置项
openclaw config get Agents.defaults.model.primary
# 查看配置文件路径
openclaw config file
# 设置某个配置项
openclaw config set agents.defaults.model.primary claude-3-5-sonnet
# 删除某个配置项
openclaw config unset agents.defaults.model.primary
openclaw config validate
openclaw configure
openclaw models status
# 输出 JSON 格式
openclaw models status --json
openclaw models list
# 列出所有模型(包括未启用的)
openclaw models list --all
# 设置主模型
openclaw models set claude-3-5-sonnet-20241022
# 设置图像模型
openclaw models set-image dall-e-3
# 添加认证
openclaw models auth add
# 使用 setup-token 认证(Anthropic)
openclaw models auth setup-token --provider anthropic
OpenClaw支持 WhatsApp、Telegram、Discord、Slack 等多个聊天频道。
openclaw channels list
openclaw channels status
# 深度检测
openclaw channels status --probe
# 添加 Telegram 频道
openclaw channels add --channel telegram --token YOUR_BOT_TOKEN
# 添加 Discord 频道
openclaw channels add --channel discord --token YOUR_BOT_TOKEN
# 添加WhatsApp(交互式)
openclaw channels add --channel whatsapp
openclaw channels remove --channel telegram --delete
# WhatsApp 登录(扫码)
openclaw channels login --channel whatsapp
# 登出
openclaw channels logout --channel whatsapp
openclaw channels logs
# 查看指定频道日志
openclaw channels logs --channel telegram --lines 100
# 发送消息到指定号码
openclaw message send --target +8613800138000 --message "你好!"
# 发送到 Discord 频道
openclaw message send --channel discord --target channel:123456 --message "Hello!"
openclaw cron list
# 包含已禁用的任务
openclaw cron list --all
# 每天早上 9 点发送消息
openclaw cron add --name "早安提醒" --cron "0 9 * * *" --system-event "早安!今天也要加油哦"
# 30 分钟后执行一次
openclaw cron add --name "提醒" --every 1800000 --system-event "该休息了"
openclaw cron enable <任务ID>
openclaw cron disable <任务ID>
openclaw cron run <任务ID>
openclaw cron rm <任务ID>
openclaw cron runs --id <任务ID>
# 查看所有会话
openclaw sessions
# 查看最近活跃的会话(30分钟内)
openclaw sessions --active 30
# JSON 格式输出
openclaw sessions --json
openclaw skills list
# 只显示可用的技能
openclaw skills list --eligible
openclaw skills info <技能名称>
openclaw skills check
openclaw plugins list
openclaw plugins install <插件路径或名称>
openclaw plugins enable <插件ID>
openclaw plugins disable <插件ID>
openclaw plugins doctor
OpenClaw内置浏览器控制功能,可以自动化网页操作。
# 查看浏览器状态
openclaw browser status
# 启动浏览器
openclaw browser start
# 停止浏览器
openclaw browser stop
# 打开网页
openclaw browser open https://www.example.com
# 查看当前标签页
openclaw browser tabs
# 截取当前页面
openclaw browser screenshot
# 截取完整页面(含滚动区域)
openclaw browser screenshot --full-page
# 导航到指定 URL
openclaw browser navigate https://www.example.com
# 点击元素
openclaw browser click <元素ref>
# 输入文字
openclaw browser type <元素ref> "要输入的文字"
# 按键
openclaw browser press Enter
# 查看内存索引状态
openclaw memory status
# 重新索引内存文件
openclaw memory index
# 搜索内存
openclaw memory search "关键词"
# 基础安全审计
openclaw security audit
# 深度审计(包含实时探测)
openclaw security audit --deep
# 自动修复安全问题
openclaw security audit --fix
# 首次安装向导
openclaw setup
# 完整引导向导
openclaw onboard
openclaw doctor
# 重置配置(保留数据)
openclaw reset --scope config
# 重置配置+凭证+会话
openclaw reset --scope config+creds+sessions
# 完全重置
openclaw reset --scope full --yes
命令 |
说明 |
openclaw status |
查看运行状态 |
openclaw status --deep |
深度诊断 |
openclaw gateway restart |
重启服务 |
openclaw logs --follow |
实时查看日志 |
openclaw channels list |
查看频道列表 |
openclaw models list |
查看可用模型 |
openclaw cron list |
查看定时任务 |
openclaw sessions |
查看会话列表 |
openclaw skills list |
查看技能列表 |
openclaw plugins list |
查看插件列表 |
openclaw memory search "关键词" |
搜索记忆 |
openclaw security audit |
安全审计 |
openclaw doctor |
诊断修复 |
openclaw config get <路径> |
查看配置 |
openclaw config set <路径> <值> |
修改配置 |
1. 使用 --json 获取结构化输出
大多数命令支持--json参数,方便脚本处理:
openclaw channels list --json
openclaw models list --json
openclaw cron list --json
2. 全局参数
# 禁用颜色输出(适合日志记录)
openclaw --no-color status
# 使用独立配置文件(多实例)
openclaw --profile work status
3. 查看帮助
# 查看某个命令的帮助
openclaw gateway --help
openclaw cron --help
openclaw channels --help
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费POC验证,效果达标后再合作。零风险落地应用大模型,已交付160+中大型企业
2026-04-18
Hermes Agent vs OpenClaw:完整迁移指南
2026-04-16
OpenClaw技术架构与安装部署
2026-04-15
OpenClaw的启示:身份权限管理是AI Agent时代的阿喀琉斯之踵
2026-04-15
最近爆火的 Hermes Agent 是什么?它和 OpenClaw 不是一回事
2026-04-15
万字详解:OpenClaw龙虾“高替” Hermes Agent的Skills系统
2026-04-15
用 OpenClaw 构建个人知识库:从几百字到 10 万字,让 AI 真正懂你
2026-04-14
OpenClaw自我升级,越用越懂你
2026-04-14
给 OpenClaw 加上企业级 Memory,你的 Agent 终于不用再问第二遍
2026-03-03
2026-02-17
2026-03-05
2026-02-06
2026-02-03
2026-03-09
2026-02-10
2026-02-16
2026-03-09
2026-02-06
2026-04-09
2026-04-07
2026-04-02
2026-03-30
2026-03-30
2026-03-26
2026-03-24
2026-03-24