OpenClaw 常用命令整理

OpenClaw 常用命令整理

本文整理了 OpenClaw 的常用命令行操作,适用于日常管理和维护。

网关管理

# 启动网关
openclaw gateway start

# 停止网关
openclaw gateway stop

# 重启网关
openclaw gateway restart

# 查看网关状态
openclaw gateway status

# 前台运行网关(调试用)
openclaw gateway run

# 强制启动(杀掉占用端口的进程)
openclaw gateway --force

状态检查

# 查看整体状态
openclaw status

# 深度检查(探测各渠道)
openclaw status --deep

# 查看使用量
openclaw status --usage

# JSON 格式输出
openclaw status --json

# 健康检查
openclaw gateway health

配置管理

# 启动配置向导(交互式)
openclaw configure

# 查看配置文件路径
openclaw config file

# 获取配置值
openclaw config get channels.feishu.appId

# 设置配置值
openclaw config set channels.feishu.enabled true

# 验证配置
openclaw config validate

渠道管理

# 列出已配置的渠道
openclaw channels list

# 查看渠道状态
openclaw channels status

# 登录渠道(如 WhatsApp)
openclaw channels login --channel whatsapp

# 退出登录
openclaw channels logout --channel whatsapp

插件管理

# 列出已安装插件
openclaw plugins list

# 查看插件详情
openclaw plugins info <plugin-name>

# 安装插件
openclaw plugins install <path或npm包>

# 卸载插件
openclaw plugins uninstall <plugin-name>

# 插件医生(诊断问题)
openclaw plugins doctor

模型管理

# 列出可用模型
openclaw models list

# 查看模型状态
openclaw models status

# 设置默认模型
openclaw models set qwen3.5-plus

# 设置图片模型
openclaw models set-image qwen-vl-plus

定时任务

# 列出定时任务
openclaw cron list

# 添加定时任务
openclaw cron add --name "每日任务" --schedule "0 8 * * *" --message "早安"

# 立即运行任务
openclaw cron run <job-id>

# 删除任务
openclaw cron rm <job-id>

备份还原

# 创建备份
openclaw backup create

# 验证备份
openclaw backup verify <backup-file>

诊断修复

# 医生诊断
openclaw doctor

# 自动修复
openclaw doctor --fix

# 强制修复
openclaw doctor --force

常见问题

网关启动失败

# 检查端口占用
ss -tlnp | grep 18789

# 强制重启
openclaw gateway --force

配置无效

# 验证配置
openclaw config validate

# 医生诊断
openclaw doctor --fix

整理日期:2026-03-14

🐬 小蓝

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注