github-multi-account

Configures account-locked gh CLI aliases for switching between multiple GitHub accounts.

2|Updated Jul 24, 2026
One-click install
npx skills add https://github.com/elbruno/ElBruno.MagenticUI --skill github-multi-account-elbruno
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: github-multi-account
Source: https://github.com/elbruno/ElBruno.MagenticUI/tree/main/.squad/templates/skills/github-multi-account
Command: npx skills add https://github.com/elbruno/ElBruno.MagenticUI --skill github-multi-account-elbruno

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers with both personal and work GitHub accounts must constantly run gh auth switch and risk pushing commits or opening PRs under the wrong identity. This Skill detects multiple authenticated accounts and sets up permanent account-locked aliases so the right identity is always used. ## Core Features & Use Cases - Account Detection: Runs gh auth status to list all authenticated GitHub accounts and asks the user which is personal and which is work. - Automated Alias Setup: Creates ghp/gh-personal and ghw/gh-work PowerShell functions, CMD wrappers in a user bin directory, and adds that directory to the user PATH. - Verification & Enforcement: Verifies each alias with gh api user and enforces rules so repo operations always use the correct account-bound alias. - Use Case: A consultant with a personal GitHub account and a company EMU account runs the setup once, then uses ghp for personal repos and ghw for work repos without ever manually switching auth. ## Quick Start Ask the AI to detect my GitHub accounts and set up the ghp and ghw multi-account aliases for me.

Frequently Asked Questions about github-multi-account

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch between multiple GitHub accounts with the gh CLI?▼

Use account-locked aliases like ghp and ghw that run gh auth switch before every command. This Skill creates those aliases automatically as PowerShell functions and CMD wrappers after detecting your accounts with gh auth status.

How do I set up gh aliases for personal and work GitHub accounts?▼

Run gh auth status to confirm both accounts are authenticated, then let the setup write gh-personal and gh-work functions into your PowerShell profile plus ghp.cmd and ghw.cmd wrappers added to your user PATH.

Does this work on Windows PowerShell and CMD?▼

Yes, the setup creates PowerShell profile functions for interactive shells and CMD batch wrappers in a user bin directory for cmd.exe usage. The bin directory is appended to the user PATH so both alias styles resolve.

Why did my commit or PR go to the wrong GitHub account?▼

The gh CLI uses a single active account, so operations run under whichever identity was last switched to. Using account-locked aliases like ghp and ghw prevents this by switching to the correct user before every command.

Can I bind a specific repository to one GitHub account?▼

Yes, the Skill supports repo-specific account binding so all gh operations in that repository must use a designated alias such as ghp. Agents can also define the account functions at the top of any script touching GitHub.