Feishu Hono

v0.1.4

OpenClaw Feishu channel plugin built with Hono

@pfyuan/openclaw-feishu-hono·runtime openclaw-feishu-hono·by @yuanpf
Code Pluginsource linkedCommunity code plugin. Review compatibility and verification before install.

README

OpenClaw Feishu Hono Plugin

使用 Hono 的 OpenClaw 飞书聊天插件(默认无外部数据库依赖)。

能力

  • 接收飞书 im.message.receive_v1 文本消息(Webhook)
  • 将消息交给 OpenClaw 标准 reply pipeline 生成回复
  • 自动把回复发送回飞书(支持 replyTo)
  • 通过稳定的 sessionKey 规则维护会话线程(chat_id + thread_id

目录结构

  • index.ts: OpenClaw 插件入口
  • src/channel/plugin.ts: ChannelPlugin 定义(config/outbound/gateway)
  • src/gateway/server.ts: Hono 服务生命周期
  • src/gateway/inbound.ts: 入站消息 -> OpenClaw dispatch

配置与环境变量策略

  • 只使用 OpenClaw 配置文件中的 channels.feishu-hono
  • 插件不会读取 FEISHU_APP_ID / FEISHU_APP_SECRET 等环境变量(避免被安全扫描判定为凭据外流风险)。

安装与构建

pnpm install
pnpm typecheck
pnpm build

构建后会生成:

  • dist/index.mjs(插件入口)
  • bin/openclaw-feishu-hono.js(CLI bin 包装器)

OpenClaw 配置示例

~/.openclaw/config.json 中加入:

{
  "channels": {
    "feishu-hono": {
      "enabled": true,
      "appId": "cli_xxx",
      "appSecret": "xxx",
      "verificationToken": "verify_xxx",
      "webhookPort": 8787,
      "webhookPath": "/webhook/feishu"
    }
  }
}

飞书事件订阅

在飞书开放平台:

  1. 添加事件 im.message.receive_v1
  2. Request URL 配置为: http://<your-host>:8787/webhook/feishu
  3. 如果开启 verification token,确保与插件配置一致

说明

  • 当前仅处理文本消息,非文本消息会忽略。
  • sendMedia 会降级为文本形式发送媒体 URL。
  • 线程 key 规则:<route.sessionKey>:thread:<thread_id>
  • 不读取 FEISHU_* 环境变量,所有配置从 channels.feishu-hono 获取。

Capabilities

Channels
feishu-hono
configSchema
Yes
Executes code
Yes
HTTP routes
0
Plugin kind
channel
Runtime ID
openclaw-feishu-hono

Compatibility

Built With Open Claw Version
2026.3.22
Min Gateway Version
2026.3.22
Plugin Api Range
>=2026.3.22
Plugin Sdk Version
2026.3.22

Verification

Tier
source linked
Scope
artifact only
Summary
Validated package structure and linked the release to source metadata.
Commit
3dc169a4f705
Tag
3dc169a4f70524e4ccc38e9f1b4d8fc91842a40b
Provenance
No
Scan status
pending

Tags

latest
0.1.4