OpenClaw × 飞书:保姆级接入指南

OpenClaw × 飞书:保姆级接入指南

文章目录

OpenClaw × 飞书:保姆级接入指南

通过命令行快速将 OpenClaw 智能 Agent 接入飞书,实现企业级 AI 助手部署。

为什么选择命令行配置?

相比图形化向导,命令行配置更适合:

  • 🖥️ 服务器环境 — 无桌面环境的 Linux 服务器部署
  • 🔄 自动化脚本 — 集成到 CI/CD 或配置管理工具
  • 批量操作 — 快速配置多个账号或环境

前置准备

在开始之前,确保你已经:

  1. 安装 OpenClaw(如未安装可参考:在 Ubuntu 上快速部署 OpenClaw 完整教程
  2. 拥有一个飞书企业账号(或 Lark 国际版账号)
  3. 具备创建企业自建应用的权限

一、创建飞书应用

1.1 登录飞书开放平台

访问 飞书开放平台(国际版用户请使用 Lark Open Platform)。

1.2 创建企业自建应用

点击「创建企业自建应用」,填写应用名称和描述,上传应用图标。

在这里插入图片描述


在这里插入图片描述

1.3 获取应用凭证

进入「凭证与基础信息」页面,复制以下关键信息:

  • App ID(格式如 cli_xxx
  • App Secret(⚠️ 请妥善保管,切勿泄露)
在这里插入图片描述

1.4 一键导入权限配置

在「权限管理」页面,点击「批量导入」,粘贴以下 JSON 配置(注:为了方便测试,本次开放权限比较多,请按需适当减少):

{"scopes":{"tenant":["aily:file:read","aily:file:write","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","corehr:file:download","docs:document.content:read","event:ip_list","im:app_feed_card:write","im:biz_entity_tag_relation:read","im:biz_entity_tag_relation:write","im:chat","im:chat.access_event.bot_p2p_chat:read","im:chat.announcement:read","im:chat.announcement:write_only","im:chat.chat_pins:read","im:chat.chat_pins:write_only","im:chat.collab_plugins:read","im:chat.collab_plugins:write_only","im:chat.managers:write_only","im:chat.members:bot_access","im:chat.members:read","im:chat.members:write_only","im:chat.menu_tree:read","im:chat.menu_tree:write_only","im:chat.moderation:read","im:chat.tabs:read","im:chat.tabs:write_only","im:chat.top_notice:write_only","im:chat.widgets:read","im:chat.widgets:write_only","im:chat:create","im:chat:delete","im:chat:moderation:write_only","im:chat:operate_as_owner","im:chat:read","im:chat:readonly","im:chat:update","im:datasync.feed_card.time_sensitive:write","im:message","im:message.group_at_msg:readonly","im:message.group_msg","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.urgent","im:message.urgent.status:write","im:message.urgent:phone","im:message.urgent:sms","im:message:readonly","im:message:recall","im:message:send_as_bot","im:message:send_multi_depts","im:message:send_multi_users","im:message:send_sys_msg","im:message:update","im:resource","im:tag:read","im:tag:write","im:url_preview.update","im:user_agent:read","sheets:spreadsheet","wiki:wiki:readonly"],"user":["aily:file:read","aily:file:write","contact:contact.base:readonly","im:chat.access_event.bot_p2p_chat:read"]}}
在这里插入图片描述

1.5 启用机器人能力

进入「应用能力」→「机器人」页面,开启机器人能力并配置名称。

在这里插入图片描述

1.6 命令行配置 OpenClaw

1.6.1.安装飞书插件

openclaw plugins install @openclaw/feishu 
ubuntu@gt-ubuntu22-04-cmd-v3-0-8gb-100m:~$ openclaw plugins install @openclaw/feishu 🦞 OpenClaw 2026.2.26 (bc50708) — Your config is valid, your assumptions are not. Downloading @openclaw/feishu… Extracting /tmp/openclaw-npm-pack-J3n6oT/openclaw-feishu-2026.2.25.tgz… Installing to /home/ubuntu/.openclaw/extensions/feishu… Installing plugin dependencies… 08:42:12 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/ubuntu/.openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids. Config warnings: - plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/home/ubuntu/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts) Config overwrite: /home/ubuntu/.openclaw/openclaw.json (sha256 39d81e12fa7ac493441f7da59893d51ca3f831c15cdb6835505a76b040fc7cf7 -> 0923c52a525f0cb1b39d00380aca43194d148754cbc27324d03c9c97a915169b, backup=/home/ubuntu/.openclaw/openclaw.json.bak) Installed plugin: feishu Restart the gateway to load plugins. 
1.6.2 添加飞书渠道

运行以下命令,根据交互式提示完成配置:

openclaw channels add

操作步骤:

  1. 选择渠道类型:Feishu
  2. 输入 App ID(如 cli_xxx
  3. 输入 App Secret
  4. 确认配置完成
 ubuntu@gt-ubuntu22-04-cmd-v3-0-8gb-100m:~$ openclaw channels add Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/home/ubuntu/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts) 🦞 OpenClaw 2026.2.26 (bc50708) — Your inbox, your infra, your rules. │ ◇ Config warnings ─────────────────────────────────────────────────────────────────────────╮ │ │ │ - plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may │ │ be overridden │ │ (/home/ubuntu/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts) │ │ │ ├───────────────────────────────────────────────────────────────────────────────────────────╯ Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/home/ubuntu/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts) 08:44:00 [plugins] plugins.allow is empty; discovered non-bundled plugins may auto-load: feishu (/home/ubuntu/.openclaw/extensions/feishu/index.ts). Set plugins.allow to explicit trusted ids. Config warnings:\n- plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/home/ubuntu/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts) ┌ Channel setup │ ◇ Channel status ────────────────────────────╮ │ │ │ Telegram: needs token │ │ WhatsApp (default): not linked │ │ Discord: needs token │ │ Slack: needs tokens │ │ Signal: needs setup │ │ signal-cli: missing (signal-cli) │ │ iMessage: needs setup │ │ imsg: missing (imsg) │ │ Feishu: needs app credentials │ │ IRC: not configured │ │ Google Chat: not configured │ │ Google Chat: install plugin to enable │ │ Nostr: install plugin to enable │ │ Microsoft Teams: install plugin to enable │ │ Mattermost: install plugin to enable │ │ Nextcloud Talk: install plugin to enable │ │ Matrix: install plugin to enable │ │ BlueBubbles: install plugin to enable │ │ LINE: install plugin to enable │ │ Zalo: install plugin to enable │ │ Zalo Personal: install plugin to enable │ │ Synology Chat: install plugin to enable │ │ Tlon: install plugin to enable │ │ │ ├─────────────────────────────────────────────╯ │ ◇ Configure chat channels now? │ Yes │ ◇ How channels work ───────────────────────────────────────────────────────────────────────╮ │ │ │ DM security: default is pairing; unknown DMs get a pairing code. │ │ Approve with: openclaw pairing approve <channel><code> │ │ Public DMs require dmPolicy="open" + allowFrom=["*"]. │ │ Multi-user DMs: run: openclaw config set session.dmScope "per-channel-peer"(or │ │ "per-account-channel-peer"for multi-account channels) to isolate sessions. │ │ Docs: channels/pairing │ │ │ │ Telegram: simplest way to get started — register a bot with @BotFather and get going. │ │ WhatsApp: works with your own number; recommend a separate phone + eSIM. │ │ Discord: very well supported right now. │ │ IRC: classic IRC networks with DM/channel routing and pairing controls. │ │ Google Chat: Google Workspace Chat app with HTTP webhook. │ │ Slack: supported (Socket Mode). │ │ Signal: signal-cli linked device;more setup (David Reagans: "Hop on Discord."). │ │ iMessage: this is still a work in progress. │ │ Feishu: 飞书/Lark enterprise messaging. │ │ Nostr: Decentralized protocol; encrypted DMs via NIP-04. │ │ Microsoft Teams: Bot Framework; enterprise support. │ │ Mattermost: self-hosted Slack-style chat;install the plugin to enable. │ │ Nextcloud Talk: Self-hosted chat via Nextcloud Talk webhook bots. │ │ Matrix: open protocol;install the plugin to enable. │ │ BlueBubbles: iMessage via the BlueBubbles mac app + REST API. │ │ LINE: LINE Messaging API bot for Japan/Taiwan/Thailand markets. │ │ Zalo: Vietnam-focused messaging platform with Bot API. │ │ Zalo Personal: Zalo personal account via QR code login. │ │ Synology Chat: Connect your Synology NAS Chat to OpenClaw with full agent capabilities. │ │ Tlon: decentralized messaging on Urbit;install the plugin to enable. │ │ │ ├───────────────────────────────────────────────────────────────────────────────────────────╯ │ ◇ Select a channel │ Feishu/Lark (飞书) │ ◇ Feishu credentials ──────────────────────────────────────────────────────────────╮ │ │ │ 1) Go to Feishu Open Platform (open.feishu.cn) │ │ 2) Create a self-built app │ │ 3) Get App ID and App Secret from Credentials page │ │ 4) Enable required permissions: im:message, im:chat, contact:user.base:readonly │ │ 5) Publish the app or add it to a test group │ │ Tip: you can also set FEISHU_APP_ID / FEISHU_APP_SECRET env vars. │ │ Docs: feishu │ │ │ ├───────────────────────────────────────────────────────────────────────────────────╯ │ ◇ Enter Feishu App ID │ cli_xxxxx │ ◇ Enter Feishu App Secret │ xxxxxxx [info]: ['client ready'] │ ◇ Feishu connection test ────────────────────────────╮ │ │ │ Connection failed: API error: app do not have bot │ │ │ ├─────────────────────────────────────────────────────╯ │ ◇ Which Feishu domain? │ Feishu (feishu.cn) - China │ ◇ Group chat policy │ Open - respond in all groups(requires mention)[info]: ['client ready'] │ ◇ Select a channel │ Finished │ ◇ Selected channels ──────────────────────────────────────────╮ │ │ │ Feishu — 飞书/Lark enterprise messaging. Docs: │ │ feishu │ │ │ ├──────────────────────────────────────────────────────────────╯ │ ◇ Configure DM access policies now? (default: pairing) │ Yes │ ◇ Feishu DM access ─────────────────────────────────────────────────────────────────────────╮ │ │ │ Default: pairing (unknown DMs get a pairing code). │ │ Approve: openclaw pairing approve feishu <code> │ │ Allowlist DMs: channels.feishu.dmPolicy="allowlist" + channels.feishu.allowFrom entries. │ │ Public DMs: channels.feishu.dmPolicy="open" + channels.feishu.allowFrom includes "*". │ │ Multi-user DMs: run: openclaw config set session.dmScope "per-channel-peer"(or │ │ "per-account-channel-peer"for multi-account channels) to isolate sessions. │ │ Docs: channels/pairing │ │ │ ├────────────────────────────────────────────────────────────────────────────────────────────╯ │ ◇ Feishu DM policy │ Open (public inbound DMs) │ ◇ Add display names for these accounts? (optional) │ Yes │ ◇ feishu account name (default) │ feishu │ ◇ Bind configured channel accounts to agents now? │ Yes │ ◇ Route feishu account "default" to agent │ main (default) │ ◇ Routing bindings ────────────────╮ │ │ │ Added: feishu accountId=default │ │ │ ├───────────────────────────────────╯ Config warnings: - plugins.entries.feishu: plugin feishu: duplicate plugin id detected; later plugin may be overridden (/home/ubuntu/.npm-global/lib/node_modules/openclaw/extensions/feishu/index.ts) Config overwrite: /home/ubuntu/.openclaw/openclaw.json (sha256 0923c52a525f0cb1b39d00380aca43194d148754cbc27324d03c9c97a915169b -> a39bc0ee7a65d9649038ffba9170f324d149aa550d84bc31f237fc240188b4cb, backup=/home/ubuntu/.openclaw/openclaw.json.bak) │ └ Channels updated. 
1.6.3 重启网关
openclaw gateway restart 

1.7. 配置事件订阅(关键步骤)

⚠️ 注意:在配置事件订阅前,请确保已完成 OpenClaw 渠道添加并启动网关。

在「事件订阅」页面:

  1. 选择 「使用长连接接收事件」(WebSocket 模式)
  2. 添加事件:im.message.receive_v1
在这里插入图片描述

1.8. 发布应用

进入「版本管理与发布」页面,创建版本并提交审核。企业自建应用通常会自动通过审批。

在这里插入图片描述


在这里插入图片描述

二、授权与测试

2.1.发送测试消息

在飞书中找到你的机器人(可在「应用」列表中搜索),发送一条消息。

在这里插入图片描述

2.2 批准配对码

默认情况下,机器人会回复一个 配对码。在终端执行:

# 查看待审批列表 openclaw pairing list feishu # 批准配对(将 <CODE> 替换为实际配对码) openclaw pairing approve feishu <CODE>

批准后,用户即可正常对话。

在这里插入图片描述
💡 获取 ID 技巧:通过 openclaw logs --follow 查看日志,可以获取用户的 open_id(格式 ou_xxx)和群组 chat_id(格式 oc_xxx),用于后续高级配置。

三、可选:配置文件手动编辑

如需更精细的控制,可直接编辑配置文件 ~/.openclaw/openclaw.json

{"channels":{"feishu":{"enabled":true,"dmPolicy":"pairing","accounts":{"main":{"appId":"cli_xxx","appSecret":"your-secret-here","botName":"企业AI助手"}}}}}

国际版 Lark 用户需额外配置域名:

{"channels":{"feishu":{"domain":"lark","accounts":{"main":{"appId":"cli_xxx","appSecret":"xxx"}}}}}

四、结语

通过命令行方式,你可以在任何环境中快速部署 OpenClaw 飞书机器人。这种方式特别适合自动化脚本和服务器部署,让 AI 助手无缝融入你的工作流。

五、视频教程

如果您觉得文字教程不够直观,欢迎访问我的 B 站频道观看完整视频版部署教程:

👉 点击观看《OpenClaw × 飞书:保姆级接入指南》

视频中我会实时演示每一步操作,详细讲解配置选项的含义,并演示如何在飞书中与机器人进行交互。建议搭配本文一起食用,效果更佳!

Read more

Flutter for OpenHarmony: Flutter 三方库 ferry 在鸿蒙应用中构建高性能类型安全的 GraphQL 通讯架构(现代 API 调用方案)

Flutter for OpenHarmony: Flutter 三方库 ferry 在鸿蒙应用中构建高性能类型安全的 GraphQL 通讯架构(现代 API 调用方案)

欢迎加入开源鸿蒙跨平台社区:https://openharmonycrossplatform.ZEEKLOG.net 前言 随着后端架构的演进,越来越多的 OpenHarmony 项目开始采用 GraphQL 替代传统的 RESTful API。GraphQL 的优势在于“按需取值”,能有效减少冗余数据的传输,这对于追求极致性能的鸿蒙应用尤为重要。然而,手动拼接 GraphQL 字符串、解析动态 Map 依然是繁琐且易错的。 ferry 是一套为 Flutter 量身定制的 GraphQL 客户端全家桶。它通过深度集成代码生成器(Code Generation),让你的鸿蒙应用能以“强类型”方式操作查询。它不仅支持请求与变动,更内置了极致的规范化缓存(Normalized Cache)系统,是构建专业级鸿蒙 GraphQL 应用的终极武器。 一、类型全链路通讯架构 ferry 在本地定义与远程数据之间建立了强类型的映射隧道。

By Ne0inhk
RabbitMQ - 第一个 Hello World 程序:SpringBoot 版极简集成

RabbitMQ - 第一个 Hello World 程序:SpringBoot 版极简集成

👋 大家好,欢迎来到我的技术博客! 📚 在这里,我会分享学习笔记、实战经验与技术思考,力求用简单的方式讲清楚复杂的问题。 🎯 本文将围绕RabbitMQ这个话题展开,希望能为你带来一些启发或实用的参考。 🌱 无论你是刚入门的新手,还是正在进阶的开发者,希望你都能有所收获! 文章目录 * RabbitMQ - 第一个 Hello World 程序:SpringBoot 版极简集成 * 🐰 什么是 RabbitMQ? * 核心概念 * 🧱 环境准备 * 安装 RabbitMQ * 🌱 创建 Spring Boot 项目 * ⚙️ 配置 RabbitMQ 连接 * 📤 发送消息:RabbitTemplate * 创建一个 Controller * 📥 接收消息:@RabbitListener * 创建一个 Listener * ▶️ 启动并测试 * 🧩 自动声明队列:为什么能成功? * 显式声明队列(推荐做法) * 📊 消息流转流程图 * 🧪 深入理

By Ne0inhk
70 倍性能碾压 + SQL 全兼容!金仓数据库终结 InfluxDB 的复杂时序场景统治

70 倍性能碾压 + SQL 全兼容!金仓数据库终结 InfluxDB 的复杂时序场景统治

70 倍性能碾压 + SQL 全兼容!金仓数据库终结 InfluxDB 的复杂时序场景统治 在物联网、工业互联网和运维监控领域,时序数据处理的需求正以前所未有的速度增长。面对海量设备产生的持续数据流,企业需要一个既能高速写入、又能快速分析的数据库引擎。长期以来,InfluxDB以其在时序领域的先发优势和简洁设计,成为许多团队的首选。然而,随着数据规模从“万级”跃升至“千万级”,业务查询从简单的点查变为复杂的多维度聚合,其性能瓶颈开始显现。 一场关于性能、扩展性与综合能力的较量,正在国产数据库金仓(KingbaseES)与国际开源方案InfluxDB之间展开。 性能对决:从数据摄入到复杂洞察的全面领先 真正的性能对比必须基于真实、可复现的测试场景。金仓数据库使用业界公认的开源时序基准测试套件TSBS,与InfluxDB进行了多轮正面较量,结论清晰而有力:在小规模、简单查询的工作负载下,两者各有千秋;但在大规模、复杂分析的真实生产环境中,金仓展现出压倒性的优势。 在数据写入吞吐方面,格局随数据规模急剧变化。测试模拟了从100台到1000万台设备的不同数据压力。当设备规模达到40

By Ne0inhk
【2025 最新】 MySQL 数据库安装教程(超详细图文版):从下载到配置一步到位

【2025 最新】 MySQL 数据库安装教程(超详细图文版):从下载到配置一步到位

MySQL 作为开源关系型数据库的标杆,广泛应用于 Web 开发、数据分析等场景,是程序员必备的基础工具之一。本文针对 2025 年最新版本 MySQL(以 MySQL 8.4.7为例),详细讲解 Windows 10/11 系统下的下载、安装、配置全流程,同时涵盖常见问题排查,适合零基础新手快速上手。 一、安装前准备 1. 确认系统环境 * 操作系统:Windows 10(64 位)或 Windows 11(64 位) * 硬件要求:至少 2GB 内存,10GB 以上空闲磁盘空间 * 依赖环境:无需额外安装依赖(安装包自带必要组件) 2. 下载

By Ne0inhk