Problem
gh supports multiple authenticated accounts but requires manual gh auth switch every time you move between repos owned by different accounts. This is a constant source of friction — 404s, PRs attributed to the wrong account, CI triggered under the wrong identity.
Anyone managing separate personal and work GitHub accounts (which is extremely common) hits this daily.
Expected Behavior
gh should automatically select the correct authenticated account based on the current repo context. Two natural resolution strategies:
git config github.account — works with git's existing includeIf / conditional includes, zero new config surface
- Remote origin org matching — map orgs to accounts in gh config, zero per-repo setup
Either way: cd into a repo, run gh pr create, correct account is used. No manual switching.
Current Workaround
A shell wrapper that calls gh auth switch before every invocation. It works but:
- Mutates global state (not safe for concurrent terminal sessions)
- Adds latency to every
gh command
- Shouldn't be necessary for something this fundamental
Prior Art
The implementation is trivial — a single check in ActiveUser() before falling back to the stored active user. A working PR already exists. This should be a priority for the multi-account experience.
Problem
ghsupports multiple authenticated accounts but requires manualgh auth switchevery time you move between repos owned by different accounts. This is a constant source of friction — 404s, PRs attributed to the wrong account, CI triggered under the wrong identity.Anyone managing separate personal and work GitHub accounts (which is extremely common) hits this daily.
Expected Behavior
ghshould automatically select the correct authenticated account based on the current repo context. Two natural resolution strategies:git config github.account— works with git's existingincludeIf/ conditional includes, zero new config surfaceEither way:
cdinto a repo, rungh pr create, correct account is used. No manual switching.Current Workaround
A shell wrapper that calls
gh auth switchbefore every invocation. It works but:ghcommandPrior Art
help wanted, not because of any technical concernincludeIfThe implementation is trivial — a single check in
ActiveUser()before falling back to the stored active user. A working PR already exists. This should be a priority for the multi-account experience.