Skip to content

HArars/opencode-switch-openai-auth-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-switch-openai-auth-plugin

screenshot

OpenCode TUI plugin for switching between saved OpenAI OAuth accounts with a single /switch command.

Features

  • one /switch command 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-plugin

Usage

Run the command below in OpenCode:

/switch

From 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 install

Run checks:

bun test
bunx tsc -p tsconfig.json --noEmit

Build the package output:

bun run build

For 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

About

An OpenCode TUI plugin that lets you save, switch, and manage multiple OpenAI OAuth credentials from a single /switch dialog without polluting chat context.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors