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

create-feishu-bot

v1.0.1

Published

一键创建并配置飞书机器人(长连接模式)

Readme

create-feishu-bot

🚀 一键创建并配置飞书机器人(长连接模式)

快速开始

npx create-feishu-bot

功能特性

  • ✅ 打开浏览器扫码登录(安全可信)
  • ✅ 自动创建飞书机器人
  • ✅ 支持修改现有机器人配置
  • ✅ 配置事件订阅(长连接模式)
  • ✅ 智能权限管理
    • 支持 1075+ 个可用权限
    • 租户权限(tenant_access_token)和用户权限(user_access_token)分类选择
    • 智能添加/删除权限,避免重复操作
    • 推荐权限默认选中
  • ✅ 支持卡片回调配置
  • ✅ 自动提交审核
  • ✅ 支持启动长连接客户端
  • ✅ 多机器人配置管理

使用流程

创建新机器人

  1. 运行 npx create-feishu-bot
  2. 选择"创建新机器人"
  3. 输入机器人名称和描述
  4. 选择需要订阅的事件
  5. 选择权限类型(租户/用户)
  6. 选择具体权限(推荐权限已默认选中)
  7. 浏览器扫码登录
  8. 等待自动创建和配置
  9. 选择是否启动长连接客户端

修改现有机器人

  1. 运行 npx create-feishu-bot
  2. 选择要修改的机器人
  3. 选择要修改的内容:
    • 📝 名称和描述
    • 📅 事件订阅
    • 🃏 卡片回调
    • 🔐 权限配置
    • 📤 提交新版本
  4. 根据选择修改相应配置
  5. 自动提交新版本审核

权限管理

权限类型

  • 租户权限 (tenant): 使用 tenant_access_token 调用,应用级别权限
  • 用户权限 (user): 使用 user_access_token 调用,用户级别权限

许多权限同时支持两种调用方式,会同时出现在两个列表中。

权限操作

  • 添加权限: 自动添加新选择的权限
  • 删除权限: 自动移除未选择的权限
  • 智能更新: 对比当前权限和选择的权限,只进行必要的添加/删除操作

配置文件

执行完成后会生成 .feishu-bot.json 配置文件:

{
  "cli_xxx": {
    "appSecret": "xxx",
    "name": "我的机器人",
    "desc": "机器人描述",
    "events": ["im.message.receive_v1", ...],
    "callbacks": ["card.action.trigger"],
    "scopes": { 
      "tenant": ["im:message:readonly", ...], 
      "user": ["contact:user.base:readonly", ...] 
    },
    "createdAt": "2024-01-01T00:00:00.000Z"
  }
}

支持多个机器人配置,以 appId 作为 key。

长连接客户端

使用飞书官方 SDK @larksuiteoapi/node-sdk 建立长连接,接收事件推送。

技术栈

  • Node.js >= 18.0.0
  • ES Modules
  • @larksuiteoapi/node-sdk (飞书官方 SDK)
  • inquirer (交互式命令行)
  • puppeteer (浏览器自动化)
  • chalk (终端样式)
  • ora (加载动画)

许可证

MIT