通过一键脚本在你的服务器上部署 OpenClaw AI 网关,使用 Crazyrouter 作为 API 后端,开箱即用。
快速安装
curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash
或者下载后运行:
wget https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh
bash install.sh
脚本支持中英文界面,启动时会提示选择语言。也可通过环境变量 INSTALLER_LANG=zh 或 INSTALLER_LANG=en 跳过选择。
你需要准备
| 项目 | 说明 |
|---|
| Crazyrouter API Key | 在 crazyrouter.com 注册后,前往 Token 管理 创建 |
| Telegram Bot Token(可选) | 在 Telegram 找 @BotFather 创建 Bot 后获取 |
安装过程
脚本会自动完成以下 10 个步骤:
检测系统环境
识别 Linux/macOS、x64/arm64,选择对应安装方式
安装 Node.js 22+
如未安装,自动通过 NodeSource (apt/dnf/yum) 或 Homebrew 安装
安装 OpenClaw
通过 npm 全局安装 OpenClaw 包
配置 API Key
交互式输入 Crazyrouter API Key(或从环境变量读取)
预配置 AI 模型
自动配置 15+ 热门模型,开箱即用
安装 IM 插件
钉钉、企业微信、QQ Bot 等插件
配置系统服务
Linux 使用 systemd,macOS 使用 launchd,开机自启
启动网关
启动 OpenClaw 服务,默认端口 18789
Telegram Bot 设置
交互式配置 Telegram Bot 并自动完成 owner 配对
预配置模型
| Provider | 模型 |
|---|
| Claude | Opus 4.6, Sonnet 4.6 |
| GPT | 5.2, 5.3 Codex, 5 Mini, 4.1, 4.1 Mini, 4o Mini |
| Gemini | 3.1 Pro, 3 Flash |
| DeepSeek | R1, V3.2 |
| 其他 | Kimi K2.5, GLM-5, Grok 4.1, MiniMax M2.1 |
环境变量
支持通过环境变量实现非交互安装:
| 变量 | 说明 | 默认值 |
|---|
CRAZYROUTER_API_KEY | 预设 API Key,跳过交互输入 | — |
GATEWAY_PORT | 网关端口 | 18789 |
INSTALLER_LANG | 安装语言 (zh/en) | 交互选择 |
# 非交互安装示例
CRAZYROUTER_API_KEY=sk-xxx INSTALLER_LANG=zh \
curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash
安装后管理
Linux (systemd)
macOS (launchd)
systemctl --user status openclaw # 查看状态
journalctl --user -u openclaw -f # 查看日志
systemctl --user restart openclaw # 重启
systemctl --user stop openclaw # 停止
tail -f ~/.openclaw/openclaw.log # 查看日志
# 重启
launchctl stop com.crazyrouter.openclaw && launchctl start com.crazyrouter.openclaw
# 停止
launchctl stop com.crazyrouter.openclaw
支持的 IM 平台
Telegram
安装时交互式设置,自动配对 owner
Slack / 飞书
通过 OpenClaw 插件接入
系统要求
- Linux (x64/arm64) 或 macOS (x64/arm64)
- 1-2 GB 内存
- 可访问互联网
- Crazyrouter API Key
GitHub 仓库
查看源码、提交 Issue 或贡献代码