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

opencode-codex

v0.3.2

Published

Multi-account ChatGPT Codex auth plugin for OpenCode

Readme

opencode-codex

Multi-account ChatGPT Codex auth plugin for OpenCode.

[!IMPORTANT] opencode-codex is an unofficial community project. It is not built by the OpenCode team and is not affiliated with OpenCode.

opencode-codex lets OpenCode treat the built-in openai OAuth flow as a Codex subscription path with managed multi-account rotation.

It preserves OpenCode's own openai model list and only replaces the auth and request transport used for the Codex account pool.

Install

Add the published npm package to your OpenCode config:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-codex"]
}

OpenCode installs npm plugins automatically with Bun at startup.

For local development, place this project in .opencode/plugins/ or point OpenCode at a local plugin file.

Login

Run:

opencode auth login --provider openai

Methods exposed by the plugin:

  • Codex
  • Manually enter API Key

Selecting Codex opens the plugin-managed account screen:

opencode auth login --provider openai

In a normal TTY terminal it opens a navigable account-management menu. In non-TTY environments it falls back to a readline flow.

From the management flow you can:

  • Inspect which account is currently active for routing
  • See the saved label, plus account email when available
  • Review enabled, disabled, and rate-limited state with quota summaries
  • Edit an account label
  • Enable or disable an account
  • Refresh an account's quota snapshot without rotating tokens
  • Remove an account with confirmation

The plugin stores the full account pool in ~/.config/opencode/codex-accounts.sqlite and keeps one sentinel OAuth record under the openai provider in opencode's auth.json so OpenCode uses its built-in Codex-compatible request path.

The plugin reuses opencode's built-in openai provider instead of creating a standalone codex provider.

While the plugin is active, openai OAuth is treated as the Codex subscription path.

Requirements

  • OpenCode with npm plugin loading enabled
  • A Codex-compatible OpenAI account
  • Bun for local development and test runs

Behavior

  • Sticky account selection
  • Switches immediately on 429
  • Tracks per-account Codex usage windows from response headers and GET /backend-api/wham/usage
  • Respects 5-hour, weekly, and alternate metered-bucket exhaustion during account rotation
  • Fails fast when all accounts are rate-limited

Config

Optional config file: .opencode/opencode-codex.json

{
  "rateLimitMs": 3600000
}

Development

bun install
bun run typecheck
bun test
bun run build

The published package ships compiled output from dist/.