常用命令汇总(持续补充…)
# 初始化 / 配置向导
openclaw onboard
# 查看正确路径
~/.openclaw
# 校验配置是否合法(报错会提示哪行错了)
openclaw config validate
# 查看大模型
openclaw models list
# 查看OpenClaw 实时日志
openclaw logs --follow
# 修改已有配置
openclaw config
# 一次性终止所有 OpenClaw 进程(gateway、daemon、webui 等)
pkill -f openclaw
#######################################
# 启动网关服务
openclaw gateway start
# 停止现有服务
openclaw gateway stop
# 重启网关
openclaw gateway restart
# 查看状态
openclaw status --all
#######################################
# 查看所有已配对 / 待配对设备(pending 是等待审批的设备,paired是已具备的设备)
openclaw devices list
# 批准权限
openclaw devices approve bb72...011e981e
#######################################
# 检查配置是否校验通过
openclaw doctor
# 检查并修复工具问题
openclaw doctor --fix
#######################################
# 本地ollama模型调用:Agent 全局超时 60 秒
openclaw config set agents.defaults.timeoutSeconds 60
# 本地ollama模型调用:禁止并发(2B 模型扛不住并发)
openclaw config set agents.defaults.maxConcurrent 1
OpenClaw CLI 命令速查手册
Hint: commands suffixed with * have subcommands. Run <command> --help for details.
一、基础配置与诊断
| 命令 | 说明 |
|---|
doctor | 健康检查 + 快速修复 |
doctor --fix | 自动修复问题 |
configure | 交互式配置 |
config * | 非交互式配置 |
setup | 初始化配置 |
status | 查看通道/服务状态 |
health | 网关健康检查 |
reset | 重置本地配置 |
二、网关服务(核心必用)
| 命令 | 说明 |
|---|
gateway | 启动网关 |
gateway start | 启动网关服务 |
gateway stop | 停止网关服务 |
gateway restart | 重启网关服务(你要的!) |
gateway --port 18789 | 指定端口启动 |
gateway --force | 强制启动(杀占用端口) |
gateway status | 查看网关运行状态 |
logs | 查看网关日志 |
三、Agent 智能体
| 命令 | 说明 |
|---|
agent | 单次智能体交互 |
agents * | 管理代理 |
sessions * | 对话历史 |
memory | 记忆管理 |
四、聊天渠道 & 消息
| 命令 | 说明 |
|---|
channels * | 渠道管理 |
channels login | 登录渠道(WhatsApp/Telegram) |
message send | 发送消息 |
directory * | 查询联系人/群组 |
五、AI 模型
| 命令 | 说明 |
|---|
models * | 模型管理 |
infer * | 运行推理 |
capability * | 模型能力调用 |
六、设备 & 安全
| 命令 | 说明 |
|---|
devices * | 设备管理 |
pairing * | 设备配对 |
qr | 生成配对二维码 |
security * | 安全审计 |
七、界面
| 命令 | 说明 |
|---|
dashboard | 打开网页控制台 |
tui | 终端 UI |
八、任务 & 系统
| 命令 | 说明 |
|---|
cron * | 定时任务 |
tasks * | 后台任务 |
skills * | 技能列表 |
plugins * | 插件管理 |
九、备份 / 更新 / 卸载
| 命令 | 说明 |
|---|
backup * | 备份数据 |
update * | 更新 OpenClaw |
uninstall | 卸载服务 |
所有评论(0)