OpenClaw 常用命令详解

一、基础信息与启停命令

1. 查看版本

Bash 复制代码
openclaw --version

作用:显示当前 OpenClaw 版本

2. 查看帮助

Bash 复制代码
openclaw --help

作用:列出所有一级命令及简要说明,忘记命令时快速查阅。

3. 启动 TUI 交互界面(新手推荐)

Bash 复制代码
openclaw tui

作用:终端可视化界面,支持鼠标/方向键操作,适合快速配置和调试。

4. 查看运行状态

Bash 复制代码
openclaw status

作用:查看网关运行、通道连接、活跃会话、内存占用、模型状态等核心信息。

5. 启停服务

Bash 复制代码
openclaw stop
openclaw restart
  • stop:优雅停止 OpenClaw 网关与所有会话。

  • restart:重启服务,常用于更新或配置生效。

6. 查看日志

Bash 复制代码
openclaw logs
openclaw logs -f   # 实时滚动

作用:排错首选,看启动、通道、模型调用、技能执行日志。


二、初始化与配置命令

1. 首次初始化向导

Bash 复制代码
openclaw onboard

作用:引导完成提供商登录、工作区、默认模型、守护进程安装,5 分钟完成基础配置。

2. 重新进入配置向导

Bash 复制代码
openclaw configure

作用:修改已有配置(模型、密钥、网关),不覆盖已有数据。

3. 健康检查与修复

Bash 复制代码
openclaw doctor
openclaw doctor --fix
  • doctor:全面检测环境、依赖、配置、网络、通道连通性。

  • --fix:自动修复常见问题(权限、端口、依赖缺失)。

4. 配置项操作

Bash 复制代码
openclaw config set <path> <value>
openclaw config unset <path>

示例:

Bash 复制代码
openclaw config set plugins.entries.openclaw-weixin.enabled true

作用:修改/删除 JSON 配置,支持批量 JSON 导入。


三、模型管理命令(4.10 高频)

1. 列出所有模型

Bash 复制代码
openclaw models list

作用:查看已配置模型名称、厂商、默认状态、可用性。

2. 按厂商筛选

Bash 复制代码
openclaw models list -p ollama

作用:快速过滤本地/远程模型(ollama、openai、doubao 等)。

3. 设置默认模型

Bash 复制代码
openclaw models set <model-name>

示例:

Bash 复制代码
openclaw models set doubao-lite

4. 测试模型连通性

Bash 复制代码
openclaw models test <model-name>

作用:发送测试prompt,验证 API Key、网络、返回格式是否正常。


四、通道(Channel)管理命令

1. 查看已配置通道

Bash 复制代码
openclaw channels list

2. 查看通道状态

Bash 复制代码
openclaw channels status

作用:检测网关可达性、认证有效性、健康状态,给出常见错误修复建议。

3. 添加通道(如微信)

Bash 复制代码
openclaw channels add
  • 无参数:向导式配置。

  • 支持:weixin、dingtalk、feishu、telegram 等。

4. 登录/登出通道

Bash 复制代码
openclaw channels login --channel <name>
openclaw channels logout --channel <name>

示例(微信):

Bash 复制代码
openclaw channels login --channel openclaw-weixin

5. 查看通道日志

Bash 复制代码
openclaw channels logs

五、技能(Skills)与智能体命令

1. 查看已加载技能

Bash 复制代码
openclaw skills list

2. 启用/禁用技能

Bash 复制代码
openclaw skills enable <skill-id>
openclaw skills disable <skill-id>

3. 智能体管理

Bash 复制代码
openclaw agents list
openclaw agents start <agent-id>
openclaw agents stop <agent-id>

六、常用排错组合(建议收藏)

Bash 复制代码
# 服务异常
openclaw doctor --fix
openclaw restart

# 微信通道连不上
openclaw channels status
openclaw channels logout --channel openclaw-weixin
openclaw channels login --channel openclaw-weixin

# 模型调用失败
openclaw models test <model-name>
openclaw logs | grep -i model

七、总结

OpenClaw 4.10 CLI 整体分为基础启停、配置、模型、通道、技能 五大类。日常记住:status、logs、doctor、channels、models 即可覆盖 90% 场景。

相关推荐
mit6.8241 小时前
AI时代下的TypeScript
人工智能
sulikey1 小时前
大模型是如何工作的
人工智能
久违 °8 小时前
【AI-Agent】TagMatrix 数据标注工具开发
人工智能·数据分析·go·agent·数据隐私
AI360labs_atyun8 小时前
腾讯推出电子牛马Marvis,好用吗?
人工智能·科技·ai
Dfreedom.8 小时前
Windows、虚拟机、开发板组网通信原理及调试通联步骤
人工智能·windows·部署·边缘计算·开发板·模型加速
3DVisionary9 小时前
蓝光三维扫描:医疗制造的精度焦虑怎么解
人工智能·算法·制造·蓝光三维扫描·医疗制造·三维检测·义齿检测
Are_You_Okkk_9 小时前
基于MonkeyCode解析AI研发新模式,根治开发低效痛点
大数据·人工智能·开源·ai编程
好评笔记9 小时前
机器学习面试八股——常用损失函数
人工智能·深度学习·算法·机器学习·校招
weixin_468466859 小时前
全局与局部注意力机制新手实战指南
人工智能·python·深度学习·算法·自然语言处理·transformer·注意力机制
weixin_468466859 小时前
工业相机成像原理新手入门指南
人工智能·自动化·机器视觉·工业相机·光学·光学系统·成像原理