🤖 OpenClaw 命令速查手册

1. 基础操作

命令 用途
openclaw --version 查看版本号
openclaw --help 查看全部命令
openclaw tui 终端对话界面
openclaw dashboard 网页控制台
openclaw restart 重启服务(修改配置后必执行)
openclaw stop 停止服务
openclaw update 更新至最新版

2. 安装与初始化

命令 用途
openclaw onboard 启动交互式配置向导
openclaw onboard --install-daemon 配置 + 安装系统后台服务(开机自启)
openclaw configure 重新进入配置向导

3. 诊断与排错

命令 用途
openclaw doctor 全面健康检查(配置、端口、依赖)—— 出现问题首选
openclaw doctor --fix 健康检查 + 自动修复
openclaw status 查看运行状态(网关、端口)
openclaw status --deep 深度状态检测(进阶排错)
openclaw logs 查看最近日志(定位错误信息)

4. 模型管理

命令 用途
openclaw models list 列出已配置模型
openclaw models set <提供商/模型名> 切换默认模型
openclaw models auth login --provider <提供商> OAuth 登录模型提供商
openclaw models auth paste-token --provider <提供商> 粘贴 API Token 认证

切换示例:

openclaw models set bailian/qwen3-max-2026-01-23
openclaw models set minimax/MiniMax-M2.1

5. 网关(Gateway)管理

命令 用途
openclaw gateway 启动网关
openclaw gateway --port 18789 指定端口启动
openclaw gateway --verbose 启动并输出详细日志
openclaw gateway restart 重启网关
openclaw gateway --token *** 带 Token 启动

6. 聊天通道(Channel)管理

支持通道:whatsapp、telegram、discord、slack、googlechat、signal、imessage、msteams、mattermost、feishu(需插件)

命令 用途
openclaw channels status 查看所有通道状态
openclaw channels list 列出已配置通道
openclaw channels add 交互式添加通道
openclaw channels add --channel telegram --token *** 添加 Telegram 通道
openclaw channels add --channel feishu 添加飞书通道
openclaw channels remove --channel <名称> 移除通道
openclaw channels logs 查看通道日志
openclaw channels login 登录通道
openclaw channels logout 登出通道

7. 插件(Plugin)管理

命令 用途
openclaw plugins list 列出插件
openclaw plugins enable <插件名> 启用插件
openclaw plugins disable <插件名> 禁用插件
openclaw plugins install <插件名> 安装插件
openclaw plugins doctor 检查插件错误

常用示例:

openclaw plugins enable feishu
openclaw plugins enable qwen-portal-auth
openclaw models auth login --provider qwen-portal --set-default

8. 技能(Skill)管理

命令 用途
openclaw skills list 列出已安装技能
openclaw skills install <技能名> 安装技能

ClawHub 技能商店:

命令 用途
clawhub search <关键词> 搜索技能
clawhub install <技能名> 安装技能
clawhub list 查看已安装技能
clawhub sync --all 更新所有技能
clawhub update <技能名> 更新指定技能

9. 消息与配对

命令 用途
openclaw message send --to <号码> --message "内容" 发送消息
openclaw agent --message "任务内容" 下发 Agent 任务
openclaw agent --message "任务" --thinking high 高思考深度任务
openclaw pairing approve <通道> <配对码> 批准设备配对

10. 沙箱(Sandbox)管理

命令 用途
openclaw sandbox explain 查看沙箱配置
openclaw sandbox explain --json JSON 格式查看配置
openclaw sandbox list 列出沙箱容器
openclaw sandbox list --browser 仅查看浏览器容器
openclaw sandbox recreate --all 重建所有容器
openclaw sandbox recreate --all --force 强制重建(无确认)

11. 浏览器控制

命令 用途
openclaw browser open <URL> 打开网页
openclaw browser snapshot 页面快照
openclaw browser click <元素> 点击页面元素
openclaw browser type <元素> <文字> 输入框填写内容
openclaw browser screenshot 截图
openclaw browser close 关闭浏览器
openclaw browser console 查看浏览器控制台

12. 配置文件操作

命令 用途
openclaw config 查看当前配置
openclaw config edit 编辑配置文件

手动编辑配置:

平台 命令
Windows notepad %USERPROFILE%\.openclaw\openclaw.json
macOS / Linux nano ~/.openclaw/openclaw.json
Linux 查看 cat ~/.openclaw/openclaw.json

13. 更新与维护

命令 用途
openclaw update 更新至稳定版
openclaw update --channel stable 切换稳定版通道
openclaw update --channel beta 切换测试版通道
npm install -g openclaw@latest npm 强制更新

二、聊天斜杠命令(Web / 飞书 / Telegram 通用)

1. 会话管理

命令 用途 重要度
/new 新建会话(清空上下文) 最高
/new 任务描述 新建会话并附带任务 最高
/compact 压缩上下文(节省 Token) 最高
/status 查看会话状态(模型、Token) 常用
/help / /commands 查看斜杠命令 常用

2. 模型切换

命令 用途
/model 查看当前模型
/model <模型名> 切换模型

3. 会话历史

命令 用途
/sessions list 列出所有会话
/sessions history 查看历史记录
/sessions send <会话ID> <消息> 向指定会话发消息
/sessions spawn <任务> 创建子会话执行任务

4. 工具与执行

命令 用途
/approve 批准待确认操作
/deny 拒绝待确认操作
/cancel 取消当前任务
/undo 撤销上一步

5. 技能与记忆

命令 用途
/skills 查看已加载技能
/memory 查看记忆内容
/forget <内容> 删除指定记忆

6. 信息查询

命令 用途
/cost 查看 Token 消耗与费用
/version 查看版本
/ping 测试连接

三、关键文件路径速查

~ 在 Windows 下为 %USERPROFILE%

路径 用途
~/.openclaw/openclaw.json 主配置文件
~/.openclaw/workspace/ 默认工作区
~/.openclaw/skills/ 全局技能目录
~/.openclaw/agents/ Agent 数据目录
~/.openclaw/agents/<ID>/USER.md 用户偏好
~/.openclaw/agents/<ID>/memory/ 记忆存储
~/.openclaw/agents/<ID>/cron/jobs.json 定时任务
~/.openclaw/agents/<ID>/sessions/ 会话记录
~/.openclaw/workspace/AGENTS.md 核心提示词

四、新手标准急救流程

遇到异常按以下顺序执行:

  1. openclaw doctor —— 首选
  2. openclaw logs —— 看错误
  3. openclaw status —— 状态
  4. openclaw restart —— 重启
  5. openclaw doctor --fix —— 还不行再试自动修复

 

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇