Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crazyrouter OpenClaw 一键部署 / One-Click Deploy

中文 | English


中文

在 Linux 或 macOS 上一条命令部署 OpenClaw AI 网关,使用 Crazyrouter 作为 AI API 后端,支持 300+ 模型。

快速开始

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

macOS 用户须知 🍎

脚本会自动安装 Node.js,但需要 Homebrew 作为包管理器。如果你的 Mac 还没有安装 Homebrew:

1. 安装 Homebrew

打开终端(Terminal),运行:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

安装完成后,按照终端提示把 Homebrew 添加到 PATH。通常会提示你运行类似这两条命令:

# Apple Silicon (M1/M2/M3/M4)
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

# Intel Mac
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/bin/brew shellenv)"

验证安装:

brew --version

2. (可选)手动安装 Node.js 22+

脚本会自动通过 Homebrew 安装 Node.js,但如果你想提前安装:

brew install node@22
brew link --overwrite node@22
node -v  # 应显示 v22.x.x

3. 运行安装脚本

curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash

需要准备

  1. Crazyrouter API Key — 在 crazyrouter.com 注册并获取
  2. Telegram Bot Token(可选)— 在 Telegram 找 @BotFather 创建 Bot 后获取

安装内容

脚本会自动完成以下步骤:

  1. 检测系统环境(Linux/macOS, x64/arm64)
  2. 安装 Node.js 22+(如未安装)
  3. 安装 OpenClaw npm 包
  4. 收集 API Key 并生成配置
  5. 预配置 15+ 热门 AI 模型
  6. 应用稳定性补丁
  7. 安装 IM 插件(钉钉、企业微信、QQ Bot)
  8. 配置系统服务(systemd/launchd)自动启动
  9. 启动 OpenClaw 网关
  10. 交互式 Telegram Bot 设置与自动配对

预配置模型

Provider 模型
Claude Opus 4.8(默认), Sonnet 4.6
GPT 5.5(默认备用), 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 curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash

安装后管理

Linux (systemd)

systemctl --user status openclaw    # 查看状态
journalctl --user -u openclaw -f    # 查看日志
systemctl --user restart openclaw   # 重启
systemctl --user stop openclaw      # 停止

macOS (launchd)

tail -f ~/.openclaw/openclaw.log                                                    # 查看日志
launchctl stop com.crazyrouter.openclaw && launchctl start com.crazyrouter.openclaw  # 重启
launchctl stop com.crazyrouter.openclaw                                              # 停止

常见问题

macOS: "command not found: brew"

Homebrew 未安装或未添加到 PATH。请先安装 Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

然后按终端提示添加到 PATH,或重新打开终端窗口。

macOS: "command not found: node"(安装后)

Node.js 通过 Homebrew 安装后可能需要 link:

brew link --overwrite node@22

或重新打开终端窗口。

端口 18789 被占用

修改端口:

GATEWAY_PORT=28789 curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash

或编辑 ~/.openclaw/openclaw.json 中的 gateway.port

如何卸载?
# 停止服务
# Linux:
systemctl --user stop openclaw && systemctl --user disable openclaw

# macOS:
launchctl stop com.crazyrouter.openclaw
rm ~/Library/LaunchAgents/com.crazyrouter.openclaw.plist

# 删除数据和配置
rm -rf ~/.openclaw

# 卸载 npm 包
npm uninstall -g openclaw

支持的 IM 平台

  • Telegram(安装时交互式设置)
  • Discord
  • Slack
  • 飞书
  • 钉钉
  • 企业微信
  • QQ Bot

系统要求

  • Linux (x64/arm64) 或 macOS (x64/arm64)
  • 1-2 GB 内存
  • 可访问互联网
  • Crazyrouter API Key

English

Deploy an OpenClaw AI gateway on Linux or macOS with a single command, powered by Crazyrouter as the AI API backend with 300+ models.

Quick Start

curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash

Or download and run:

wget https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh
bash install.sh

The installer supports both Chinese and English — you'll be prompted to choose a language at startup.

macOS Users 🍎

The script auto-installs Node.js, but requires Homebrew as the package manager. If you don't have Homebrew yet:

1. Install Homebrew

Open Terminal and run:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After installation, follow the terminal instructions to add Homebrew to your PATH. You'll typically need to run something like:

# Apple Silicon (M1/M2/M3/M4)
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

# Intel Mac
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/bin/brew shellenv)"

Verify:

brew --version

2. (Optional) Pre-install Node.js 22+

The script handles this automatically via Homebrew, but if you prefer:

brew install node@22
brew link --overwrite node@22
node -v  # Should show v22.x.x

3. Run the installer

curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash

Prerequisites

  1. Crazyrouter API Key — Sign up at crazyrouter.com
  2. Telegram Bot Token (optional) — Create a bot via @BotFather on Telegram

What Gets Installed

The script automatically handles:

  1. System detection (Linux/macOS, x64/arm64)
  2. Node.js 22+ installation (if not present)
  3. OpenClaw npm package installation
  4. API key collection and config generation
  5. Pre-configuration of 15+ popular AI models
  6. Stability patches (TLS crash guard)
  7. IM plugin installation (DingTalk, WeCom, QQ Bot)
  8. System service setup (systemd/launchd) for auto-start
  9. OpenClaw gateway startup
  10. Interactive Telegram Bot setup with auto-pairing

Pre-configured Models

Provider Models
Claude Opus 4.8 (default), Sonnet 4.6
GPT 5.5 (default fallback), 5.2, 5.3 Codex, 5 Mini, 4.1, 4.1 Mini, 4o Mini
Gemini 3.1 Pro, 3 Flash
DeepSeek R1, V3.2
Others Kimi K2.5, GLM-5, Grok 4.1, MiniMax M2.1

Environment Variables (Optional)

Variable Description Default
CRAZYROUTER_API_KEY Pre-set API key, skips interactive prompt
GATEWAY_PORT Gateway port 18789
INSTALLER_LANG Installer language (zh/en) Interactive

Non-interactive install example:

CRAZYROUTER_API_KEY=sk-xxx INSTALLER_LANG=en curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash

Post-Install Management

Linux (systemd)

systemctl --user status openclaw    # Check status
journalctl --user -u openclaw -f    # View logs
systemctl --user restart openclaw   # Restart
systemctl --user stop openclaw      # Stop

macOS (launchd)

tail -f ~/.openclaw/openclaw.log                                                    # View logs
launchctl stop com.crazyrouter.openclaw && launchctl start com.crazyrouter.openclaw  # Restart
launchctl stop com.crazyrouter.openclaw                                              # Stop

Troubleshooting

macOS: "command not found: brew"

Homebrew is not installed or not in PATH. Install it first:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then follow the terminal instructions to add it to PATH, or reopen your terminal.

macOS: "command not found: node" (after install)

Node.js installed via Homebrew may need linking:

brew link --overwrite node@22

Or reopen your terminal window.

Port 18789 already in use

Change the port:

GATEWAY_PORT=28789 curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-openclaw/main/install.sh | bash

Or edit gateway.port in ~/.openclaw/openclaw.json.

How to uninstall?
# Stop the service
# Linux:
systemctl --user stop openclaw && systemctl --user disable openclaw

# macOS:
launchctl stop com.crazyrouter.openclaw
rm ~/Library/LaunchAgents/com.crazyrouter.openclaw.plist

# Remove data and config
rm -rf ~/.openclaw

# Uninstall npm package
npm uninstall -g openclaw

Supported IM Platforms

  • Telegram (interactive setup during install)
  • Discord
  • Slack
  • Feishu (Lark)
  • DingTalk
  • WeCom (WeChat Work)
  • QQ Bot

System Requirements

  • Linux (x64/arm64) or macOS (x64/arm64)
  • 1-2 GB RAM
  • Internet access
  • Crazyrouter API Key

License

MIT

Links

About

Crazyrouter OpenClaw one-click deploy

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages