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

相关推荐
杨杨杨大侠3 小时前
RAG、记忆、上下文,这几个东西到底怎么串起来?
人工智能·agent
system_error_x5 小时前
MCP协议开发实战:从零搭建AI Agent工具链
人工智能
Autumn_ing5 小时前
Design.md生成UI怎么验收?举例运营后台的颜色、状态和数据核对
前端·ui·ai·设计系统·paico·ai生成ui·design.md
Sayai5 小时前
ComfyUI+混元视频实战:12G 显存跑 13G 模型,5 分钟出片(国产开源,附模型与工作流)
人工智能·aigc·音视频·comfyui·hunyuanvideo·混元视频
燧机科技SuiJi5 小时前
山体坍塌落石滑坡泥石流监测系统 落石泥石流监控摄像机
大数据·人工智能·深度学习·yolo
国科安芯5 小时前
立方星与微纳卫星综合电子微型化趋势下的抗辐射MCU选型综述
人工智能·单片机·嵌入式硬件·mcu·risc-v·抗辐射
诸神缄默不语6 小时前
小春学习日刊 2026年第4期:2026.10.16
人工智能
draracle6 小时前
为什么 AI 无法胜任系统架构
人工智能·系统架构
未来和明天6 小时前
iLeadE-3403边缘计算网关10.4 TOPS数据采集、视频接入与外设扩展等多元化应用需求
人工智能·边缘计算