Skip to content

lopezlav/opencode-codex-switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-codex-switcher

Use multiple OpenAI Codex accounts as separate OpenCode providers:

  • openai-personal displayed as OpenAI personal
  • openai-work displayed as OpenAI work

Each provider stores its own OAuth token in OpenCode auth storage, so model selection, favorites, recents, and account limits are separated by provider ID.

Install

git clone https://github.com/chope/opencode-codex-switcher.git ~/.config/opencode/plugins/opencode-codex-switcher
cd ~/.config/opencode/plugins/opencode-codex-switcher
npm install && npm run build

Run these once to connect both accounts:

opencode auth login --provider openai-personal --method "OpenAI Codex (browser)"
opencode auth login --provider openai-work --method "OpenAI Codex (browser)"

Custom Profiles

{
  "plugin": [
    ["opencode-codex-switcher", {
      "personal": { "id": "openai-main", "name": "OpenAI main" },
      "work": { "id": "openai-client", "name": "OpenAI client" }
    }]
  ]
}

Notes

OpenCode does not currently expose a provider alias API, so the plugin clones OpenAI model metadata from models.dev into custom provider IDs. It keeps npm: "@ai-sdk/openai" so OpenCode still applies the official OpenAI provider transforms and reasoning variants.

The plugin respects OPENCODE_MODELS_URL when fetching model metadata.

About

Differentiate personal and work Codex subscription to quickly switch between them just like switching models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors