Overview Version History Q & A Rating & Review
GitHub Accounts Switcher
A VS Code extension that allows you to switch between multiple GitHub accounts seamlessly.
Features
GitHub Account Management
Multiple Accounts : Store multiple GitHub accounts (Personal, Client, etc.)
Secure Storage : Uses VS Code's built-in authentication and secret storage
gh CLI Integration : Automatically switches GitHub CLI authentication
Token Management : Handles OAuth tokens securely without storing them
Screenshots
Adding a GitHub Account
Input dialog for labeling a new GitHub account
Command Palette Integration
Easy access to all GHA Switcher commands
Installation
Install the extension from the VS Code marketplace
Ensure you have the GitHub CLI (gh
) installed
Install the GitHub Pull Requests and Issues extension
Configuration
GitHub Account Settings
Configure your GitHub account settings in VS Code:
{
"ghaSwitcher.githubScopes": ["repo", "read:org", "gist", "workflow"],
"ghaSwitcher.ghPath": "gh"
}
Usage
Commands
GHA Switcher: Add GitHub Account
Adds a new GitHub account with a custom label
Prompts for a label (e.g., "Personal", "Client")
Uses VS Code's built-in GitHub authentication
GHA Switcher: Switch GitHub Account
Switches the active GitHub CLI authentication
Select from saved accounts
Smart switching : Only re-authenticates when necessary
Automatically updates gh
authentication
GHA Switcher: Refresh Account Token
Manually refresh authentication tokens for specific accounts
Useful when tokens expire or need renewal
Updates stored session information
Workflow
Setup :
Install the GitHub Pull Requests and Issues extension
Add GitHub accounts using "GHA Switcher: Add GitHub Account"
Daily Use :
Use "GHA Switcher: Switch GitHub Account" to switch gh CLI auth
Smart switching : The extension remembers your sessions and only asks for re-authentication when tokens expire
Your GitHub CLI will automatically use the selected account
Maintenance :
Use "GHA Switcher: Refresh Account Token" when you need to manually refresh tokens
Tokens are automatically managed by VS Code's authentication system
Settings
Setting
Description
Default
ghaSwitcher.githubScopes
OAuth scopes for GitHub
["repo", "read:org", "gist", "workflow"]
ghaSwitcher.ghPath
Path to GitHub CLI
gh
Requirements
VS Code 1.87.0 or higher
GitHub CLI (gh
) installed
GitHub Pull Requests and Issues extension
Security
GitHub tokens are managed by VS Code's built-in authentication
All sensitive data is stored in VS Code's secure storage
No network requests are made outside of VS Code's authentication flow
Troubleshooting
GitHub Authentication Issues
Make sure GitHub CLI is installed and accessible
Check that the GitHub Authentication extension is enabled
Verify OAuth scopes are sufficient for your needs
Command Execution Issues
Check that paths in settings are correct
Ensure shell environment is properly configured
Verify that required binaries are accessible
Contributing
Fork the repository
Create a feature branch
Make your changes
Submit a pull request
License
MIT License - see LICENSE file for details.