gh-auth-isolation

Solid

Safely manage multiple GitHub identities (EMU + personal) in agent workflows

AI & Automation 58 stars 15 forks Updated 2 weeks ago MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
59
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

## Context Many developers use GitHub through an Enterprise Managed User (EMU) account at work while maintaining a personal GitHub account for open-source contributions. AI agents spawned by Squad inherit the shell's default `gh` authentication — which is usually the EMU account. This causes failures when agents try to push to personal repos, create PRs on forks, or interact with resources outside the enterprise org. This skill teaches agents how to detect the active identity, switch contexts safely, and avoid mixing credentials across operations. ## Patterns ### Detect Current Identity Before any GitHub operation, check which account is active: ```bash gh auth status ``` Look for: - `Logged in to github.com as USERNAME` — the active account - `Token scopes: ...` — what permissions are available - Multiple accounts will show separate entries ### Extract a Specific Account's Token When you need to operate as a specific user (not the default): ```bash # Get the personal account token (by username) gh auth token --user personaluser # Get the EMU account token gh auth token --user corpalias_enterprise ``` **Use case:** Push to a personal fork while the default `gh` auth is the EMU account. ### Push to Personal Repos from EMU Shell The most common scenario: your shell defaults to the EMU account, but you need to push to a personal GitHub repo. ```bash # 1. Extract the personal token $token = gh auth token --user personaluser ...

Details

Author
DanWahlin
Repository
DanWahlin/ai-agent-board
Created
6 months ago
Last Updated
2 weeks ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category