A VS Code extension that allows you to switch between multiple GitHub accounts seamlessly.
- 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
Input dialog for labeling a new GitHub account
Easy access to all GHA Switcher commands
- Install the extension from the VS Code marketplace
- Ensure you have the GitHub CLI (
gh) installed - Install the GitHub Pull Requests and Issues extension
Configure your GitHub account settings in VS Code:
{
"ghaSwitcher.githubScopes": ["repo", "read:org", "gist", "workflow"],
"ghaSwitcher.ghPath": "gh"
}-
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
ghauthentication
-
GHA Switcher: Refresh Account Token
- Manually refresh authentication tokens for specific accounts
- Useful when tokens expire or need renewal
- Updates stored session information
-
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
| Setting | Description | Default |
|---|---|---|
ghaSwitcher.githubScopes |
OAuth scopes for GitHub | ["repo", "read:org", "gist", "workflow"] |
ghaSwitcher.ghPath |
Path to GitHub CLI | gh |
- VS Code 1.87.0 or higher
- GitHub CLI (
gh) installed - GitHub Pull Requests and Issues extension
- 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
- Make sure GitHub CLI is installed and accessible
- Check that the GitHub Authentication extension is enabled
- Verify OAuth scopes are sufficient for your needs
- Check that paths in settings are correct
- Ensure shell environment is properly configured
- Verify that required binaries are accessible
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details.