gh-auth-isolation
SolidSafely manage multiple GitHub identities (EMU + personal) in agent workflows
AI & Automation 58 stars
15 forks Updated 2 weeks ago MIT
Install
Quality Score: 87/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
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
AI & Automation Listed
gh-auth-isolation
Safely manage multiple GitHub identities (EMU + personal) in agent workflows
5 Updated 2 weeks ago
webmaxru AI & Automation Listed
github-auth
GitHub auth setup: HTTPS tokens, SSH keys, gh CLI login.
0 Updated 1 months ago
988hj7tczd-oss AI & Automation Listed
github-multi-account
Detect and set up account-locked gh aliases for multi-account GitHub. The AI reads this skill, detects accounts, asks the user which is personal/work, and runs the setup automatically.
5 Updated 2 weeks ago
webmaxru