Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>GH AccountsNew to Visual Studio Code? Get it now.
GH Accounts

GH Accounts

Abdelrahman M.

|
35 installs
| (0) | Free
Manage GitHub CLI accounts by host with native VS Code controls.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GH Accounts

Manage your GitHub CLI accounts from VS Code. GH Accounts helps you move between personal, work, and GitHub Enterprise accounts while keeping the active account easy to find.

What you can do

  • See your accounts in one place. Accounts are grouped by GitHub host, such as github.com or your company's Enterprise host.
  • Switch without typing CLI commands. Choose an account from the sidebar or status bar.
  • Spot sign-in problems. Check which account is active and whether its authentication check succeeded.
  • Open a profile or copy a username. Visit the selected account's GitHub page or copy its username for use elsewhere.
  • Recognize accounts by name and picture. Optionally show GitHub display names and supported avatars alongside account details.
  • Add your own account labels. Use aliases such as “Personal” or “Work” beside usernames.
  • Connect Git HTTPS authentication to GitHub CLI. Configure Git credentials for a chosen host when you need it.

Before you start

You need VS Code 1.95 or newer, GitHub CLI installed, and a workspace you trust. GH Accounts does not install GitHub CLI for you.

If you work over SSH, WSL, Dev Containers, or Codespaces, GitHub CLI and GH Accounts need to be available in that remote environment. See Remote workspaces below.

Get started

  1. Open a folder or workspace in VS Code. Trust it only if you trust its contents.
  2. Open GH Accounts in the Activity Bar on the left.
  3. Select Refresh to see accounts already saved in GitHub CLI.
  4. To sign in, select Add Account. Enter github.com or your Enterprise hostname, such as git.example.com, without https:// or a path.
  5. Follow the instructions in the GH Accounts terminal and complete the browser sign-in. The account list refreshes when the sign-in process finishes.

GitHub CLI may offer to configure Git during sign-in. Accept that prompt only if you want it to change how Git authenticates.

To add another account, repeat Add Account and sign in with the other account in your browser.

You can also open the Command Palette and search for GH Accounts to find the commands below.

Switch accounts

  1. Click GH Accounts in the status bar, or run GH Accounts: Choose Account.
  2. Choose the username and host you want to use.
  3. Select Switch Account. The account list updates after the switch.

You can also use the Switch Account action beside an account in the sidebar, or run GH Accounts: Switch Account.

Switching changes the shared GitHub CLI account for that host. Other terminals and workspaces using the same GitHub CLI configuration can use the newly selected account. It does not create a separate account for each workspace or change your Git commit name, email, or SSH identity.

Read the status bar

With accounts on one GitHub host, the status bar shows the active username, such as GH Accounts: alice. With several hosts, it shows a host count, such as GH Accounts: 2 hosts. That count includes hosts without an active or healthy account.

Hover over it for full usernames and hosts, local aliases, authentication health, environment-token overrides and the local or remote environment being managed. Long usernames are shortened in the status bar and shown in full in the tooltip. Click it to choose or manage an account.

A loading indicator means an account check or operation is in progress. (last known) means the displayed data is stale; select Refresh to verify it. Environment token means an override is present but its effective username is unknown. Check accounts means the active identity is ambiguous; open the picker and inspect the account list. These labels work with profile details enabled or off.

Open a profile or copy a username

Right-click an account and select Open GitHub Profile or Copy Username. You can also choose the account from the GH Accounts status-bar menu, or run GH Accounts: Open GitHub Profile or GH Accounts: Copy Username from the Command Palette.

The profile opens in your browser on the account's GitHub.com or Enterprise host. Copy Username copies just the username, without the host or profile URL.

Both actions work with usernames already shown in the list, even if an authentication check fails or an environment token overrides saved credentials. They are unavailable for identities whose username is unknown.

Show display names and avatars

This optional feature is off by default.

  1. Open VS Code Settings and search for GH Accounts: Profile Details.
  2. Choose names for display names, avatars for pictures only, or namesAndAvatars for both. Choose off to return to usernames and account icons.
  3. Open the account list or account picker. When enabled, names appear alongside usernames and pictures appear in the sidebar. The avatars option keeps the existing username and status labels without adding display names.

The setting applies to the local or remote environment running GH Accounts. It is not synced between machines, and workspace settings cannot enable it.

Profile lookup uses the current GitHub CLI authentication for each host. Some accounts may be hidden from that credential. If a name or picture cannot load, you can still manage the account normally. Select Refresh to retry; recent failures have a short retry delay.

Avatars make additional HTTPS requests. Supported pictures are small PNG or JPEG images from the account's host, or GitHub's avatar service for GitHub.com. Enterprise pictures hosted elsewhere, requiring sign-in, or requiring a custom proxy or certificate configuration may keep the regular account icon.

Details are temporary and may take up to 15 minutes to refresh. Downloaded pictures are stored temporarily in the same local or remote environment. Turning avatars off removes this window's pictures; files left by an interrupted shutdown may remain until later cleanup.

Clear cached profile details

  1. Run GH Accounts: Clear Profile Cache, choose Clear Profile Cache from the sidebar's … menu, or use the main status-bar account menu.
  2. Cached display names and pictures disappear from this window. Your aliases, sign-ins and account status stay in place.
  3. Select Refresh when you want to load profile details again. Changing GH Accounts: Profile Details or restarting the extension host also resumes loading. The off setting keeps profile requests disabled.

Clearing applies only to this window's cache in the local or remote environment running GH Accounts. Other windows keep their own caches. If cached pictures cannot be deleted, the extension keeps them hidden and shows an error; try Clear Profile Cache again.

Add a local account alias

  1. Right-click an account and choose Set Account Alias. You can also run GH Accounts: Set Account Alias and choose an account, or use its status-bar account menu.
  2. Enter a short label, such as “Personal” or “Work”. Aliases can contain up to 50 characters.
  3. The alias appears beside the username in the sidebar and account pickers. Search for the alias when choosing an account.

Use Set Account Alias again to edit a label, or Remove Account Alias to remove it. The Command Palette also provides GH Accounts: Remove Account Alias.

Aliases work even when profile details are off or an authentication check fails. They label a known username on one GitHub host, including known environment-token identities. They do not rename your GitHub account or change sign-in, Git credentials, or commit author settings.

Labels are saved in the local or remote environment running GH Accounts. They are shared with other GH Accounts windows using that storage and are not synced to other machines. Select Refresh to see labels changed in another window. Signing out keeps the label for when you add the same account again; use Remove Account Alias to delete it.

Configure Git credentials for a host

Use this when you want Git HTTPS operations to authenticate through GitHub CLI.

  1. Right-click a host in the sidebar and select Configure Git Credentials for This Host. Alternatively, run GH Accounts: Configure Git Credentials for This Host and choose a host.
  2. Read the confirmation to check which host and local or remote environment will be affected.
  3. Select Configure to apply the change, or dismiss the dialog to leave the settings untouched.

The host needs an active saved account whose authentication check succeeded. Git will use the active GitHub CLI account; this action does not switch accounts or change your commit name, email, or SSH identity. Other repositories using the same Git credential settings can be affected.

If setup fails or is cancelled after starting, Git settings may already have changed. Check your Git credential settings before retrying. Previous settings are not backed up or automatically restored.

Log out

Use Log Out beside an account, or run GH Accounts: Log Out, choose the account, and confirm Log Out.

This removes its saved GitHub CLI sign-in from the current environment. It does not revoke the token on GitHub. If another account remains on that host, GitHub CLI may make it active.

Remote workspaces

In an SSH, WSL, Dev Container, or Codespaces workspace, GH Accounts manages accounts in that remote environment, which may differ from your desktop accounts. Check the view's Local or Remote: label before making changes.

GH Accounts requires a local or remote workspace. Restricted Mode, virtual workspaces, and browser-only sessions without a remote workspace are not supported.

Troubleshooting

  • GitHub CLI is missing or outdated: run GH Accounts: GitHub CLI Installation and Upgrade Help. After installing or updating it, restart VS Code (or reconnect to your remote environment), then select Refresh.
  • Accounts show Last known: the latest check failed, so the list may be out of date. Check your connection and select Refresh before relying on it.
  • Authentication error or Authentication check timed out: check your connection to the GitHub host. If needed, sign in again using Add Account, then select Refresh. A successful check does not guarantee access to every repository.
  • An environment token overrides an account: a token supplied through GH_TOKEN, GITHUB_TOKEN, GH_ENTERPRISE_TOKEN, or GITHUB_ENTERPRISE_TOKEN can take precedence over saved accounts. Adding, switching, logging out, and Git credential setup are blocked for the affected host. Change the relevant environment variable outside the extension, then restart VS Code or reconnect to the remote environment. Changing a variable in a separate terminal may not update VS Code.
  • The login terminal environment differs: review your VS Code terminal.integrated.env.* settings so the login terminal uses the same authentication environment as VS Code, then retry.
  • Sign-in was interrupted: cancel from the progress notification or terminate the GH Accounts terminal, select Refresh, and try Add Account again.

Help

For an explanation of account sharing and token overrides, run GH Accounts: About Shared Accounts and Environment Tokens.

For GitHub CLI commands and sign-in help, see the official GitHub CLI manual.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft