gh-auth-isolation

Manage multiple GitHub identities with isolated gh config directories.

2|1|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/PlagueHO/plagueho.learn --skill gh-auth-isolation-plagueho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-auth-isolation
Source: https://github.com/PlagueHO/plagueho.learn/tree/main/.copilot/skills/gh-auth-isolation
Command: npx skills add https://github.com/PlagueHO/plagueho.learn --skill gh-auth-isolation-plagueho

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safely manage multiple GitHub identities (EMU + personal) in agent-driven workflows by avoiding cross-account credential leakage and failed operations.

Core Features & Use Cases

  • Detect the active identity with gh auth status and route actions to the appropriate account.
  • Extract per-user tokens on demand using gh auth token --user <username> to perform isolated operations.
  • Push to personal repositories or forks from an environment where the default auth belongs to a different account, without exposing credentials.
  • Configure isolated gh config directories for complete separation between accounts (GH_CONFIG_DIR).
  • Quick switching with shell aliases to keep EMU and personal accounts distinct across agents.

Quick Start

Verify the active GitHub identity with gh auth status, then switch to the personal account and fetch a token with gh auth token --user personaluser for operations.

Frequently Asked Questions about gh-auth-isolation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent GitHub credential leakage when using multiple accounts in automation workflows?

To prevent GitHub credential leakage in automation workflows, isolate identities by extracting per-user tokens on demand and configuring isolated gh config directories. This ensures correct account context for each operation without mixing credentials.

How do I push to a personal GitHub fork from an environment where the default auth belongs to an EMU account?

Push to a personal GitHub fork from an EMU default environment by checking the active identity with gh auth status, then fetching a specific token using gh auth token --user <username> to perform the isolated push operation safely.

What is the best way to manage multiple GitHub identities in agent workflows?

The best way to manage multiple GitHub identities in agent workflows is using per-user token extraction and optional config isolation via GH_CONFIG_DIR, keeping EMU and personal accounts distinct across agents to prevent failed operations.

Do I need the gh tooling installed to isolate GitHub accounts in my automation scripts?

Yes, you need the gh tooling installed to isolate GitHub accounts in automation scripts. The process relies on gh auth status to detect active identities and gh auth token to extract per-user credentials for isolated operations.

Can I use shell aliases to switch between GitHub EMU and personal accounts for separate agents?

Yes, you can use shell aliases to quickly switch between GitHub EMU and personal accounts, keeping them distinct across agents. This works alongside isolated gh config directories for complete credential separation.