Switch between multiple Anthropic accounts in Oh My Pi without logging out.
Why? · Installation · Usage
You have a personal Anthropic account and a work one. Every time you need to switch, you log out, log back in, and wait for OAuth to do its thing. It's tedious.
omp-account-switcher fixes this. Log in to both accounts once, then flip between them with a single slash command. Your active account shows in the footer so you always know which one you're using.
OMP stores OAuth credentials in a SQLite database. Each credential has a disabled flag. This extension toggles that flag to switch which account is active, then tells OMP to reload its auth state. No logout, no re-auth, no token expiry issues.
/accountto switch between accounts via a selector/account labelto name them (e.g., "personal", "work")- Footer shows
acct:<label>when multiple accounts exist
Clone the repo and symlink the extension into your OMP extensions directory:
git clone git@github.com:sasha-computer/omp-account-switcher.git ~/Developer/omp-account-switcher
ln -sf ~/Developer/omp-account-switcher/src/account-switcher.ts ~/.omp/agent/extensions/account-switcher.ts
ln -sf ~/Developer/omp-account-switcher/src/account-store.ts ~/.omp/agent/extensions/account-store.tsRestart OMP. The extension loads automatically from ~/.omp/agent/extensions/.
/loginand pick Anthropic (first account)/loginand pick Anthropic (second account)/account labelto name them/accountto switch
Type /account to open the account selector. Pick the account you want. OMP reloads auth immediately.
Type /account label to set friendly names for each credential. Without labels, accounts show as "Account 1", "Account 2", etc.
When you have 2+ Anthropic credentials, the footer shows acct:<label> so you can see which account is active at a glance.
The extension uses three tables in OMP's agent.db:
| Table | Purpose |
|---|---|
auth_credentials |
Stores OAuth tokens; disabled column controls which are active |
cache |
Stores account labels with key account_label:{id} |
Switching runs in a transaction: disable all Anthropic credentials, enable the selected one, then call authStorage.reload(). If anything fails, the transaction rolls back.
Labels persist across sessions. OAuth token refresh continues to work because OMP's own auth layer manages the active credential.
bun test18 tests covering credential queries, label priority, account switching, and transaction rollback.
MIT
