🎖️ 任务奖励 — 学完你能做到
熟练使用 /status、/model、/skills 等日常管理命令
📖 本章目标:常用命令一页搞定,随时查阅
📦 安装与更新
# 全局安装 OpenClaw
npm install -g openclaw@latest
# 运行初始化安装向导
openclaw onboard --install-daemon
# 更新到最新版本
openclaw update
🔧 网关管理
# 启动网关
openclaw gateway start
# 停止网关
openclaw gateway stop
# 重启网关(修改配置后必须重启)
openclaw gateway restart
# 查看运行状态
openclaw status
🩺 诊断与日志
# 环境诊断(新手遇到问题先跑这个)
openclaw doctor
# 查看实时日志
openclaw logs
# 查看最近 100 行日志
openclaw logs --lines 100
📡 渠道管理
# 添加新渠道(交互式向导)
openclaw channels add
# 列出已配置的渠道
openclaw channels list
# 配对批准(批准用户使用)
openclaw pairing approve <渠道> <配对码>
# 启用渠道插件
openclaw plugins enable <插件名>
# 安装第三方插件
openclaw plugins install <插件包名>
🎯 Skills 管理
# 安装 Skill
openclaw skills install <名称>
# 查看所有可用 Skills
openclaw skills list
# 查看符合当前环境的 Skills
openclaw skills list --eligible
# 查看 Skill 详细信息
openclaw skills info <名称>
# 更新 Skill 到最新版本
openclaw skills update <名称>
# 卸载 Skill
openclaw skills remove <名称>
# 搜索 ClawHub 技能市场
openclaw skills search <关键词>
🤖 Agent 管理
# 列出所有 Agent
openclaw agents list
# 查看 Agent 状态
openclaw agents status <agent-id>
# 重载 Agent 配置(修改 AGENTS.md 后)
openclaw agents reload <agent-id>
📊 常用组合场景
场景一:首次安装完整流程
# 1. 安装
npm install -g openclaw@latest
# 2. 初始化
openclaw onboard --install-daemon
# 3. 验证安装
openclaw status
openclaw doctor
场景二:修改配置后重启
# 修改配置文件后
openclaw gateway restart
openclaw status # 确认正常运行
场景三:遇到问题排查
# 步骤一:环境检测
openclaw doctor
# 步骤二:查看日志
openclaw logs
# 步骤三:重启服务
openclaw gateway restart
# 步骤四:更新版本(可能是 Bug)
openclaw update
场景四:安装新技能
# 搜索技能
openclaw skills search 浏览器
# 查看详情
openclaw skills info agent-browser
# 安装
openclaw skills install agent-browser
# 重启生效
openclaw gateway restart
🗂️ 配置文件路径速查
| 文件 | 路径 | 说明 |
|---|---|---|
| 全局配置 | ~/.openclaw/openclaw.json | API Key、模型、渠道配置 |
| Agent 工作区 | ~/.openclaw-{id}/workspace/ | 各 Agent 独立目录 |
| 全局 Skills | ~/.openclaw/skills/ | 用户级技能 |
| 内置 Skills | npm 包目录 | 官方内置技能 |
| 日志 | ~/.openclaw/logs/ | 运行日志 |
⌨️ 快捷参考卡
openclaw status → 查状态
openclaw doctor → 诊断问题
openclaw gateway restart → 重启服务
openclaw update → 更新版本
openclaw logs → 查日志