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

@wuxiusen/openid-cli-demo

v1.0.0

Published

WorkBuddy CLI 连接器示例:OpenID 设备授权 + 按 openid 隔离的便签业务(WorkBuddy CLI connector demo: OpenID device authorization with per-openid data isolation)

Readme

openid-cli-demo

WorkBuddy CLI + Skill 方案连接器示例 CLI:OpenID 设备授权(Device Authorization)+ 按 openid 隔离的便签业务命令。配合授权/业务后端使用,演示「浏览器登录绑定 openid → 业务数据按 openid 隔离」的完整闭环。

本包是连接器 demo 的 CLI 部分;连接器包(connector/)与后端(server/)随源码仓库提供。

安装

npm install -g openid-cli-demo

安装后提供全局命令 openidcli(Windows 下为 openidcli.cmd)。要求 Node.js ≥ 18。

命令

认证命令(由 WorkBuddy 调度)

| 命令 | 说明 | |---|---| | openidcli auth | 向后端申请设备授权会话,打印授权 URL 后立即退出(用户在浏览器完成登录授权) | | openidcli status | 检查登录态:已授权输出 Logged in(退出码 0)并拉取 token 落盘;未登录输出 Not logged in(退出码 1) | | openidcli unAuth | 撤销远端会话并清理本地凭证;未登录时也正常返回 |

业务命令(供 AI / 用户调用,输出 JSON)

| 命令 | 说明 | |---|---| | openidcli memo list | 列出当前账号全部便签 | | openidcli memo add <文本> | 新增便签,返回该条记录(含 id) | | openidcli memo rm <id> | 按 id 删除当前账号自己的便签 |

示例:

openidcli memo add "周五前提交周报"
# {"id":"1","text":"周五前提交周报","ts":"2026-09-08T08:00:00.000Z"}

openidcli memo list
# {"openid":"oX4...","account":"Alice(演示账号 A)","memos":[{"id":"1",...}]}

配置

| 环境变量 | 默认 | 说明 | |---|---|---| | OPENIDCLI_SERVER | http://127.0.0.1:8787 | 授权/业务后端地址。WorkBuddy 连接器通过 cli.json 的 env 字段自动注入,无需手动设置 |

行为说明

  • 登录态存储:~/.openid-cli-demo/state.json(目录 0700 / 文件 0600),与安装目录分离, 卸载重装 CLI 不影响登录态,跨进程重启有效;
  • 自动续期:access_token 过期时自动用本地 refresh_token 轮换新 token 并重试一次; refresh 也失效则清理本地态并提示重新执行 openidcli auth;
  • openid 隔离:CLI 不接触 openid,业务数据由后端按 token 反查 openid 隔离, 不同账号之间互不可见;
  • 错误输出:业务失败输出 {"error":"..."} 到 stdout 并以非 0 退出码结束。

License

MIT