🦞 OpenClaw CLI 速查指南

0 阅读3分钟

openclaw-official-cli-cover_compressed.webp

官方文档地址

安装与初始化

首次设置

运行 openclaw setup 初始化配置和工作区。使用 openclaw configure 标志启动交互式引导向导。

新手引导

openclaw onboard

配置管理

配置查看与修改

openclaw config get <path>   # 查看配置值
openclaw config set <path> <value>  # 设置配置值
openclaw config unset <path>       # 删除配置值

配置向导

openclaw configure

系统健康与诊断

健康检查

openclaw doctor

状态查看

openclaw status --deep --usage

安全审计

openclaw security audit --deep --fix

渠道管理

渠道操作

openclaw channels list       # 列出已配置的渠道
openclaw channels status     # 检查渠道健康状况
openclaw channels add        # 添加或更新渠道(交互式)
openclaw channels remove     # 删除渠道配置

示例

openclaw channels add --channel telegram --account alerts --name "Alerts Bot"
openclaw channels status --probe

消息与智能体

发送消息

openclaw message send --target +15555550123 --message "Hi"

运行智能体

openclaw agent --message "你的问题"

智能体管理

openclaw agents list              # 列出已配置的智能体
openclaw agents add               # 添加新智能体
openclaw agents delete <id>       # 删除智能体

Gateway 网关管理

运行网关

openclaw gateway

网关管理

openclaw gateway status          # 检查网关服务状态
openclaw gateway install         # 安装网关服务
openclaw gateway start           # 启动网关服务
openclaw gateway stop            # 停止网关服务
openclaw gateway restart         # 重启网关服务

日志查看

# 查看日志
openclaw logs

# 查看实时日志
openclaw logs --follow

模型管理

模型设置

openclaw models set <model>            # 设置主模型
openclaw models set-image <model>      # 设置图像模型

认证管理

openclaw models auth setup-token --provider anthropic

模型扫描

openclaw models scan

插件管理

openclaw plugins list                # 列出可用插件
openclaw plugins install <spec>     # 安装插件
openclaw plugins enable <id>        # 启用插件
openclaw plugins disable <id>       # 禁用插件

记忆操作

openclaw memory status              # 显示索引统计
openclaw memory index               # 重新索引记忆文件
openclaw memory search "查询"        # 语义搜索记忆

定时任务

openclaw cron list                  # 列出定时任务
openclaw cron add                   # 添加新任务
openclaw cron run <id>              # 立即运行任务

节点管理

openclaw nodes list                 # 列出已配对节点
openclaw nodes invoke               # 在节点上执行命令
openclaw nodes camera snap          # 从节点摄像头拍照

浏览器控制

openclaw browser open <url>         # 打开网页
openclaw browser screenshot         # 截取屏幕截图
openclaw browser navigate <url>     # 导航到指定URL

全局标志

常用选项

  • --dev - 使用开发环境配置
  • --profile <name> - 使用指定配置文件
  • --no-color - 禁用颜色输出
  • --json - 输出JSON格式

输出控制

  • ANSI颜色仅在TTY会话中渲染
  • OSC-8超链接在支持的终端中可点击
  • --plain 禁用样式获得干净输出

重置与卸载

重置系统

openclaw reset

完全卸载

openclaw uninstall

文档搜索

openclaw docs [查询]

终端界面

openclaw tui

提示:使用 openclaw --help 查看所有可用命令,或访问 https://docs.openclaw.ai/llms.txt 获取完整文档索引。