[PR #13378] feat(auth): multi-account support with auto-rotation #14637

Open
opened 2026-02-16 18:19:25 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13378

State: open
Merged: No


Summary

Add multi-account support to OpenCode authentication system, inspired by the Antigravity plugin.

Changes

  • New auth storage format: { provider: { accounts: {}, activeAccount } }
  • Auto-migration: seamless upgrade from legacy single-account format
  • Interactive CLI: no more --account flags, just run opencode auth login
  • Account management: switch, enable/disable accounts interactively
  • Environment variables: OPENCODE_ACCOUNT_OPENAI=work for account selection
  • Auto-rotation: getNextAccount() for rate-limit handling (WIP)

Example Usage

# Add first account
opencode auth login openai

# Add second account (will prompt interactively)
opencode auth login openai

# Switch account
opencode auth use

# Or use env var
OPENCODE_ACCOUNT_OPENAI=personal opencode run ...

Related

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13378 **State:** open **Merged:** No --- ## Summary Add multi-account support to OpenCode authentication system, inspired by the Antigravity plugin. ### Changes - **New auth storage format**: { provider: { accounts: {}, activeAccount } } - **Auto-migration**: seamless upgrade from legacy single-account format - **Interactive CLI**: no more --account flags, just run `opencode auth login` - **Account management**: switch, enable/disable accounts interactively - **Environment variables**: `OPENCODE_ACCOUNT_OPENAI=work` for account selection - **Auto-rotation**: getNextAccount() for rate-limit handling (WIP) ### Example Usage ```bash # Add first account opencode auth login openai # Add second account (will prompt interactively) opencode auth login openai # Switch account opencode auth use # Or use env var OPENCODE_ACCOUNT_OPENAI=personal opencode run ... ``` ### Related - Inspired by: https://github.com/NoeFabris/opencode-antigravity-auth
yindo added the pull-request label 2026-02-16 18:19:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14637