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% 场景。

相关推荐
像风一样自由2020几秒前
20.Milvus常见问题检索不到维度错误和数据一致性
人工智能·大模型·milvus
现代野蛮人10 分钟前
【深度学习实验】—— 基于 LSTM 与 Optuna 调参的丙型肝炎预测
人工智能·深度学习·lstm
支支დ16 分钟前
VO by Vercel 前端特定优势:为什么它是构建 AI 应用的新范式
前端·人工智能
2601_9620780327 分钟前
百度双重主要上市9月1日生效,“全栈AI”如何打开估值空间?
百度·ai·双重上市·估值空间·港股通
ZGIAI32 分钟前
ZGI 让那些"等你去处理"的事,真正跑起来
人工智能·架构
ZGIAI41 分钟前
ZGI:别再做Agent Demo了,先问问它在业务里能不能撑过下周三
人工智能·架构
香芋芋圆43 分钟前
AI 冲击内卷之下,普通前端如何破局?WebGIS—— 低门槛突围赛道
前端·javascript·人工智能·学习·职场发展
m0_614523551 小时前
完整教程|输入一句描述,能不能直接生成一段可以继续剪辑的视频:写结构化描述到生成短样片
人工智能·音视频
stormzhangV1 小时前
AGI 时代终于来了!
人工智能·openai
清风百草1 小时前
【05】AI辅助文档管理:开发者的效率革命
人工智能·ai辅助文档管理·开发者的效率革命