gh-auth-isolation

Detect active GitHub identity and isolate credentials with gh auth and GH_CONFIG_DIR.

3|5|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/ronniegeraghty/hyoka --skill gh-auth-isolation-ronniegeraghty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-auth-isolation
Source: https://github.com/ronniegeraghty/hyoka/tree/main/.agents/skills/gh-auth-isolation
Command: npx skills add https://github.com/ronniegeraghty/hyoka --skill gh-auth-isolation-ronniegeraghty

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

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

Core Features & Use Cases

  • Detect active identity with gh auth status and verify accounts
  • Extract and reuse tokens for specific accounts without switching defaults
  • Isolate credentials per-session using GH_CONFIG_DIR and environment scoping
  • Support safe PRs and pushes from personal forks while default is EMU

Quick Start

Run a multi-account GitHub operation by first detecting the active identity, then isolating the environment and performing actions under the correct account.

Frequently Asked Questions about gh-auth-isolation

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

FAQPage Schema
How do I manage multiple GitHub accounts with gh CLI to prevent credential leakage?

You can manage multiple GitHub accounts by isolating credentials using separate GH_CONFIG_DIR configurations and environment scoping, preventing cross-account credential leakage during agent workflows.

How does gh auth status detect the active GitHub identity for agent workflows?

The gh auth status command detects the active GitHub identity by verifying accounts, enabling agent workflows to safely switch contexts before performing pushes, PRs, and repo operations.

What is the best way to push from a personal fork while my default gh CLI account is EMU?

To push from a personal fork while defaulting to an EMU account, isolate the environment using GH_CONFIG_DIR and extract tokens for the specific personal account without switching defaults.

Can I extract and reuse GitHub tokens for specific accounts without switching the default login?

Yes, you can extract and reuse tokens for specific accounts without switching defaults by using gh auth token alongside scoped context switching, ensuring safe identity handling in multi-account environments.

When do I need to use separate GH_CONFIG_DIR configurations for GitHub identity switching?

You need separate GH_CONFIG_DIR configurations when working in multi-account environments requiring both EMU and personal accounts, ensuring credentials are isolated per-session to avoid leakage.