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

@chunhuizk/ch-code-cli

v1.9.0

Published

CH Code CLI - Internal system authentication tool

Readme

@chunhuizk/ch-code-cli

Internal CLI tool (chcode) for workspace members to authenticate and configure Claude Code with their corporate account.

After a successful OIDC login, the CLI provisions a LiteLLM API key and automatically configures Claude Code so you can use it through your organization's account. The API key expires every 2 weeks, so you will need to run chcode login again to refresh it.

Requirements

  • Node.js ≥ 18
  • Access to your organization's workspace (login permission required)

Installation

npm install -g @chunhuizk/ch-code-cli

Or build from source:

pnpm install
pnpm build

The chcode binary is output to dist/index.js.

Usage

First-Time Setup

Before your first login, you must provide your organization's OIDC issuer URL:

chcode login --issuer https://auth.example.com

The issuer URL will be saved to your local configuration, so subsequent logins only require chcode login.

Alternatively, you can set it via the config command first:

chcode config set issuer https://auth.example.com

Login

Authenticate via OIDC and provision an API key for Claude Code:

chcode login          # interactive OIDC login
chcode login --force  # force re-login even if session is active

After login, Claude Code will be configured automatically — no extra steps needed.

Status

Check your current session and API key status (including expiration):

chcode status

Config

View or update CLI configuration:

chcode config

Logout

Clear stored tokens and API key:

chcode logout

How It Works

  1. chcode login opens your browser for OIDC authentication (with PKCE).
  2. Upon successful login, a LiteLLM API key is provisioned.
  3. The API key is stored securely in your system keychain and configured for Claude Code.
  4. The key is valid for 2 weeks. After expiration, run chcode login again.

Development

pnpm dev          # build in watch mode
pnpm typecheck    # type-check without emitting
pnpm test         # run tests
pnpm test:watch   # run tests in watch mode

License

UNLICENSED — Internal use only.


@chunhuizk/ch-code-cli(中文说明)

内部 CLI 工具(chcode),供工作区成员认证并配置 Claude Code,使用公司账户进行访问。

成功通过 OIDC 登录后,CLI 会自动生成 LiteLLM API 密钥,并配置 Claude Code,让你可以通过公司账户使用 Claude Code。API 密钥每 2 周过期一次,届时需要重新执行 chcode login 刷新密钥。

环境要求

  • Node.js ≥ 18
  • 拥有组织工作区的登录权限

安装

npm install -g @chunhuizk/ch-code-cli

或从源码构建:

pnpm install
pnpm build

构建产物为 dist/index.js

使用方法

首次设置

首次登录前,需要提供组织的 OIDC 签发者(issuer)URL:

chcode login --issuer https://auth.example.com

签发者 URL 会保存到本地配置中,之后登录只需执行 chcode login 即可。

也可以先通过配置命令设置:

chcode config set issuer https://auth.example.com

登录

通过 OIDC 认证并生成 Claude Code API 密钥:

chcode login          # 交互式 OIDC 登录
chcode login --force  # 强制重新登录(即使会话仍有效)

登录成功后,Claude Code 会自动完成配置,无需额外操作。

查看状态

查看当前会话和 API 密钥状态(包括过期时间):

chcode status

配置

查看或修改 CLI 配置:

chcode config

登出

清除已存储的令牌和 API 密钥:

chcode logout

工作原理

  1. chcode login 打开浏览器进行 OIDC 认证(使用 PKCE)。
  2. 登录成功后,自动生成 LiteLLM API 密钥。
  3. 密钥安全存储在系统钥匙串中,并自动配置 Claude Code。
  4. 密钥有效期为 2 周,过期后需重新执行 chcode login

开发

pnpm dev          # 监听模式构建
pnpm typecheck    # 类型检查(不输出文件)
pnpm test         # 运行测试
pnpm test:watch   # 监听模式运行测试

许可证

UNLICENSED — 仅供内部使用。