Openclaw-原版部署(Mac)

前言

之前安装的openclaw-zh,当时原版没中文,现在官方版就已经支持中文了,所以建议直接安装原版。

环境要求

OpenClaw CN 引入了最新的底层安全机制与构建工具,请确保环境满足以下要求:

查看环境

NodeJS

1
2
node -v
npm -v

查看当前镜像

1
npm config list

设置镜像

1
2
3
npm config set registry https://registry.npmmirror.com/
npm cache clean -f
npm config list

安装步骤

安装与启动

安装

1
npm install -g openclaw --registry=https://registry.npmmirror.com

初始化

1
openclaw onboard --install-daemon

配置过程中不要安装飞书插件与相关配置。

启动网关

1
openclaw gateway

打开控制台

1
openclaw dashboard

查看模型和飞书设置

1
openclaw status

自定义模型

模型必须要开启--enable-auto-tool-choice--tool-call-parser

否则会报错

400 “auto” tool choice requires –enable-auto-tool-choice and –tool-call-parser to be set

查看模型

1
openclaw models status

查看所有的模型

1
openclaw models list

修改模型

1
openclaw config

飞书配置

先诊断与修复,看看有没有错误的配置,如果有的话可以手动删除

1
openclaw doctor --fix

这是配置文件路径

1
open ~/.openclaw/openclaw.json

修改配置

1
openclaw config

查看飞书配置

1
openclaw config get channels.feishu

飞书中打开机器人对话

按照提示输入配对码

1
openclaw pairing approve feishu MNB2G4CX

查看状态,查看飞书通道是否正常

1
openclaw status

从 OpenClaw 发消息到飞书(测试出站)

这个不用启动openclaw也能测试

1
openclaw message send --channel feishu --target 飞书机器人的ID --message "测试"

常用命令

常用命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
openclaw                    # 启动 OpenClaw
openclaw onboard # 初始化向导
openclaw dashboard # 打开网页控制台
openclaw config # 查看/修改配置
openclaw skills # 管理技能
openclaw --help # 查看帮助

# 网关管理
openclaw gateway run # 前台运行(挂终端,用于调试)
openclaw gateway start # 后台守护进程(不挂终端,推荐!)
openclaw gateway stop # 停止网关
openclaw gateway restart # 重启网关
openclaw gateway status # 查看网关状态
openclaw gateway install # 安装为系统服务(开机自启)

# 常用操作
openclaw update # 检查并更新 CLI
openclaw doctor # 诊断问题(自动修复)

状态与重启

查看状态

1
openclaw status

重启方式

1
openclaw gateway restart

运行后可访问

http://127.0.0.1:18789?token=xxx

查看实时消息

1
openclaw logs --follow

查看网关

1
openclaw gateway status

卸载教程

CLI 卸载

1
2
3
4
openclaw gateway stop

# 卸载
npm uninstall -g openclaw

数据清理(可选)

1
2
# 删除配置和缓存(不可恢复!)
rm -rf ~/.openclaw

更新升级

1
npm update -g openclaw

查看当前版本:

1
openclaw --version

其他

技能目录

1
.openclaw\workspace\skills

飞书开放平台配置

Openclaw-飞书插件配置