Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>GitHub Copilot Account ManagerNew to Visual Studio Code? Get it now.
GitHub Copilot Account Manager

GitHub Copilot Account Manager

tals

|
3 installs
| (0) | Free
Quickly switch GitHub accounts for GitHub Copilot without leaving the editor
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copilot Account Switcher

Switch between GitHub accounts for GitHub Copilot directly from VS Code — no browser, no settings JSON.

Version Installs License: MIT


Features

Status bar indicator Shows @username (your preferred Copilot account) at a glance. Blue when set, orange when no preference is saved.
Quick account switcher Command Palette or status bar click → QuickPick listing all connected GitHub accounts. The preferred account is marked with ✓.
Full preference write Targets every installed Copilot extension (GitHub.copilot, GitHub.copilot-chat, …) via VS Code's built-in account preference UI.
Session pre-warming Ensures the target account has valid sessions across all scope sets Copilot probes — prevents silent fall-back to the previous account.
Add a new account Triggers the GitHub OAuth flow without leaving VS Code.
Per-workspace preference The chosen account is remembered per workspace and reflected in the status bar on next open.
Accounts panel Webview listing all connected accounts with their GitHub avatars.
Live refresh Status bar updates automatically when GitHub sessions change.

Quick Start

  1. Install the extension.
  2. Click $(github) @username in the status bar (bottom-right), or open the Command Palette and run Copilot: Switch GitHub Account.
  3. Pick the account you want Copilot to use from the QuickPick.
  4. The "Manage Extension Account Preferences" picker opens — click the same account there (this is the VS Code step that actually writes the preference).
  5. Click Reload window when prompted.

Done — Copilot now uses the selected account.


Commands

Command Description
Copilot: Switch GitHub Account Open the account switcher QuickPick
Copilot: Add GitHub Account Sign in with a new GitHub account
Copilot: Show Active Account Show the preferred account for this workspace
Copilot: Refresh Account List Force-refresh the status bar
Copilot: Manage Account Preferences Open VS Code's native account preferences UI
Copilot: Show Accounts Panel Open the Webview panel with avatars

Configuration

Setting Default Description
copilotSwitcher.autoSwitchPerWorkspace false Show a prompt on startup when the workspace preference doesn't match the current Copilot account.
// .vscode/settings.json
{
  "copilotSwitcher.autoSwitchPerWorkspace": true
}

How It Works

VS Code 1.85+ supports multiple simultaneous GitHub accounts. This extension uses the vscode.authentication API to:

  1. List all connected accounts via vscode.authentication.getAccounts('github').
  2. Pre-warm the chosen account's sessions across every scope set Copilot probes (canonical Copilot scopes, empty-scope, read:user) — so VS Code's resolver never falls back to the old account.
  3. Persist the account ID in workspaceState for status-bar display and per-workspace memory.
  4. Open the preference picker via the targeted internal command _manageAccountPreferencesForExtension for each installed GitHub.copilot* extension. One click writes the preference; a window reload applies it immediately.

Why is one click in the VS Code picker required?

VS Code intentionally provides no public API to programmatically write another extension's account preference — it would let any extension hijack credentials. The _manageAccountPreferencesForExtension command is the closest supported path; it pre-fills the extension and provider so the user only needs a single click.

Reload behaviour

A Reload window prompt is shown after the preference is written. Copilot picks up the change on its next token request even without a reload, but reloading guarantees immediate effect.

Manual alternative

If the automatic picker doesn't open:

  1. Command Palette → Accounts: Manage Extension Account Preferences
  2. Select GitHub Copilot
  3. Choose the desired GitHub account
  4. Repeat for GitHub Copilot Chat if installed
  5. Run Developer: Reload Window

Known Limitations

  1. One click in the VS Code picker is unavoidable. The preference write must originate from VS Code's own UI — extension code cannot bypass this by design.
  2. copilot OAuth scope may not be available on all GitHub account tiers (e.g. some enterprise configurations). The extension handles this gracefully.
  3. Session persistence is managed by VS Code's GitHub auth provider. Signing out of a GitHub account in VS Code will clear its sessions; the status bar automatically switches to the inactive (orange) state.

Development

Prerequisites

  • Node.js ≥ 18
  • VS Code ≥ 1.85

Setup

npm install
npm run build:dev    # bundle with source maps
npm run build:watch  # watch mode

Run

Press F5 in VS Code to launch the Extension Development Host.

Type check

npm run compile

Test

npm test

Lint

npm run lint

Publishing

# Install the VS Code extension CLI (once)
npm install -g @vscode/vsce

# Generate the icon (if resources/icon.png is still the placeholder)
node generate-icon.js

# Dry-run — inspect what goes into the .vsix
vsce package --dry-run

# Package
vsce package
# → copilot-account-switcher-0.1.0.vsix

# Log in (first time — requires a Marketplace PAT with Marketplace > Manage scope)
vsce login talscr

# Publish
vsce publish

# Or bump patch version and publish in one step
vsce publish patch

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft