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

@iam-brain/opencode-codex-auth

v1.2.1

Published

Native Codex auth with multi-account rotation for OpenCode

Readme

opencode-codex-auth

CI npm version

OpenCode plugin for OpenAI ChatGPT OAuth with multi-account management, Codex-compatible request modes, and dynamic model behavior controls.

Quick links: Getting Started · Configuration · Multi-account · Troubleshooting · Persona Tool

Why this plugin

  • Uses ChatGPT OAuth instead of API keys for OpenAI provider flows.
  • Keeps account rotation state in a plugin-owned store (codex-accounts.json).
  • Supports native and codex runtime modes.
  • Adds account-manager UX to opencode auth login (quotas, toggles, scoped deletes, transfer).

Quick start

Install and register the plugin (recommended):

npx -y @iam-brain/opencode-codex-auth@latest

Then authenticate:

opencode auth login

Use an OpenAI model through OpenCode:

opencode run "say hi" --model=openai/gpt-5

If that model is unavailable on your account, use any available openai/* model.

Usage notice

This plugin is intended for personal development use with your own ChatGPT account. For production multi-user systems, use the OpenAI Platform API.

Install behavior

By default, npx -y @iam-brain/opencode-codex-auth@latest runs the installer.

The installer does four things:

  1. Ensures @iam-brain/opencode-codex-auth@latest is present in resolved <config-root>/opencode.json ($XDG_CONFIG_HOME/opencode when set, otherwise ~/.config/opencode).
  2. Creates codex-config.json with defaults at resolved config root ($XDG_CONFIG_HOME/opencode when set, otherwise ~/.config/opencode) when missing.
  3. Synchronizes <config-root>/commands/create-personality.md for /create-personality (created/updated as needed).
  4. Synchronizes <config-root>/skills/personality-builder/SKILL.md (plus references) for skill-driven personality workflows.

At plugin startup, managed templates are synchronized to the latest version:

  • /create-personality command template
  • personality-builder skill bundle
  • pinned Codex prompts cache (codex-prompts-cache*.json) is refreshed best-effort
  • orchestrator agent visibility is reconciled based on effective collaboration profile

Re-run installer (idempotent):

npx -y @iam-brain/opencode-codex-auth@latest install

Config split

Keep opencode.json minimal (plugin enablement only). Put runtime behavior in:

  • resolved <config-root>/codex-config.json

Canonical config/env docs (complete key + variable reference) are in docs/configuration.md.

Schemas for user-edited JSON files are in:

  • schemas/codex-config.schema.json
  • schemas/opencode.schema.json
  • schemas/codex-accounts.schema.json (advanced/manual recovery)

Personality files live in lowercase directories:

  • project-local: .opencode/personalities/
  • global: resolved <config-root>/personalities/

Create guided custom personalities with:

/create-personality

Runtime modes

  • native: native-plugin style identity/headers.
  • codex: codex-rs style identity/headers.

Account storage

  • Primary runtime store: resolved <config-root>/codex-accounts.json ($XDG_CONFIG_HOME/opencode when set, otherwise ~/.config/opencode)
  • OpenCode provider auth marker (import source only): ${XDG_DATA_HOME:-~/.local/share}/opencode/auth.json
  • Session affinity cache: resolved <config-root>/cache/codex-session-affinity.json
  • Quota snapshot cache: resolved <config-root>/cache/codex-snapshots.json

Legacy sources can be imported explicitly from the auth menu:

  • resolved <config-root>/openai-codex-accounts.json
  • ${XDG_DATA_HOME:-~/.local/share}/opencode/auth.json

Documentation

Development

npm install
npm run verify

npm run verify includes ESM import specifier guards and a built CLI smoke check.