Skip to content

benRUSG/github-account-switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Account Switcher

Quickly switch between multiple GitHub accounts from the VS Code status bar.

Features

  • Status bar indicator — shows the currently active GitHub account
  • Quick switch — click the status bar or use the command palette
  • Auto-detect — detects which account is active based on the current repo's git config
  • gh CLI integration — optionally runs gh auth switch alongside git config changes
  • Add/remove accounts — manage accounts directly from VS Code

Setup

  1. Install the extension
  2. Run "GitHub Account Switcher: Add GitHub Account" from the command palette
  3. Enter a label, git name, email, and optionally your GitHub username
  4. Repeat for additional accounts

Or configure manually in settings.json:

{
  "githubAccountSwitcher.accounts": [
    {
      "label": "Work",
      "name": "Ben Work",
      "email": "ben@work.com",
      "ghAccount": "ben-work"
    },
    {
      "label": "Personal",
      "name": "Ben",
      "email": "ben@personal.com",
      "ghAccount": "ben-personal"
    }
  ]
}

Commands

Command Description
GitHub Account Switcher: Switch GitHub Account Pick an account to switch to
GitHub Account Switcher: Add GitHub Account Add a new account interactively
GitHub Account Switcher: Remove GitHub Account Remove an existing account

Settings

Setting Default Description
githubAccountSwitcher.accounts [] List of GitHub accounts
githubAccountSwitcher.switchGhCli true Also run gh auth switch when switching

What it does when you switch

  1. Sets git config user.name and git config user.email in the current workspace
  2. If switchGhCli is enabled and ghAccount is set, runs gh auth switch --user <username>

About

VS Code extension to quickly switch between multiple GitHub accounts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors