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

lark-op-cli

v0.0.6

Published

飞书开放平台 CLI 工具

Readme

lark-cli

飞书开放平台 CLI 工具。通过浏览器登录捕获凭证,在命令行中管理飞书应用。

安装

npm install -g lark-op-cli

或直接使用 npx

npx lark-op-cli <command>

前置要求

  • Node.js >= 18
  • Chrome 或 Edge 浏览器(也可通过 install-browser 命令自动下载)

命令

lark-cli login

登录飞书开放平台。

  • 有 UI 环境:自动打开 Chrome/Edge,在浏览器中完成登录
  • 无 UI 环境(SSH、容器、云 IDE):启动无头浏览器,在终端打印二维码,使用飞书 APP 扫码登录

登录凭证保存到系统 Keychain(macOS)或本地文件 ~/.lark-open-platform-cli/credentials.json

lark-cli apps

列出当前账号下的所有应用,显示 App ID、名称、版本、状态等信息。未登录时自动触发登录流程。

lark-cli create-bot

一键创建飞书机器人应用,自动完成以下步骤:

  1. 创建应用并获取 App ID / App Secret
  2. 启用机器人能力
  3. 导入消息相关权限(im:message 等)
  4. 建立 WebSocket 长连接并切换事件模式
  5. 订阅 im.message.receive_v1 事件
  6. 创建版本 0.0.1 并提交发布
  7. 通过机器人发送飞书通知给创建者
lark-cli create-bot --name "我的机器人" --desc "这是一个测试机器人"

| 选项 | 说明 | 默认值 | |------|------|--------| | -n, --name <name> | 应用名称 | bot | | -d, --desc <desc> | 应用描述 | 同 name |

lark-cli install-browser

下载 Chrome for Testing 到本地缓存(~/.lark-open-platform-cli/browsers/)。适用于服务器等没有预装浏览器的环境。

lark-cli logout

清除已保存的登录凭证。

环境变量

| 变量 | 说明 | |------|------| | CHROME_PATH | 指定浏览器可执行文件路径 | | LARK_HEADLESS=1 | 强制使用无头模式(终端二维码登录) | | LARK_GUI=1 | 强制使用 GUI 模式(打开浏览器窗口) | | DEBUG=1 | 输出调试信息(CSRF token、cookies 等) |

浏览器查找顺序

  1. CHROME_PATH 环境变量
  2. 系统安装的 Chrome(含 Canary、Chromium)
  3. 系统安装的 Edge
  4. 通过 install-browser 下载的 Chrome

支持 macOS、Linux、Windows 三平台。

项目结构

src/
  index.ts            # CLI 入口,命令注册
  browser.ts          # 浏览器登录(GUI + 无头二维码)
  browser-install.ts  # Chrome for Testing 下载管理
  credentials.ts      # 凭证存储(Keychain / 文件)
  api.ts              # 应用列表 API
  create-bot.ts       # 一键创建机器人流程

开发

npm install
npm run dev -- login       # 开发模式运行
npm run build              # 编译 TypeScript

License

MIT