@harars/opencode-switch-openai-auth-plugin
v0.1.6
Published
OpenCode TUI plugin for switching saved OpenAI OAuth accounts
Maintainers
Readme
opencode-switch-openai-auth-plugin
OpenCode TUI plugin for switching between saved OpenAI OAuth accounts with a single /switch command.
Features
- one
/switchcommand for login, switching, and removal - uses the native OpenCode OpenAI OAuth flow
- supports multiple saved accounts
- marks the current account in the picker
- keeps saved-account removal separate from the active session
Installation
Install the plugin with the OpenCode plugin command:
opencode plugin @harars/opencode-switch-openai-auth-pluginUsage
Run the command below in OpenCode:
/switchFrom there you can:
- sign in with another OpenAI account
- switch to a saved account
- remove a saved account
Storage
Saved accounts are stored in a plugin-managed JSON file:
- Linux:
~/.local/share/opencode/auth-switch/accounts.json - macOS:
~/Library/Application Support/opencode/auth-switch/accounts.json - Windows:
%LOCALAPPDATA%/opencode/auth-switch/accounts.json
Local Development
Install dependencies:
bun installRun checks:
bun test
bunx tsc -p tsconfig.json --noEmitBuild the package output:
bun run buildFor local development, point your workspace tui.json at the local source entry:
{
"plugin": [
"file:///absolute/path/to/opencode-switch-openai-auth-plugin/src/tui.tsx"
],
"plugin_enabled": {
"harars.switch-auth": true
}
}Package
- package name:
@harars/opencode-switch-openai-auth-plugin - license: MIT
