确认电脑环境
1.是否装有Git和Node.js
# 确认node环境
node --version
# 确认git环境
git --version
2.安装openclaw
## windows环境部署Openclaw
powershell -c "irm https://openclaw.ai/install.ps1 | iex"
iwr -useb https://openclaw.ai/install.ps1 | iex
## MacOs环境部署Openclaw
curl -fsSL https://openclaw.ai/install.sh | bash
-
Git
-
Node.js --- 推荐 Node 24(也支持 Node 22.16+)
3.部署完毕
## 运行引导
openclaw onboard --install-daemon
## 重启OpenClaw
openclaw gateway restart
## 启动
openclaw gateway run
## 打开OpenClaw浏览器页面(带令牌):
openclaw dashboard
接入微信/企业微信/飞书/钉钉
微信
第一步:启用微信插件
-
打开手机微信 →【我】→【设置】→【插件】→ 找到并启用"微信 ClawBot"插件。
-
若未看到该插件,可尝试更新微信至8.0.69及以上版本,或通过"微信派"公众号获取最新入口。
第二步:在 OpenClaw 中安装并绑定插件
- 在运行 OpenClaw 的终端中执行以下命令安装微信插件:
npx -y @tencent-weixin/openclaw-weixin-cli@latest install
- 若遇到速率限制(429错误),可稍等后重试,或手动安装:
openclaw plugins install "@tencent-weixin/openclaw-weixin@latest"
-
安装完成后,OpenClaw 会生成一个绑定二维码。
-
打开微信"微信 ClawBot"插件页 → 点击"开始扫一扫" → 扫描该二维码 → 确认授权(消息收发、插件通信等权限)。
第三步:验证连接状态
-
绑定成功后,微信聊天列表会出现"微信 ClawBot"会话窗口。
-
在 OpenClaw 终端执行
openclaw channels status,若输出包含Channel: weixin, Status: enabled, Connection: connected,即表示对接成功。 -
此时可直接在微信中向"微信 ClawBot"发送指令,如"帮我找一张龙虾表情包"或"创建一个文档",AI 将自动响应并返回结果。
企业微信
第一步:在企业微信创建智能机器人
-
登录企业微信管理后台,进入「应用管理」→「智能机器人」。
-
点击「创建机器人」,填写名称、头像和简介后保存。
-
在机器人详情页,点击「API模式」→「使用长连接」,然后点击「获取 Secret」。
-
复制并妥善保存生成的 Bot ID 和 Secret,这是后续对接的关键凭证。
第二步:在OpenClaw中安装并配置企微插件
- 在运行 OpenClaw 的终端中执行以下命令安装企业微信通道插件:
openclaw channels install wecom
-
安装完成后,打开 OpenClaw 的控制界面,进入「聊天配置」→「企业微信(WeCom)」。
-
将之前复制的 Bot ID 和 Secret 粘贴到对应输入框中,点击「保存渠道配置」。
第三步:验证连接与功能测试
- 重启 OpenClaw 网关服务使配置生效:
openclaw gateway restart
-
回到企业微信管理后台,确认机器人状态为"已启用"。
-
在企业微信中向该机器人发送一条测试消息(如"你好"),若能在3-5秒内收到AI回复,即表示对接成功。
飞书
暂无
钉钉
暂无
切换大模型
# 以阿里云百炼为例
openclaw config set models.providers.bailian --json '{
"baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"apiKey": "sk-your-api-key",
"defaultModel": "qwen-max"
}'
# 设置为默认使用的模型
openclaw config set models.default "bailian:qwen-max"
问题解决
openclaw config set gateway.auth.mode "password"
openclaw config set gateway.auth.password "test123"
openclaw config set gateway.bind "lan"
openclaw config set gateway.controlUi.allowInsecureAuth true
openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth true
openclaw config set agents.defaults.timeoutSeconds 1800
openclaw gateway restart
修改认证模式
## 1. 将认证模式修改为 password
openclaw config set gateway.auth.mode "password"
## 2. 设置你的登录密码(请替换为你自己的强密码)
openclaw config set gateway.auth.password "test123"
## 3. 重启网关服务使配置生效
openclaw gateway restart
解除仅本地访问
# 将网关绑定模式修改为 lan(即监听 0.0.0.0)
openclaw config set gateway.bind "lan"
## 3. 重启网关服务使配置生效
openclaw gateway restart
修改为远程访问
##1. 允许非安全认证(允许 HTTP 下使用密码/Token 登录)
openclaw config set gateway.controlUi.allowInsecureAuth true
## 2. 禁用设备身份验证(绕过浏览器的安全上下文检查)
openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth true
## 3. 重启网关服务使配置生效
openclaw gateway restart
openclaw gateway restart
openclaw gateway restart
超时导致的任务失效
# 将默认超时从600秒调整为1800秒(30分钟)
openclaw config set agents.defaults.timeoutSeconds 1800
# 重启网关使配置生效
openclaw gateway restart
此操作可覆盖绝大多数长文本生成、文件处理、多轮推理等场景。若仍超时,可进一步设为 3600(1小时)。
其他
openclaw gateway stop
openclaw config set gateway.port 8888
openclaw gateway start
# 1. 停止当前运行的服务
openclaw gateway stop
# 2. 将端口修改为目标端口(例如 8080)
openclaw config set gateway.port 8080
# 3. 重新启动服务使配置生效
openclaw gateway start
运行以下命令,让 OpenClaw 自动帮你检查网络、配置文件和 API 密钥的状态:
openclaw doctor
在终端中运行以下命令启动配置向导
openclaw onboard
OpenClaw 已经为你提供了内置的修复工具。根据报错提示,直接在终端中运行以下命令即可尝试自动修复配置错误:
openclaw doctor --fix
#注:你也可以先运行 openclaw config validate 来查看具体的语法错误位置)
验证配置是否生效:
openclaw config validate
卸载
openclaw uninstall --all --yes --non-interactive