gh-auth-isolation

Manage multiple GitHub identities and switch contexts for secure operations.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/nicolehaugen/CustomMetricsDashboard --skill gh-auth-isolation-nicolehaugen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-auth-isolation
Source: https://github.com/nicolehaugen/CustomMetricsDashboard/tree/main/.squad/templates/skills/gh-auth-isolation
Command: npx skills add https://github.com/nicolehaugen/CustomMetricsDashboard --skill gh-auth-isolation-nicolehaugen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gh, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill solves the issue of managing multiple GitHub identities, such as EMU and personal accounts, within agent workflows to prevent credential mixing and ensure secure operations.

Core Features & Use Cases

  • Identity Detection: Automatically detect and switch between GitHub identities.
  • Token Extraction: Safely extract tokens for specific accounts without changing the active context.
  • Push to Personal Repos: Execute operations with the correct GitHub account by default, even from an EMU environment.
  • PR Creation on Forks: Create pull requests on personal forks from the correct account.
  • Config Directory Isolation: Ensure complete isolation between different GitHub accounts.
  • Quick Switching: Use shell aliases for quick context switching.
  • Security Guidelines: Follows best practices to avoid security risks such as hardcoded tokens and unauthorized access.

Quick Start

Use the gh-auth-isolation skill to switch to your personal GitHub account and create a pull request on a forked repository.

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 in automated agent workflows?

Managing multiple GitHub accounts in agent workflows requires isolating credentials and config directories to prevent context mixing. This Skill detects identities and switches contexts automatically, ensuring operations execute under the correct user without manual token handling.

Why does my GitHub CLI push to the wrong account from an EMU environment?

Pushing from an EMU environment with the wrong identity happens when credential contexts overlap. Config directory isolation separates EMU and personal accounts, allowing pushes to personal repositories to execute with the correct GitHub user by default.

Can I create pull requests on personal forks without switching my default GitHub CLI login?

Creating pull requests on personal forks without switching your default login is possible through safe token extraction. The Skill retrieves the specific account token needed for the fork operation without altering the active global GitHub CLI context.

Do I need the GitHub CLI installed to isolate authentication tokens for multiple identities?

Yes, GitHub CLI is a required dependency for isolating authentication tokens. The Skill leverages the GitHub CLI framework and your existing authentication tokens to detect identities, switch contexts, and maintain secure multi-account operations.

What is the best way to prevent credential mixing between GitHub EMU and personal accounts?

Preventing credential mixing between EMU and personal accounts requires strict config directory isolation and automated identity detection. This approach follows security guidelines to avoid hardcoded tokens and ensures each GitHub action maintains the correct user context.

Are there limitations to using shell aliases for quick GitHub account switching?

Shell aliases provide quick context switching between GitHub accounts, but limitations arise if security guidelines are not followed. Avoid hardcoded tokens and ensure complete config directory isolation to prevent unauthorized access during automated agent workflows.