You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: per-command user selection (--user flag) #13088
Describe the feature or problem you'd like to solve
When multiple accounts are authenticated via gh auth login, the only way to use a specific account is to switch globally with gh auth switch. This is cumbersome when you frequently need to alternate between accounts (e.g., a personal account and an Enterprise Managed User) within the same terminal session.
Enterprise Managed Users who need to interact with both EMU-org repos and personal repos
CI scripts that need deterministic account selection without global state mutation
Shell aliases/functions that target specific accounts
How will it benefit CLI and its users?
Eliminates the error-prone switch → command → switch back pattern
Enables concurrent multi-account usage in scripts without race conditions
No global state mutation — pure, predictable command behavior
Additional context
Related to #326 (multiple account credentials). This proposal is a narrower, more immediately actionable enhancement that works with the existing gh auth switch infrastructure — it just needs a way to override the active account per-invocation rather than only globally.
The GH_TOKEN env var partially addresses this but requires managing raw PATs. A --user flag would work with the credentials already stored by gh auth login.
changed the title [-]Feature: per-command account selection (--account flag or GH_USER env var)[/-][+]Feature: per-command user selection (--user flag)[/+]on Apr 3, 2026
Activity
[-]Feature: per-command account selection (--account flag or GH_USER env var)[/-][+]Feature: per-command user selection (--user flag)[/+]Add global --account flag for per-invocation user override
sergiou87 commentedon Apr 6, 2026
Hello! This feels like a duplicate of #12145 so I'm gonna close this one in favor of it. Happy to reopen if my assessment is wrong!
GH_USERenv var #12145