A lightweight, responsive VS Code extension that displays your active GitHub account in the Status Bar and allows you to quickly switch between multiple accounts and sync local Git identities using the official GitHub CLI (gh).
AI usage disclosure
- IDE / Agent Environment: Google Antigravity IDE
- CLI / Linters / MCP: codegraph
- Skills: vscode-extension (internal)
- Gemini 3.7 Flash
made this so that i could switch account easily in antigravity ide
Once activated, you will see a GitHub icon and your active username in the status bar. Hover over it to see authentication details, active scopes, and the current workspace's Git author identity:
- Click the status bar item (or press
Ctrl+Shift+P/Cmd+Shift+Pand runGitHub Account Switcher: Switch GitHub Account). - Select the desired account from the QuickPick menu:
- The extension runs
gh auth switch --user <username>, automatically synchronizes your repositorygit config(user.nameanduser.email), and updates the status bar immediately.
Select $(add) Log in new account from the QuickPick menu to launch an interactive gh auth login terminal session.
- ⚡ Real-Time Active Account in Status Bar: Always know which GitHub account is currently active (
$(github) octocat). - 🔄 One-Click Quick Switcher: Click the status bar item or open the Command Palette to view all logged-in accounts and switch instantly.
- 🎯 Workspace Identity Auto-Detection: When opening an existing repository, the extension inspects local Git configuration (
user.email,user.name, or remote URL) and automatically switches the active GitHub account to match. - ✨ Auto-Configure on
git init: When initializing a new repository (git init), the extension automatically configures local Git identity (user.nameanduser.email) using the currently active GitHub account. - 📁 Automatic Git Config Synchronization: When switching accounts, automatically updates your repository's local (or global)
git config user.nameanduser.emailto match the selected GitHub account. - 🏢 Enterprise & Multi-Host Support: Supports accounts across both
github.comand custom GitHub Enterprise servers. - ℹ️ Rich Status Tooltip: Hover over the status bar item to view details such as active host, Git protocol (SSH / HTTPS), token source, OAuth scopes, and the current workspace's active Git author name & email (clearly indicating whether it is
localorglobal fallback). - 🔑 Integrated Login: Trigger
gh auth logindirectly inside an integrated VS Code terminal to add new accounts. - 👁️ Auto-Sync & Focus Refresh: Automatically updates when you switch back to VS Code after modifying accounts in an external terminal.
Download the latest github-account-switcher-x.x.x.vsix from GitHub Releases.
- Open the Extensions view (
Ctrl+Shift+X/Cmd+Shift+X). - Click the
···(Views and More Actions) menu icon at the top-right of the Extensions panel. - Select
Install from VSIX...from the dropdown menu. - Select the downloaded
.vsixfile to install.
code --install-extension github-account-switcher-0.1.5.vsixThis extension leverages the official GitHub CLI (gh) to manage credentials and execute account switches securely.
- Ensure the GitHub CLI is installed on your system (
gh --version). - Authenticate your accounts via terminal:
gh auth login
Customize behavior in VS Code Settings (Ctrl+, / Cmd+, searching for GitHub Account Switcher):
| Setting | Default | Description |
|---|---|---|
githubAccountSwitcher.autoSwitchOnWorkspaceOpen |
true |
Automatically detect local repo git identity and switch to matching GitHub account on workspace open. |
githubAccountSwitcher.autoSwitchOnWindowFocus |
true |
Automatically detect local repository git identity and switch when returning/focusing this VS Code window. |
githubAccountSwitcher.syncGitConfig |
"local" |
Synchronize git config on switch ("local" updates repo config, "global" updates global config, "off" disables). |
githubAccountSwitcher.refreshInterval |
60 |
Auto-refresh interval in seconds (0 to disable background polling). |
githubAccountSwitcher.statusBarAlignment |
"right" |
Alignment of the status bar item ("left" or "right"). |
githubAccountSwitcher.statusBarPriority |
100 |
Priority order in the status bar (higher numbers appear further left). |
githubAccountSwitcher.showHost |
true |
Show host domain prefix for non-github.com accounts (e.g. ghe.corp:username). |
githubAccountSwitcher.ghPath |
"gh" |
Custom path to the GitHub CLI binary if not in your system PATH. |
| Command | Title | Description |
|---|---|---|
github-account-switcher.switchAccount |
Switch GitHub Account | Opens the account picker menu. |
github-account-switcher.refresh |
Refresh Accounts | Re-queries gh auth status immediately. |
github-account-switcher.login |
Log In New Account | Opens terminal to run gh auth login. |
Contributions, issues, and feature requests are welcome! Please read our Contributing Guide to get started with local development and submitting pull requests.
This project is licensed under the MIT License.

