OpenCode plugin for multi-account GitHub Copilot workflows.
- Store multiple Copilot OAuth accounts in
multi-copilot.json - Switch the global default account (syncs into
auth.json) - Bind a different account per session (parallel multi-account usage)
- Preserve core behavior: session switch does not overwrite global active auth
- Support both GitHub.com and GitHub Enterprise Copilot
This plugin extends OpenCode’s auth model with three layers:
- Multi-account state in
~/.local/share/opencode/multi-copilot.json - Global active sync into
~/.local/share/opencode/auth.json - Session-level binding via
sessionIDheaders and provider fetch routing
OpenCode reads:
.opencode/plugins/multi-copilot.js.opencode/commands/*.md
Build once before first use:
npm install
npm run buildmulti-copilot.js loads from dist/src/index.js.
After publishing, install and register the plugin in opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-multi-copilot"]
}Use the native OpenCode command:
opencode auth login -p github-copilotThe plugin intercepts provider auth and will:
- complete device flow polling
- normalize enterprise domains
- persist/update the account in
multi-copilot.json - set that account as global active
- sync
auth.jsonfor immediate provider use
/copilot-pick
Shows an indexed list and lets you switch by:
- index (
1or#1) - alias (case-insensitive)
- full account ID
/copilot-switch work
/copilot-switch #2
/copilot-global personal
If /copilot-switch is run without arguments, it now returns guided pick instructions instead of a raw error.
/copilot-accounts/copilot-status/copilot-unbind/copilot-import [alias]/copilot-rename <account> <new-alias>/copilot-remove <account>/copilot-sync
The plugin exposes copilot_accounts with actions:
listpickstatusswitchunbindremoverenameimport-currentsync
switch.account accepts id, alias, or indexed references (1, #1).
- Repository: https://github.com/YZJ0716/opencode-multi-copilot
- Homepage: https://github.com/YZJ0716/opencode-multi-copilot
- Credentials remain on local disk using OpenCode-native auth storage style
- This repository does not include real secrets