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-openai-profiles

v0.1.5

Published

OpenCode TUI plugin for switching saved OpenAI ChatGPT OAuth profiles.

Readme

opencode-openai-profiles

OpenCode TUI plugin for switching between saved OpenAI ChatGPT Pro/Plus OAuth profiles.

OpenCode has one active openai auth slot. This plugin saves named copies of that auth object and swaps one into auth.json when you switch profiles.

Status

Early local-first plugin. Profile switches apply live when your OpenCode version supports runtime auth updates.

Install

Package: opencode-openai-profiles

Install globally:

opencode plugin opencode-openai-profiles@latest --global

This installs the package and adds it to OpenCode's server and TUI plugin configs when OpenCode exposes both targets.

Manual config alternative:

{
  "plugin": ["opencode-openai-profiles@latest"]
}

For local development, build from this repo:

pnpm install
pnpm build

Install the local plugin:

opencode plugin "$PWD" --global --force

Usage

Open the account picker:

/openai-profiles

For direct commands, use /openai-profiles-cli:

/openai-profiles-cli save <name>
/openai-profiles-cli switch <name>
/openai-profiles-cli rename <old> <new>
/openai-profiles-cli list
/openai-profiles-cli active
/openai-profiles-cli login [browser|headless]
/openai-profiles-cli complete <callback-url-or-code>

First Setup

Save your current OpenAI account:

/openai-profiles

Choose Save Current Profile, then enter account-1 or another name.

If you skip this step, the plugin saves the active unsaved account as account-1 before starting a new OpenAI login.

Log in to another account:

/openai-profiles

Choose Login to OpenAI. Select ChatGPT Pro/Plus (headless) if you want to paste the final callback URL by hand.

Direct command:

/openai-profiles-cli login browser
/openai-profiles-cli login headless

For direct headless login, open the returned URL, copy the final callback URL from the browser address bar, then run:

/openai-profiles-cli complete <callback-url-or-code>

If OpenCode prompts you to restart after login, restart it before saving the new active account:

/openai-profiles

Choose Save Current Profile, then enter account-2 or another name.

Switch profiles:

/openai-profiles

Choose Switch Profile, then select a saved profile.

If OpenCode cannot apply the switch live, the plugin will tell you to restart.

Direct command:

/openai-profiles-cli switch account-1
/openai-profiles-cli switch account-2

Storage

OpenCode stores the active auth file here:

~/.local/share/opencode/auth.json

This plugin stores saved OpenAI profiles here:

~/.local/share/opencode/auth-profiles/

Example files:

openai-account-1.json
openai-account-2.json

Each profile file contains only the openai OAuth object. The plugin preserves other providers in auth.json.

Security

Profile files contain OAuth tokens. Treat them as secrets.

Do not commit auth.json or auth-profiles.

The plugin never displays token values. It only shows the OpenAI accountId when available.