# 🦞 ClawdBot 一键部署工具

*





🚀 一键部署你的私人 AI 助手 ClawdBot，支持多平台多模型配置*

By [链求君精选推荐](https://paragraph.com/@acc) · 2026-01-30

---

🔗 [https://github.com/miaoxworld/ClawdBotInstaller](https://github.com/miaoxworld/ClawdBotInstaller)

  

📖 **目录**
---------

*   [功能特性](https://github.com/miaoxworld/ClawdBotInstaller?tab=readme-ov-file#-%E5%8A%9F%E8%83%BD%E7%89%B9%E6%80%A7)
    
*   [系统要求](https://github.com/miaoxworld/ClawdBotInstaller?tab=readme-ov-file#-%E7%B3%BB%E7%BB%9F%E8%A6%81%E6%B1%82)
    
*   [快速开始](https://github.com/miaoxworld/ClawdBotInstaller?tab=readme-ov-file#-%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)
    
*   [详细配置](https://github.com/miaoxworld/ClawdBotInstaller?tab=readme-ov-file#-%E8%AF%A6%E7%BB%86%E9%85%8D%E7%BD%AE)
    
*   [常用命令](https://github.com/miaoxworld/ClawdBotInstaller?tab=readme-ov-file#-%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4)
    
*   [配置说明](https://github.com/miaoxworld/ClawdBotInstaller?tab=readme-ov-file#-%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E)
    
*   [安全建议](https://github.com/miaoxworld/ClawdBotInstaller?tab=readme-ov-file#-%E5%AE%89%E5%85%A8%E5%BB%BA%E8%AE%AE)
    
*   [常见问题](https://github.com/miaoxworld/ClawdBotInstaller?tab=readme-ov-file#-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)
    
*   [更新日志](https://github.com/miaoxworld/ClawdBotInstaller?tab=readme-ov-file#-%E6%9B%B4%E6%96%B0%E6%97%A5%E5%BF%97)
    

✨ **功能特性**
----------

### 🤖 **多模型支持**

  

**主流服务商:**

*   **Anthropic Claude** - Claude Opus 4 / Sonnet 4 / Haiku _(支持自定义 API 地址)_
    
*   **OpenAI GPT** - GPT-4o / GPT-4 Turbo / o1 _(支持自定义 API 地址)_
    
*   **Google Gemini** - Gemini 2.0 Flash / 1.5 Pro
    
*   **xAI Grok** - Grok 4 / Grok 3 / Grok 2 Vision _(Elon Musk 的 AI)_
    

**多模型网关:**

*   **OpenRouter** - 多模型网关，一个 Key 用遍所有模型
    
*   **OpenCode** - 免费多模型 API，支持 Claude/GPT/Gemini/GLM
    

**快速推理:**

*   **Groq** - 超快推理，Llama 3.3 / Mixtral
    
*   **Mistral AI** - Mistral Large / Codestral
    

**本地/企业:**

*   **Ollama** - 本地部署，无需 API Key
    
*   **Azure OpenAI** - 企业级 Azure 部署
    

**国产模型:**

*   **智谱 GLM (Zai)** - GLM-4.7 / GLM-4.6 _(中国领先 AI)_
    
*   **MiniMax** - MiniMax-M2 系列 _(支持国内/国际版)_
    

**实验性:**

*   **Google Gemini CLI** - Gemini 3 预览版
    
*   **Google Antigravity** - Google 实验性多模型 API
    

> 💡 **自定义 API 地址**: Anthropic Claude 和 OpenAI GPT 都支持自定义 API 地址，可接入 OneAPI/NewAPI/API 代理等服务。配置时先输入自定义地址，再输入 API Key。

### 📱 **多渠道接入**

  

*   Telegram Bot
    
*   Discord Bot
    
*   WhatsApp
    
*   Slack
    
*   微信 (WeChat)
    
*   iMessage (仅 macOS)
    
*   飞书 (Feishu)
    

### 🧪 **快速测试**

  

*   API 连接测试
    
*   渠道连接验证
    
*   ClawdBot 诊断工具
    

### 🧠 **核心能力**

*   **持久记忆** - 跨对话、跨平台的长期记忆
    
*   **主动推送** - 定时提醒、晨报、告警通知
    
*   **技能系统** - 通过 Markdown 文件定义自定义能力
    
*   **远程控制** - 可执行系统命令、读写文件、浏览网络
    

💻 **系统要求**
-----------

**项目**

**要求**

操作系统

macOS 12+ / Ubuntu 20.04+ / Debian 11+ / CentOS 8+

Node.js

v22 或更高版本

内存

最低 2GB，推荐 4GB+

磁盘空间

最低 1GB

🚀 **快速开始**
-----------

### **方式一：一键安装（推荐）**

    # 下载并运行安装脚本
    curl -fsSL https://raw.githubusercontent.com/miaoxworld/ClawdBotInstaller/main/install.sh | bash

安装脚本会自动：

1.  检测系统环境并安装依赖
    
2.  安装 ClawdBot
    
3.  引导完成核心配置（AI模型、身份信息）
    
4.  测试 API 连接
    
5.  **自动启动 ClawdBot 服务**
    
6.  可选打开配置菜单进行详细配置（渠道等）
    

### **方式二：手动安装**

    # 1. 克隆仓库
    git clone https://github.com/miaoxworld/ClawdBotInstaller.git
    cd ClawdBotInstaller
    
    # 2. 添加执行权限
    chmod +x install.sh config-menu.sh
    
    # 3. 运行安装脚本
    ./install.sh

### **安装完成后**

安装完成后脚本会：

1.  **自动询问是否启动服务**（推荐选择 Y）
    
2.  后台启动 ClawdBot Gateway
    
3.  可选打开配置菜单进行渠道配置
    

如果需要后续管理：

    # 手动启动服务
    source ~/.clawdbot/env && clawdbot gateway
    
    # 后台启动服务
    clawdbot gateway start
    
    # 运行配置菜单进行详细配置
    bash ~/.clawdbot/config-menu.sh
    
    # 或从 GitHub 下载运行
    curl -fsSL https://raw.githubusercontent.com/miaoxworld/ClawdBotInstaller/main/config-menu.sh | bash

⚙ **详细配置**
----------

### **配置 AI 模型**

运行配置菜单后选择 `[2] AI 模型配置`，可选择多种 AI 提供商：

  

#### **Anthropic Claude 配置**

1.  在配置菜单中选择 Anthropic Claude
    
2.  **先输入自定义 API 地址**（留空使用官方 API）
    
3.  输入 API Key（官方 Key 从 [Anthropic Console](https://console.anthropic.com/) 获取）
    
4.  选择模型（推荐 Sonnet 4）
    

> 💡 支持 OneAPI/NewAPI 等第三方代理服务，只需填入对应的 API 地址和 Key

#### **OpenAI GPT 配置**

1.  在配置菜单中选择 OpenAI GPT
    
2.  **先输入自定义 API 地址**（留空使用官方 API）
    
3.  输入 API Key（官方 Key 从 [OpenAI Platform](https://platform.openai.com/) 获取）
    
4.  选择模型
    

#### **Ollama 本地模型**

    # 1. 安装 Ollama
    curl -fsSL https://ollama.ai/install.sh | sh
    
    # 2. 下载模型
    ollama pull llama3
    
    # 3. 在配置菜单中选择 Ollama
    # 输入服务地址：http://localhost:11434

#### **Groq (超快推理)**

1.  访问 [Groq Console](https://console.groq.com/) 获取 API Key
    
2.  在配置菜单中选择 Groq
    
3.  输入 API Key
    
4.  选择模型（推荐 llama-3.3-70b-versatile）
    

#### **Google Gemini**

1.  访问 [Google AI Studio](https://makersuite.google.com/app/apikey) 获取 API Key
    
2.  在配置菜单中选择 Google Gemini
    
3.  输入 API Key
    
4.  选择模型（推荐 gemini-2.0-flash）
    

### **配置 Telegram 机器人**

1.  在 Telegram 中搜索 `@BotFather`
    
2.  发送 `/newbot` 创建新机器人
    
3.  设置机器人名称和用户名
    
4.  复制获得的 **Bot Token**
    
5.  搜索 `@userinfobot` 获取你的 **User ID**
    
6.  在配置菜单中选择 Telegram，输入以上信息
    

### **配置 Discord 机器人**

1.  访问 [Discord Developer Portal](https://discord.com/developers/applications)
    
2.  点击 "New Application" 创建应用
    
3.  进入 "Bot" 页面，点击 "Add Bot"
    
4.  复制 **Bot Token**
    
5.  在 "OAuth2" → "URL Generator" 中生成邀请链接
    
6.  邀请机器人到你的服务器
    
7.  获取目标频道的 **Channel ID**（右键频道 → 复制 ID）
    
8.  在配置菜单中输入以上信息
    

### **配置飞书机器人**

1.  访问 [飞书开放平台](https://open.feishu.cn/)
    
2.  创建企业自建应用，选择"机器人"能力
    
3.  获取 **App ID** 和 **App Secret**
    
4.  在"权限管理"中添加权限：
    
    *   `im:message.receive_v1` (接收消息)
        
    *   `im:message:send_as_bot` (发送消息)
        
    *   `im:chat:readonly` (读取会话信息)
        
5.  配置"事件订阅"：
    
    *   请求地址：`https://你的服务器:18789/channels/feishu/webhook`
        
    *   添加事件：`im.message.receive_v1`
        
6.  发布应用并添加到群组
    
7.  在配置菜单中选择飞书，输入以上信息
    

📝 **常用命令**
-----------

### **服务管理**

    # 启动服务（后台守护进程）
    clawdbot gateway start
    
    # 停止服务
    clawdbot gateway stop
    
    # 重启服务
    clawdbot gateway restart
    
    # 查看服务状态
    clawdbot gateway status
    
    # 前台运行（用于调试）
    clawdbot gateway
    
    # 查看日志
    clawdbot logs
    
    # 实时日志
    clawdbot logs --follow

### **配置管理**

    # 打开配置文件
    clawdbot config
    
    # 运行配置向导
    clawdbot onboard
    
    # 诊断配置问题
    clawdbot doctor
    
    # 健康检查
    clawdbot health

### **数据管理**

    # 导出对话历史
    clawdbot export --format json
    
    # 清理记忆
    clawdbot memory clear
    
    # 备份数据
    clawdbot backup

📋 **配置说明**
-----------

ClawdBot 使用以下配置方式：

*   **环境变量**: `~/.clawdbot/env` - 存储 API Key 和 Base URL
    
*   **ClawdBot 配置**: `~/.clawdbot/clawdbot.json` - ClawdBot 内部配置（自动管理）
    
*   **命令行工具**: `clawdbot config set` / `clawdbot models set` 等
    

> 💡 **注意**：配置主要通过安装向导或 `config-menu.sh` 完成，无需手动编辑配置文件

### **环境变量配置示例**

`~/.clawdbot/env` 文件内容：

    # ClawdBot 环境变量配置
    export ANTHROPIC_API_KEY=sk-ant-xxxxx
    export ANTHROPIC_BASE_URL=https://your-api-proxy.com  # 可选，自定义 API 地址
    
    # 或者 OpenAI
    export OPENAI_API_KEY=sk-xxxxx
    export OPENAI_BASE_URL=https://your-api-proxy.com/v1  # 可选

### **自定义 Provider 配置**

当使用自定义 API 地址时，安装脚本会自动在 `~/.clawdbot/clawdbot.json` 中配置自定义 Provider：

    {
      "models": {
        "providers": {
          "anthropic-custom": {
            "baseUrl": "https://your-api-proxy.com",
            "apiKey": "your-api-key",
            "models": [
              {
                "id": "claude-sonnet-4-5-20250929",
                "name": "claude-sonnet-4-5-20250929",
                "api": "anthropic-messages",
                "input": ["text"],
                "contextWindow": 200000,
                "maxTokens": 8192
              }
            ]
          }
        }
      }
    }

### **目录结构**

    ~/.clawdbot/
    ├── clawdbot.json        # ClawdBot 核心配置
    ├── env                  # 环境变量 (API Key 等)
    ├── backups/             # 配置备份
    └── logs/                # 日志文件 (由 ClawdBot 管理)
    

**🛡️ 安全建议**
------------

> ⚠ **重要警告**：ClawdBot 需要完全的计算机权限，请务必注意安全！

### **部署建议**

1.  **不要在主工作电脑上部署** - 建议使用专用服务器或虚拟机
    
2.  **使用 AWS/GCP/Azure 免费实例** - 隔离环境更安全
    
3.  **Docker 部署** - 提供额外的隔离层
    

### **权限控制**

1.  **禁用危险功能**（默认已禁用）
    
        security:
          enable_shell_commands: false
          enable_file_access: false
    
2.  **启用沙箱模式**
    
        security:
          sandbox_mode: true
    
3.  **限制允许的用户**
    
        channels:
          telegram:
            allowed_users:
              - "only-your-user-id"
    

### **API Key 安全**

*   定期轮换 API Key
    
*   不要在公开仓库中提交配置文件
    
*   使用环境变量存储敏感信息
    

    # 使用环境变量
    export ANTHROPIC_API_KEY="sk-ant-xxx"
    export TELEGRAM_BOT_TOKEN="xxx"

**❓ 常见问题**
----------

### **Q: 安装时提示 Node.js 版本过低？**

    # macOS
    brew install node@22
    brew link --overwrite node@22
    
    # Ubuntu/Debian
    curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
    sudo apt-get install -y nodejs

### **Q: 启动后无法连接？**

1.  检查配置文件是否正确
    
2.  运行诊断命令：`clawdbot doctor`
    
3.  查看日志：`clawdbot logs`
    

### **Q: Telegram 机器人没有响应？**

1.  确认 Bot Token 正确
    
2.  确认 User ID 在 allowed\_users 列表中
    
3.  检查网络连接（可能需要代理）
    

### **Q: 如何更新到最新版本？**

    # 使用 npm 更新
    npm update -g clawdbot
    
    # 或使用配置菜单
    ./config-menu.sh
    # 选择 [7] 高级设置 → [7] 更新 ClawdBot

### **Q: 如何备份数据？**

    # 手动备份
    cp -r ~/.clawdbot ~/clawdbot_backup_$(date +%Y%m%d)
    
    # 使用命令备份
    clawdbot backup

### **Q: 如何完全卸载？**

    # 停止服务
    clawdbot gateway stop
    
    # 卸载程序
    npm uninstall -g clawdbot
    
    # 删除配置（可选）
    rm -rf ~/.clawdbot

**📜 更新日志**
-----------

### **v1.0.0 (2026-01-29)**

*   🎉 首次发布
    
*   ✨ 支持一键安装部署
    
*   ✨ 交互式配置菜单
    
*   ✨ 多模型支持 (Claude/GPT/Ollama)
    
*   ✨ 多渠道支持 (Telegram/Discord/WhatsApp)
    
*   ✨ 技能系统
    
*   ✨ 安全配置

---

*Originally published on [链求君精选推荐](https://paragraph.com/@acc/clawbot-depoly)*
