📖 所有常用命令一页搞定,随时查阅
基础与诊断
| 命令 | 用途 |
|---|
openclaw --version | 查看版本 |
openclaw status --all | 全局状态总览 |
openclaw gateway status | Gateway 状态 |
openclaw doctor | 自动诊断配置问题 |
openclaw doctor --fix | 自动修复可修复的问题 |
openclaw logs --follow | 实时跟踪日志 |
openclaw logs --level error | 只看错误日志 |
配置管理
| 命令 | 用途 |
|---|
openclaw config get <key> | 查看某项配置 |
openclaw config set <key> <value> | 修改某项配置 |
openclaw config list | 列出所有配置 |
openclaw gateway restart | 重启 Gateway |
openclaw auth refresh | 刷新鉴权 token |
Skills 管理
| 命令 | 用途 |
|---|
openclaw skills list | 列出已安装 Skills |
openclaw skills list --builtin | 列出内置 Skills |
openclaw skills list --eligible | 列出符合当前环境的 Skills |
openclaw skills install <name> | 安装 Skill |
openclaw skills disable <name> | 禁用 Skill(不删除) |
openclaw skills uninstall <name> | 卸载 Skill |
openclaw skills update --all | 更新所有 Skills |
openclaw skills search <keyword> | 搜索 ClawHub 技能市场 |
openclaw skills info <name> | 查看 Skill 详细信息 |
频道与 Cron
| 命令 | 用途 |
|---|
openclaw channels status --probe | 探测所有频道连通性 |
openclaw channels list | 列出已配置频道 |
openclaw channels add | 添加新渠道(交互式) |
openclaw pairing approve <channel> <code> | 配对批准 |
openclaw cron list | 列出所有 Cron 任务 |
openclaw cron run <name> | 手动触发 Cron 任务 |
openclaw cron disable <name> | 禁用 Cron 任务 |
会话内快捷命令(聊天中输入)
| 命令 | 用途 |
|---|
/new | 开启新 session(清除当前 context) |
/compact | 压缩当前 session 历史(减少 token) |
/context list | 查看当前已加载的工作区文件 |
/context detail | 查看 token 用量明细 |
/reload | 重新加载所有工作区文件(不重启) |
/help | 显示所有可用快捷命令 |
常用配置一键命令
# 关闭 Thinking 模式(省 10-50x 成本)
openclaw config set agent.thinking false
# 限制最大上下文
openclaw config set agent.contextTokens 50000
# 改 dmScope 为 per-peer(多人场景必做)
openclaw config set gateway.dmScope per-peer
# Heartbeat 间隔改为 1 小时
openclaw config set agent.heartbeat.every 1h
Git 追踪工作区(推荐必做)
# 初始化(只做一次)
cd ~/.openclaw/workspace && git init && git add -A
git commit -m "初始配置存档"
# 每次修改后提交
git commit -am "SOUL.md: 移走决策分级到 AGENTS.md"
# agent 行为出错时,快速定位是哪次改动导致的
git log --oneline -20
git diff HEAD~3 SOUL.md
# 恢复到上一个稳定版本
git checkout HEAD~1 SOUL.md
五步诊断法(遇到问题先跑这个)
openclaw status --all # Step 1:全局状态总览
openclaw gateway status # Step 2:Gateway 状态
openclaw doctor # Step 3:配置问题诊断
openclaw channels status --probe # Step 4:频道连通性探测
openclaw logs --follow # Step 5:实时日志跟踪
← 附录A:15条坑与桥 | 返回目录 | 核心结论 →