乐于分享
好东西不私藏

OpenClaw 所有命令,我按用途整理成了 12 组,建议收藏

OpenClaw 所有命令,我按用途整理成了 12 组,建议收藏

OpenClaw 所有命令,我按用途整理成了 12 组,建议收藏

🦞 OpenClaw 2026.3.8 — 我是你终端里的那个助手,不是你睡眠 schedules 的那个。


前言

OpenClaw 是一个强大的终端 AI 助手框架,但命令行工具这么多,新手很容易迷失。

今天我把 OpenClaw 所有核心命令 按用途整理成 12 组,每组都配上实用场景和示例命令,建议收藏备用!


一、🚀 网关控制(Gateway)

网关是 OpenClaw 的核心服务,所有功能都依赖它运行。

# 查看网关状态
openclaw gateway status

# 启动网关服务
openclaw gateway start

# 重启网关
openclaw gateway restart

# 停止网关
openclaw gateway stop

# 前台运行网关(调试用)
openclaw gateway run

# 查看网关健康状态
openclaw gateway health

# 安装为系统服务(开机自启)
openclaw gateway install

# 卸载系统服务
openclaw gateway uninstall

实用场景:

  • 每天开机后检查 gateway status 确认服务正常
  • 遇到连接问题时 gateway restart 重启服务
  • 想让 OpenClaw 开机自启用 gateway install

二、💬 消息收发(Message)

消息命令让你可以通过命令行发送、读取和管理消息。

# 发送消息
openclaw message send --target @username --message "你好"

# 发送带图片的消息
openclaw message send --target @username --message "看图" --media photo.jpg

# 读取最近消息
openclaw message read --channel telegram --target @mychat --limit 10

# 发送投票
openclaw message poll --channel discord --target channel:123 \
  --poll-question "吃什么?" \
  --poll-option "火锅" \
  --poll-option "烧烤"

# 给消息添加反应
openclaw message react --channel discord --message-id 456 --emoji "✅"

# 删除消息
openclaw message delete --message-id 123

# 编辑消息
openclaw message edit --message-id 123 --message "新内容"

实用场景:

  • 自动化通知脚本里用 message send 发送告警
  • message poll 快速发起群投票
  • message read 读取未读消息做处理

三、🔌 技能管理(Skills)

技能是 OpenClaw 的扩展能力,可以按需安装。

# 列出所有可用技能
openclaw skills list

# 查看技能详情
openclaw skills info <skill-name>

# 检查技能依赖
openclaw skills check

实用场景:

  • 安装新技能前先 skills info 看说明
  • 定期 skills check 检查是否有技能缺少依赖
  • skills list 查看已安装的技能

四、🌐 浏览器自动化(Browser)

OpenClaw 内置浏览器控制,可以做网页自动化。

# 启动浏览器
openclaw browser start

# 查看浏览器状态
openclaw browser status

# 打开网页
openclaw browser open --url https://example.com

# 截图
openclaw browser screenshot --output page.png

# 获取页面快照
openclaw browser snapshot

# 点击元素
openclaw browser click --ref e12

# 输入文本
openclaw browser type --ref e34 --text "搜索内容"

# 保存页面为 PDF
openclaw browser pdf --output page.pdf

# 列出所有标签页
openclaw browser tabs

实用场景:

  • 自动抓取网页内容用 browser open + browser snapshot
  • 定期截图监控网页变化用 browser screenshot
  • 自动化表单填表用 browser type + browser click

五、👥 频道管理(Channels)

管理连接的聊天频道(Telegram、Discord、微信等)。

# 列出所有频道
openclaw channels list

# 登录新频道
openclaw channels login --channel telegram

# 查看频道详情
openclaw channels info --channel telegram

# 断开频道连接
openclaw channels logout --channel telegram

实用场景:

  • 新接入一个聊天平台用 channels login
  • 排查连接问题用 channels info 查看状态
  • 切换账号用 channels logout 后重新登录

六、🤖 Agent 管理

管理独立的 Agent 会话和工作空间。

# 列出所有 Agent
openclaw agents list

# 创建新 Agent 工作空间
openclaw agents create --name my-agent

# 查看 Agent 详情
openclaw agents info --name my-agent

# 删除 Agent
openclaw agents delete --name my-agent

实用场景:

  • 为不同项目创建独立 Agent 工作空间
  • agents list 查看运行中的 Agent
  • 清理不用的 Agent 释放资源

七、📝 会话管理(Sessions)

查看和管理历史会话记录。

# 列出所有会话
openclaw sessions list

# 查看会话详情
openclaw sessions info <session-id>

# 导出会话记录
openclaw sessions export <session-id> --output session.json

实用场景:

  • 查找之前的对话用 sessions list
  • 备份重要对话用 sessions export
  • 清理旧会话释放空间

八、🧠 记忆管理(Memory)

管理 OpenClaw 的长期记忆系统。

# 搜索记忆
openclaw memory search "关键词"

# 重新索引记忆文件
openclaw memory reindex

# 查看记忆状态
openclaw memory status

实用场景:

  • 让 AI 记住重要信息后,用 memory search 检索
  • 记忆文件变动后用 memory reindex 更新索引
  • 定期 memory status 检查记忆系统健康

九、⚙️ 配置管理(Config)

管理 OpenClaw 的配置。

# 查看配置
openclaw config get <key>

# 设置配置
openclaw config set <key> <value>

# 删除配置
openclaw config unset <key>

# 验证配置
openclaw config validate

# 打开配置文件
openclaw config file

实用场景:

  • 修改默认模型用 config set models.default <model>
  • 排查配置问题用 config validate
  • 快速编辑配置用 config file

十、🔍 诊断工具(Doctor & Status)

快速诊断和查看系统状态。

# 健康检查
openclaw doctor

# 查看系统状态
openclaw status

# 查看日志
openclaw logs

# 查看网关发现
openclaw gateway discover

实用场景:

  • 遇到问题先跑 openclaw doctor 自检
  • 日常检查用 openclaw status 看健康状态
  • 调试问题时用 openclaw logs 看日志

十一、📦 系统管理

系统级操作和维护命令。

# 更新 OpenClaw
openclaw update

# 查看更新状态
openclaw update status

# 重置配置(保留 CLI)
openclaw reset

# 完全卸载
openclaw uninstall

# 查看版本
openclaw --version

实用场景:

  • 定期 openclaw update 保持最新版本
  • 配置乱了用 openclaw reset 重置
  • 不用了用 openclaw uninstall 干净卸载

十二、🎯 高级功能

一些进阶用法和特殊命令。

# ACP 工具(Agent Control Protocol)
openclaw acp --help

# 定时任务管理
openclaw cron list
openclaw cron create --schedule "0 9 * * *" --command "xxx"

# Webhook 管理
openclaw webhooks list

# 设备配对
openclaw devices list
openclaw pairing approve

# 生成 Shell 补全
openclaw completion

实用场景:

  • cron create 设置定时任务(如每日晨报)
  • webhooks 接入外部系统
  • completion 生成命令行补全提升效率

常用命令速查表

用途 命令
启动服务 openclaw gateway start
查看状态 openclaw status
发送消息 openclaw message send --target xxx --message "xxx"
健康检查 openclaw doctor
列出技能 openclaw skills list
启动浏览器 openclaw browser start
查看帮助 openclaw --helpopenclaw <command> --help

结语

OpenClaw 的命令体系设计得很清晰,按用途分组后更容易记忆。

新手建议:

  1. 先掌握 网关控制消息收发 两组核心命令
  2. 根据需要逐步学习其他功能
  3. 遇到不确定的命令,用 --help 查看详细文档

老手提示:

  • openclaw completion 生成 Shell 补全,打字更快
  • 常用命令可以写成 alias 或脚本
  • 定期 openclaw update 保持最新版本

📚 官方文档:https://docs.openclaw.ai[1] 💬 社区讨论:https://discord.com/invite/clawd[2] 🦞 本文基于 OpenClaw 2026.3.8 编写


觉得有用?欢迎转发收藏!

引用链接

[1]https://docs.openclaw.ai

[2]https://discord.com/invite/clawd