gh-auth-isolation

Detect active GitHub identities and isolate tokens for multi-account workflows.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/Leep-GH/Lee-s-squad --skill gh-auth-isolation-leep-gh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-auth-isolation
Source: https://github.com/Leep-GH/Lee-s-squad/tree/main/packages/squad-cli/templates/skills/gh-auth-isolation
Command: npx skills add https://github.com/Leep-GH/Lee-s-squad --skill gh-auth-isolation-leep-gh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Workflows that run across Enterprise Managed User (EMU) and personal GitHub accounts often default to the EMU identity, causing operations to fail on personal repos or forks. This skill provides a reliable strategy to detect the active identity and isolate credentials so each operation runs with the intended account.

Core Features & Use Cases

  • Detect current identity and confirm which GitHub account is active before any operation.
  • Extract and use a specific account's token for targeted actions without changing the global default.
  • Create safe, isolated contexts (config directories and environment variables) to prevent cross-account credential leakage.
  • Provide practical patterns for common tasks: pushing to personal forks, creating PRs from personal branches, and working with multiple repos in parallel.
  • Support shell-level aliases and per-session isolation to simplify multi-account workflows for agents.

Quick Start

Switch to the appropriate GitHub identity for the current operation using gh config and temporary environment isolation.

Frequently Asked Questions about gh-auth-isolation

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

FAQPage Schema
How do I switch GitHub accounts in multi-agent workflows without leaking credentials?

To switch GitHub accounts safely, you can isolate credentials using temporary config directories and environment variables. This prevents cross-account credential leakage by ensuring each agent operation runs with the intended identity rather than the global default.

Why does my GitHub CLI default to my EMU account when pushing to personal forks?

GitHub CLI defaults to your EMU account because workflows running across Enterprise Managed User and personal accounts often default to the EMU identity. You need to detect the active identity and isolate credentials before pushing to personal forks.

How do I extract a specific GitHub token for targeted actions without changing the global default?

You can extract a specific account's token using the GitHub CLI token command. This allows you to use the targeted token for actions like creating PRs without altering your global default authentication settings.

Does this multi-account GitHub authentication isolation work with parallel repository operations?

Yes, this approach supports working with multiple repositories in parallel. It creates safe, isolated contexts using config directories and environment variables to prevent credential leakage across concurrent multi-account operations.

What is the best way to manage GitHub identity isolation for automated agents?

The best way to manage GitHub identity isolation is to detect the active identity first, then use isolated config contexts and shell-level aliases. This provides robust fallbacks and clear error paths for automated agent workflows.

What happens if GitHub authentication detection fails during an isolated multi-account workflow?

If GitHub authentication detection fails, the workflow provides robust fallbacks and clear error paths. This ensures that operations do not proceed with incorrect credentials, preventing failed pushes or PRs across EMU and personal accounts.