> ## Documentation Index
> Fetch the complete documentation index at: https://api-doc.vncps.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Openclaw

# OpenClaw 飞书机器人安装配置指南

## 一、前置准备

在开始配置之前，请确保您已经：

* 拥有飞书账号
* 具备创建自建应用的权限
* 准备好模型API密钥（在API平台中获取）

## 二、参考配置

以下是完整的配置文件参考，**需要用户配置的部分已用尖括号标记**：

```json theme={null}
{
  "meta": {
    "lastTouchedVersion": "2026.3.2",
    "lastTouchedAt": "2026-03-06T02:08:13.983Z"
  },
  "wizard": {
    "lastRunAt": "2026-03-05T10:05:16.085Z",
    "lastRunVersion": "2026.3.2",
    "lastRunCommand": "onboard",
    "lastRunMode": "local"
  },
  "models": {
    "providers": {
      "seed": {
        "baseUrl": "https://api.cozex.cn/v1",
        "apiKey": "<your_key>",
        "api": "openai-completions",
        "models": [
          {
            "id": "<model_name>",
            "name": "<model_name>",
            "reasoning": false,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 200000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "seed/<model_name>"
      },
      "workspace": "~/.openclaw/workspace",
      "compaction": {
        "mode": "safeguard"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    }
  },
  "tools": {
    "profile": "messaging"
  },
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "restart": true,
    "ownerDisplay": "raw"
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "hooks": {
    "internal": {
      "enabled": true,
      "entries": {
        "boot-md": { "enabled": true },
        "bootstrap-extra-files": { "enabled": true },
        "command-logger": { "enabled": true },
        "session-memory": { "enabled": true }
      }
    }
  },
  "channels": {
    "feishu": {
      "accounts": {
        "default": {
          "appId": "<APP ID>",
          "appSecret": "<APP Secret>",
          "enabled": true
        }
      }
    }
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "lan",
    "controlUi": {
      "allowedOrigins": [
        "http://localhost:18789",
        "http://127.0.0.1:18789"
      ]
    },
    "auth": {
      "mode": "token",
      "token": "<auth_token>"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    },
    "nodes": {
      "denyCommands": [
        "camera.snap",
        "camera.clip",
        "screen.record",
        "contacts.add",
        "calendar.add",
        "reminders.add",
        "sms.send"
      ]
    }
  },
  "plugins": {
    "entries": {
      "feishu": { "enabled": true }
    }
  }
}
```

### 需要用户配置的部分（用尖括号标记）：

1. **模型配置**：
   * `apiKey`: 填写您的 API 密钥
   * `id`: 填写模型 ID
   * `name`: 填写模型名称
   * `primary`: 填写主要模型，格式为 `provider/model-id`

2. **飞书应用配置**：
   * `appId`: 填写飞书应用的 App ID
   * `appSecret`: 填写飞书应用的 App Secret

3. **网关配置**：
   * `token`: 填写授权 token

## 三、配置步骤

### 步骤1：进入飞书工作台

1. 打开飞书客户端，点击左侧导航栏中的「工作台」
2. 在工作台页面，找到右上角"创建应用"按钮,点击会跳转到浏览器(可能需要登录飞书账号)

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/1%E5%88%9B%E5%BB%BA%E5%BA%94%E7%94%A8.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=c32839b79cd4a6b0e658ccc266b035b7" alt="飞书工作台" width="1396" height="701" data-path="openclaw/images/1创建应用.png" />

### 步骤2：进入开发者后台

1. 在开发者平台首页，点击右上角的「开发者后台」按钮

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/2%E5%BC%80%E6%94%BE%E5%90%8E%E5%8F%B0%E5%85%A5%E5%8F%A3.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=6c5e19adb093717fbe53dbbb20fc29c0" alt="开发者后台" width="915" height="537" data-path="openclaw/images/2开放后台入口.png" />

### 步骤3：创建企业自建应用

1. 在飞书开放平台页面，点击「企业自建应用」选项卡
2. 点击「创建企业自建应用」按钮
3. 填写应用名称（如 "openclaw"）和相关信息

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/3%E5%88%9B%E5%BB%BA%E5%BA%94%E7%94%A8.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=404b1b0742035324c5caf0b249ebb516" alt="创建应用" width="2084" height="501" data-path="openclaw/images/3创建应用.png" />

### 步骤4：添加机器人能力

1. 在应用管理页面，点击左侧导航栏中的「添加应用能力」
2. 在右侧页面中，选择「机器人」能力
3. 点击「+ 添加」按钮，为应用添加机器人能力

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/4%E6%B7%BB%E5%8A%A0%E6%9C%BA%E5%99%A8%E4%BA%BA.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=0f085a7a4d38a04df7d3f40105e47ca3" alt="添加机器人" width="1017" height="827" data-path="openclaw/images/4添加机器人.png" />

### 步骤5：配置权限

1. 在左侧导航栏中，点击「权限管理」
2. 在右侧页面中，点击「批量导入/导出权限」按钮

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/5%E5%BC%80%E9%80%9A%E6%9D%83%E9%99%90.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=e562b31bc124604dbd1aa0ec5e73c5ac" alt="权限管理" width="945" height="664" data-path="openclaw/images/5开通权限.png" />

3. 在「批量导入/导出权限」弹窗中，选择「导入」选项卡
4. 将以下权限配置复制到JSON输入框中：

```json theme={null}
{
  "scopes": {
    "tenant": [
      "application:application.app_message_stats.overview:readonly",
      "application:application:self_manage",
      "application:bot.menu:write",
      "cardkit:card:write",
      "contact:contact.base:readonly",
      "contact:user.employee_id:readonly",
      "docs:document.content:read",
      "docs:permission.member:create",
      "docs:permission.member:delete",
      "docs:permission.member:retrieve",
      "docx:document.block:convert",
      "docx:document:create",
      "docx:document:readonly",
      "docx:document:write_only",
      "event:ip_list",
      "im:chat.access_event.bot_p2p_chat:read",
      "im:chat.members:bot_access",
      "im:chat:read",
      "im:chat:update",
      "im:message.group_at_msg:readonly",
      "im:message.p2p_msg:readonly",
      "im:message.pins:read",
      "im:message.pins:write_only",
      "im:message.reactions:read",
      "im:message.reactions:write_only",
      "im:message:readonly",
      "im:message:recall",
      "im:message:send_as_bot",
      "im:message:send_multi_users",
      "im:message:send_sys_msg",
      "im:message:update",
      "im:resource",
      "task:task:readonly",
      "task:task:write",
      "wiki:wiki:readonly"
    ],
    "user": [
      "contact:contact.base:readonly",
      "contact:user.employee_id:readonly",
      "im:chat.access_event.bot_p2p_chat:read"
    ]
  }
}
```

5. 点击「下一步，确认新增权限」按钮

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/6%E6%9B%BF%E6%8D%A2%E8%A7%84%E5%88%99.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=374eff7db8defa43f0374c350da130c7" alt="批量导入权限" width="1304" height="1859" data-path="openclaw/images/6替换规则.png" />

6. 在「确认导入权限」页面，检查权限列表是否正确
7. 点击「申请开通」按钮

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/7%E7%94%B3%E8%AF%B7%E5%BC%80%E9%80%9A.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=4591bef8f7c5cb7ad9749eab6e247cd4" alt="申请开通权限" width="1284" height="973" data-path="openclaw/images/7申请开通.png" />

8. 在权限开通确认页面，点击「确认」按钮完成权限开通

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/8%E7%A1%AE%E8%AE%A4%E5%BC%80%E9%80%9A.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=c7545d219e41d54ec4628295504b11fa" alt="确认开通权限" width="1358" height="1953" data-path="openclaw/images/8确认开通.png" />

### 步骤6：获取应用凭证

1. 在左侧导航栏中，点击「凭证与基础信息」
2. 在「应用凭证」部分，复制「App ID」和「App Secret」
3. 这些信息将用于 OpenClaw 配置文件中

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/11%E8%8E%B7%E5%8F%96%E5%BA%94%E7%94%A8%E5%87%AD%E8%AF%81.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=4b5b0919b6aec0233b3d308f6271072f" alt="获取应用凭证" width="2294" height="347" data-path="openclaw/images/11获取应用凭证.png" />

### 步骤7：创建版本

1. 在左侧导航栏中，点击「版本管理与发布」
2. 点击「创建版本」按钮
3. 在「版本详情」页面中：
   * 填写应用版本号（如 "1.0.0"）
   * 选择移动端和桌面端的默认能力为「机器人」
   * 填写更新说明
4. 点击「保存」按钮

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/9%E5%88%9B%E5%BB%BA%E7%89%88%E6%9C%AC.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=1e9869778e492d406b881b6935ec98f7" alt="创建版本" width="1667" height="1817" data-path="openclaw/images/9创建版本.png" />

### 步骤8：发布应用

1. 在版本管理页面，点击「提交发布」按钮
2. 在「确认提交发布申请」弹窗中，点击「确认发布」按钮
3. 等待发布完成（本次发布免审，提交后自动通过并在线上生效）

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/10%E7%A1%AE%E8%AE%A4%E5%8F%91%E5%B8%83.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=6ac7aa8bcd09fcd82b23d789ab68365b" alt="确认发布" width="661" height="243" data-path="openclaw/images/10确认发布.png" />

### 步骤9：配置 OpenClaw

1. 在服务器中编辑 OpenClaw 配置文件,示例为debian 12,路径一般在"\~/.openclaw/openclaw\.json"

2. **配置模型**：在 `models.providers` 部分，添加或修改模型配置：
   * `baseUrl`：填写 API 服务地址（如 `https://api.cozex.cn/v1`）
   * `apiKey`：**填写您的 API 密钥**（替换 `<your_key>`）
   * `api`：填写 API 类型（如 `openai-completions`）
   * `models`：填写模型列表，包括：
     * `id`：**填写模型 ID**（替换 `<model_name>`）
     * `name`：**填写模型名称**（替换 `<model_name>`）
     * `reasoning`：填写是否启用推理（如 `false`）
     * `input`：填写输入类型（如 `["text"]`）
     * `cost`：填写成本配置
     * `contextWindow`：填写上下文窗口大小
     * `maxTokens`：填写最大 tokens 数

3. **配置飞书应用**：在 `channels.feishu.accounts.default` 部分，填入之前获取的信息：
   * `appId`：填写飞书应用的 App ID
   * `appSecret`：填写飞书应用的 App Secret
   * `enabled`：设置为 `true`

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/12%E6%8F%92%E5%85%A5%E6%A8%A1%E5%9E%8B%E9%85%8D%E7%BD%AE.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=3019b382a08e843c9af754bb20916432" alt="插入模型配置" width="824" height="918" data-path="openclaw/images/12插入模型配置.png" />

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/14%E9%85%8D%E7%BD%AE%E9%A3%9E%E4%B9%A6%E5%BA%94%E7%94%A8.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=5819d538f79236c02555c40f0de64c7c" alt="配置飞书应用" width="745" height="372" data-path="openclaw/images/14配置飞书应用.png" />

#### 参考配置

```json theme={null}
{
  "meta": {
    "lastTouchedVersion": "2026.3.2",
    "lastTouchedAt": "2026-03-06T02:08:13.983Z"
  },
  "wizard": {
    "lastRunAt": "2026-03-05T10:05:16.085Z",
    "lastRunVersion": "2026.3.2",
    "lastRunCommand": "onboard",
    "lastRunMode": "local"
  },
  "models": {
    "providers": {
      "seed": {
        "baseUrl": "https://api.cozex.cn/v1",
        "apiKey": "<your_key>",
        "api": "openai-completions",
        "models": [
          {
            "id": "<model_name>",
            "name": "<model_name>",
            "reasoning": false,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 200000,
            "maxTokens": 8192
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "seed/<model_name>"
      },
      "workspace": "~/.openclaw/workspace",
      "compaction": {
        "mode": "safeguard"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    }
  },
  "tools": {
    "profile": "messaging"
  },
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "restart": true,
    "ownerDisplay": "raw"
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "hooks": {
    "internal": {
      "enabled": true,
      "entries": {
        "boot-md": { "enabled": true },
        "bootstrap-extra-files": { "enabled": true },
        "command-logger": { "enabled": true },
        "session-memory": { "enabled": true }
      }
    }
  },
  "channels": {
    "feishu": {
      "accounts": {
        "default": {
          "appId": "<APP ID>",
          "appSecret": "<APP Secret>",
          "enabled": true
        }
      }
    }
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "lan",
    "controlUi": {
      "allowedOrigins": [
        "http://localhost:18789",
        "http://127.0.0.1:18789"
      ]
    },
    "auth": {
      "mode": "token",
      "token": "<auth_token>"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    },
    "nodes": {
      "denyCommands": [
        "camera.snap",
        "camera.clip",
        "screen.record",
        "contacts.add",
        "calendar.add",
        "reminders.add",
        "sms.send"
      ]
    }
  },
  "plugins": {
    "entries": {
      "feishu": { "enabled": true }
    }
  }
}
```

### 步骤10：配置事件

1. 在开发者后台，点击左侧导航栏中的「事件与回调」
2. 在「事件配置」选项卡中，选择「使用长连接接收事件」
3. 点击「保存」按钮

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/15%E4%BA%8B%E4%BB%B6%E9%85%8D%E7%BD%AE.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=054b1f00b452236ffabc7094dcf271eb" alt="事件配置" width="1796" height="674" data-path="openclaw/images/15事件配置.png" />

### 步骤11：开通群聊权限（可选）

1. 在开发者后台，根据需要开通群聊相关权限
2. 这一步骤是可选的，根据您的实际需求进行配置

!\[开通群聊权限]\(images/16开通群聊权限(可选.png)

### 步骤12：配置回调

1. 在「事件与回调」页面，点击「回调配置」选项卡
2. 配置回调地址和相关参数
3. 点击「保存」按钮

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/17%E9%85%8D%E7%BD%AE%E5%9B%9E%E8%B0%83.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=8ee3019d4a8d0855ec78f32a94696c89" alt="配置回调" width="1718" height="711" data-path="openclaw/images/17配置回调.png" />

### 步骤13：添加事件

1. 在「事件与回调」页面，根据需要添加相关事件
2. 选择您需要订阅的事件类型
3. 点击「保存」按钮

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/18%E6%B7%BB%E5%8A%A0%E4%BA%8B%E4%BB%B6.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=7f237b5085e41c8833327a3fc8d0472a" alt="添加事件" width="3350" height="1227" data-path="openclaw/images/18添加事件.png" />

### 步骤14：获取授权命令

1. 回到飞书客户端的工作台,找到刚才创建的机器人,随便跟机器人说个话,他会自动回复授权命令
2. 复制授权命令，用于后续的机器人授权

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/19%E8%8E%B7%E5%8F%96%E6%8E%88%E6%9D%83%E5%91%BD%E4%BB%A4.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=55268dc897a721afefbd1f966f0aaa65" alt="获取授权命令" width="802" height="497" data-path="openclaw/images/19获取授权命令.png" />

### 步骤15：授权机器人

1. 复制获取的授权命令，在云服务器上运行
2. 完成授权后，机器人即可正常使用

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/20%E6%8E%88%E6%9D%83%E6%9C%BA%E5%99%A8%E4%BA%BA.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=7f7764da7b7c0b375082f6bd61619cd1" alt="授权机器人" width="1307" height="224" data-path="openclaw/images/20授权机器人.png" />

### 步骤16：配置完成

1. 授权完成后，机器人将开始正常工作
2. 您可以在飞书中与机器人进行对话，测试其功能

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/21%E9%85%8D%E7%BD%AE%E5%AE%8C%E6%88%90.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=2b03ae4f0bc51002ff9e32136065e404" alt="配置完成" width="938" height="661" data-path="openclaw/images/21配置完成.png" />

### 步骤17：重新发布（如需）

1. 如果您对应用进行了修改，需要重新发布
2. 在开发者后台，点击「创建版本」按钮
3. 填写版本信息并提交发布

<img src="https://mintcdn.com/shihuo/iTInqba4QXgNIALS/openclaw/images/22%E9%87%8D%E6%96%B0%E5%8F%91%E5%B8%83.png?fit=max&auto=format&n=iTInqba4QXgNIALS&q=85&s=bea9e50823db0c64247558dcfb230e48" alt="重新发布" width="902" height="113" data-path="openclaw/images/22重新发布.png" />
