以下是目前(2026年3月)最常用、最实用的命令行分类速查(基于官方文档 + 社区高频使用):
1. 安装 & 首次配置(最重要的一步)
# 一键安装(推荐)
curl -fsSL https://openclaw.ai/install.sh | bash
# 或者用 npm(需要已安装 Node.js ≥22)
npm install -g openclaw@latest
# 交互式向导(强烈推荐第一次运行)
openclaw onboard
# 带后台守护进程安装(生产环境最常用)
openclaw onboard --install-daemon
# 非交互快速初始化(适合脚本)
openclaw setup
2. 网关(Gateway)管理(核心服务)
openclaw gateway status # 查看运行状态(最常用)
openclaw gateway start # 前台启动
openclaw gateway stop
openclaw gateway restart
openclaw gateway logs # 查看日志(调试必备)
3. 诊断 & 维护
openclaw doctor # 快速诊断问题
openclaw doctor --deep # 深度检查(推荐)
openclaw health # 健康检查
openclaw status # 简要状态概览
openclaw update # 更新到最新版
openclaw migrate # 大版本升级后迁移配置
4. 模型(Models)相关(最常调整的部分)
openclaw models list # 列出所有可用模型
openclaw models status
openclaw models set <provider/model> # 如 openai/gpt-4o-mini
openclaw models set-image <provider/model> # 设置图像生成模型
openclaw models aliases list
openclaw models aliases add gpt4o gpt-4o-2024-11-20
openclaw models fallbacks list
openclaw models fallbacks add claude-3.5-sonnet
5. 通道(Channels)管理(连接 Telegram/WhatsApp/Discord 等)
openclaw channels list
openclaw channels add # 交互式添加新通道
openclaw channels login # WhatsApp 等扫码登录
openclaw channels status
6. 技能(Skills)管理
openclaw skills list
openclaw skills add <github-repo> --skill <skill-name>
openclaw skills update
openclaw skills remove <skill>
7. 配置管理(config)
openclaw configure # 交互式修改配置
openclaw config get <path> # 如 openclaw config get agents.defaults.model
openclaw config set <path> <value>
openclaw config edit # 直接打开编辑器修改 ~/.openclaw/openclaw.json
8. 其他高频实用命令
openclaw dashboard # 打开 Web 控制台(浏览器)
openclaw backup create # 创建本地备份
openclaw devices list # 查看已配对设备
openclaw devices approve <id>
openclaw --help # 总帮助
openclaw <command> --help # 具体子命令帮助
openclaw --version # 查看版本
# 开发/测试常用全局选项
openclaw --dev ... # 使用隔离的开发配置目录
openclaw --profile work ... # 使用独立 profile(如 work / personal)
推荐日常使用组合
- 检查一切是否正常:
openclaw doctor && openclaw gateway status
- 改模型:
openclaw models set claude-3.7-sonnet
- 加新技能:
openclaw skills add username/repo --skill cool-tool
- 改完配置后重启:
openclaw gateway restart
- 出问题先跑:
openclaw doctor --deep
大部分用户真正高频使用的其实就 10 个左右命令:onboard / gateway status / doctor / models set / skills add / channels list / configure / dashboard / update / backup。