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

相关推荐
碎碎思1 小时前
FPGA图像处理平台搭建:MIPI + VDMA + Ethernet全流程
图像处理·人工智能·fpga开发
我的世界洛天依1 小时前
胡桃讲编程:混音教学第三步|AI 翻唱实操:软件 + 模型 + 索引全安装(全链接无遗漏・老本专属)
人工智能
猫小呆1 小时前
Openclaw启动后Error: EACCES: permission denied, mkdir权限问题解决(windows)
人工智能
techdashen2 小时前
Rust 在安全关键软件:机遇、挑战与未来之路
人工智能·安全·rust
java1234_小锋2 小时前
LangChain4j快速入门
人工智能·python·spring
江瀚视野2 小时前
美团“小团健康管家”发布,美团也入局AI健康了?
人工智能
HIT_Weston2 小时前
47、【Agent】【OpenCode】本地代理增强版分析(JSON解析)
人工智能·json·agent·opencode
山林竹笋2 小时前
大模型汇总(国外)
人工智能·大模型·ai编程
FreeBuf_2 小时前
OpenAI发布GPT-5.4-Cyber强化网安防御,与Anthropic展开AI攻防竞赛
人工智能·gpt