npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ie2718-moltbot/feishu

v0.0.3

Published

Clawdbot Feishu (Lark) channel plugin - WebSocket-based messaging with markdown card support

Readme

@ie2718/clawdbot-feishu

English | 简体中文

Clawdbot 的飞书频道插件。

演示

演示对话

功能特性

  • WebSocket 长连接:无需公网 IP 或 Webhook 配置
  • Markdown 支持:通过交互式卡片消息实现富文本格式
  • 多账号:支持多个飞书机器人账号
  • 访问控制:基于配对码的私聊访问控制和群组白名单

安装

# 通过 Clawdbot CLI
clawdbot plugins install @ie2718-moltbot/feishu

# 或通过 npm
npm install @ie2718-moltbot/feishu

快速开始

1. 创建飞书应用

  1. 访问 飞书开放平台 并登录
  2. 点击 创建应用 > 企业自建应用
  3. 填写基本信息(名称、描述、图标)
  4. 在「添加应用能力」中添加 机器人 能力
  5. 在「凭证与基础信息」中获取 App IDApp Secret

2. 配置权限

在应用的「权限管理」中添加以下权限:

| 权限 | 说明 | |------|------| | im:message | 发送消息 | | im:chat | 获取群组信息 | | im:message:send_as_bot | 以应用的身份发消息 | contact:user.id:readonly | 读取用户信息(可选) |

直接批量导入

{
  "scopes": {
    "tenant": [
      "contact:user.id:readonly",
      "im:chat",
      "im:message",
      "im:message.group_at_msg:readonly",
      "im:message.group_msg",
      "im:message.p2p_msg:readonly",
      "im:message:send_as_bot",
      "im:resource"
    ],
    "user": []
  }
}

3. 安装插件并配置凭证

clawdbot plugins install @ie2718-moltbot/feishu

交互式配置向导会提示你输入:

  • App ID:你的飞书 App ID(如 cli_xxxxxxxxxx
  • App Secret:你的飞书 App Secret

如果之前已配置过凭证,向导会询问是否保留现有配置。

其他配置方式

如果你偏好手动配置:

方式 A:Clawdbot 配置命令

clawdbot config set channels.feishu.enabled true
clawdbot config set channels.feishu.appId "cli_xxxxxxxxxx"
clawdbot config set channels.feishu.appSecret "xxxxxxxxxxxxxxxxxxxxxxxx"

方式 B:配置文件 ~/.clawdbot/clawdbot.json

{
  channels: {
    feishu: {
      enabled: true,
      appId: "cli_xxxxxxxxxx",
      appSecret: "xxxxxxxxxxxxxxxxxxxxxxxx"
    }
  }
}

方式 C:交互式引导配置

clawdbot onboard

引导向导会引导你完成配置:

引导配置

4. 启用 WebSocket 事件订阅

  1. 进入 事件与回调 页面
  2. 将订阅方式设置为 长连接(WebSocket)
  3. 添加事件:im.message.receive_v1(接收消息)
  4. 开通 接收群聊中@机器人消息事件读取用户发给机器人的单聊消息获取群组中所有消息(敏感权限) (如果需要群聊)
  5. 点击保存

5. 发布机器人

  1. 创建版本并发布,在飞书客户端会收到小助手审核通过消息,打开应用即可对话
  2. 如果需要群聊,按以下步骤操作
  • 打开目标群聊窗口。
  • 点击右上角的 “...”(设置/群设置)。
  • 找到 “群机器人” 选项(通常在群公告下方)。
  • 点击 “添加机器人”。
  • 在搜索框中输入你的机器人名称。
  • 点击机器人名称后的 “添加” 按钮即可。
  • @ 机器人即可对话

5. 启动网关

clawdbot gateway run

配置参考

| 选项 | 类型 | 默认值 | 说明 | |------|------|--------|------| | enabled | boolean | true | 启用/禁用频道 | | appId | string | - | 飞书控制台的 App ID | | appSecret | string | - | 飞书控制台的 App Secret | | appSecretFile | string | - | 包含 App Secret 的文件路径 | | dmPolicy | string | "pairing" | 私聊访问策略 | | allowFrom | string[] | [] | 私聊白名单(用户 ID) | | groupPolicy | string | "allowlist" | 群组访问策略 | | groupAllowFrom | string[] | [] | 群组白名单(群组 ID) | | mediaMaxMb | number | 20 | 最大媒体文件大小(MB) |

多账号配置

{
  channels: {
    feishu: {
      defaultAccount: "main",
      accounts: {
        main: {
          name: "主机器人",
          appId: "cli_xxx",
          appSecret: "xxx"
        },
        support: {
          name: "客服机器人",
          appId: "cli_yyy",
          appSecret: "yyy"
        }
      }
    }
  }
}

CLI 使用

# 发送消息给用户(open_id)
clawdbot message send --channel feishu --target ou_xxx --message "你好!"

# 发送消息到群组(chat_id)
clawdbot message send --channel feishu --target oc_xxx --message "大家好!"

# 检查状态
clawdbot channels status --probe

版本更新

删除clawdbot的.clawdbot/extensions/feishu,然后clawdbot onboard

  • 选择Download from npm方式安装
  • 或者通过clawdbot plugins install 方式安装,然后选择Use local plugin path

访问控制

私聊策略选项

| 策略 | 行为 | |------|------| | pairing(默认) | 未知发送者会收到配对码;通过 CLI 审批 | | allowlist | 仅 allowFrom 中的用户可以发消息 | | open | 任何人都可以发消息(需设置 allowFrom: ["*"]) | | disabled | 禁止私聊 |

配对流程

当新用户在 dmPolicy: "pairing"(默认)模式下向机器人发送消息时,会收到一个配对码:

配对码

机器人管理员可以通过 CLI 批准访问:

# 列出待处理的配对请求
clawdbot pairing list feishu

# 批准配对请求
clawdbot pairing approve feishu <CODE>

Troubleshooting

  • Duplicate plugin id warning: If you see duplicate plugin id detected, you have multiple Feishu plugin entries loaded (for example, both a local plugin path and a downloaded extension in ~/.clawdbot/extensions/feishu). Keep only one installation and restart clawdbot.

文档

完整文档:https://resource.clawd.bot

许可证

MIT