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

@yrzhao/openclaw-lark

v2026.3.15

Published

OpenClaw Feishu plugin with browser-based onboarding and channel runtime

Readme

openclaw-lark

openclaw-lark 是一个 OpenClaw 飞书插件,但当前仓库的主目标不是“手工配一堆参数”,而是把飞书接入过程做成一条可直接执行的主流程。

执行 openclaw feishu-connect 后,插件会:

  1. 自动寻找可用的飞书应用凭据
  2. 打开系统浏览器进入飞书登录/授权页面
  3. 等用户扫码登录
  4. 自动把 channels.feishuplugins.entries.openclaw-lark 写入 OpenClaw 配置
  5. 保存本次登录得到的用户 Token
  6. 优先调用 openclaw gateway restart 让 Gateway 重载

当前实现采用的是“系统浏览器 + Device Flow”,不是内嵌 WebView。

快速开始

1. 安装插件

openclaw plugins install @yrzhao/openclaw-lark

如果你是在当前仓库里本地联调,也可以继续直接使用源码目录。

2. 安装依赖

pnpm install

3. 执行接入

openclaw feishu-connect

如果当前环境不方便自动拉起浏览器:

openclaw feishu-connect --no-open

命令会输出授权地址,你手动打开即可。

4. 准备应用凭据来源

插件会按下面顺序自动找 appId / appSecret

  1. 当前 OpenClaw 配置里的 channels.feishu.appId / appSecret
  2. 环境变量 OPENCLAW_LARK_APP_ID / OPENCLAW_LARK_APP_SECRET
  3. 环境变量 FEISHU_APP_ID / FEISHU_APP_SECRET
  4. AutoClaw 配置文件 ~/.openclaw-autoclaw/openclaw.json

如果你本机已经装过 AutoClaw,并且 ~/.openclaw-autoclaw/openclaw.json 里有可用的飞书配置,通常不需要再手填。

5. 本地自测

pnpm test
pnpm smoke

接入完成后写入的配置

插件会把 OpenClaw 配置收敛到这组关键字段:

{
  "channels": {
    "feishu": {
      "enabled": true,
      "dmPolicy": "open",
      "allowFrom": ["*"],
      "streaming": false,
      "domain": "feishu",
      "appId": "cli_xxx",
      "appSecret": "xxx"
    }
  },
  "plugins": {
    "entries": {
      "feishu": {
        "enabled": false
      },
      "openclaw-lark": {
        "enabled": true
      }
    }
  }
}

其中:

  • plugins.entries.feishu.enabled = false 用来避免旧版官方插件和本插件同时生效
  • plugins.entries.openclaw-lark.enabled = true 用来启用当前插件

可直接用的命令

openclaw feishu-connect
openclaw feishu-diagnose

飞书内命令:

/feishu connect
/feishu_connect
/feishu auth
/feishu doctor

说明:

  • /feishu connect/feishu_connect 会启动系统浏览器接入流程
  • /feishu auth 用于补做用户授权
  • /feishu doctor 用于诊断当前配置和权限状态

仓库定位

这个仓库里保留了完整的飞书通道运行时代码,包括消息收发、文档/表格/日历/任务等工具能力;但现在文档和主流程已经改成“先接入,再使用”。

也就是说:

  • 这不是一个单纯的 SDK 示例仓库
  • 它首先是一个“飞书接入插件”
  • 接入完成后,才进入完整的 Feishu channel/runtime 能力

目录说明

  • index.js 插件入口,注册 CLI、聊天命令、通道和工具。
  • src/onboarding/connect.js 新增的接入主流程,实现浏览器授权、配置写入、Token 持久化和 Gateway 重载。
  • src/channel Feishu 通道层。
  • src/core 鉴权、客户端、账号、Token、域名、配置等基础设施。
  • src/tools 飞书 OpenAPI、OAuth 和自动补授权工具。
  • test/feishu-connect.test.js 接入配置写入与浏览器命令解析测试。

文档

当前限制

  • 当前实现不是内嵌浏览器,而是系统浏览器。
  • 当前实现依赖已有应用凭据来源,不负责在线创建飞书应用。
  • 当前会优先调用 openclaw gateway restart;如果调用失败,会在结果里明确提示你手动重启 Gateway。

许可

MIT