gh-autoaccount: GitHub account selection for terminals and agents
A GitHub CLI extension that selects an account by directory or repository owner without changing the global account. Includes a skill, JSON diagnostics and guards for local agents.
AI-assisted translation, approved by Mateo.

I published gh-autoaccount, a GitHub CLI extension that selects an account by directory or repository owner. The idea is to work with personal and work accounts without having to change the global account through gh auth switch, especially with several terminals or agents active.
What this beta includes
- Per-command routing for
ghand a credential helper for Git HTTPS. - Rules by directory, GitHub organization or user, plus a default account.
- A bundled agent skill, JSON diagnostics and guards to require an account and verify its login before an action starts.
- Operation without direnv or prompt hooks; agents need the shim on their PATH.
The available version when writing this announcement is v0.1.0-beta.9. It is an external alternative, not an official feature built into GitHub CLI. Behavior may change before 1.0.
Technical guide and demo
I put together a post covering the architecture, setup steps and demo. The cover is an editorial illustration. The project's demo uses the real binary with simulated accounts and API responses, recorded offline; it does not prove live authentication.
I am looking for feedback from people using multiple accounts, particularly with local agents. Functional problems belong in Issues; security reports should use the private channel.
Thanks for reading. The learning continues in the next article.

