Logotipo de Github Multi Account

Github Multi Account

Comunidad
tamirdresher
github-multi-account

Transparent gh proxy that auto-routes commands to the correct GitHub account based on repo context. Uses GH_CONFIG_DIR isolation — no more account-switching chaos.

Descripción general

Editortamirdresher
Repositoriosquad-skills
Nombre de la habilidadgithub-multi-account
Estrellas
44
Forks
9
Archivos incluidos
4
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando una petición es realmente relevante.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • 4 archivos incluidos

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por tamirdresher en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Github Multi Account en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/tamirdresher/squad-skills/tree/main/plugins/github-multi-account
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → Desde URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tamirdresher/squad-skills.git /tmp/squad-skills
mkdir -p .claude/skills
cp -r /tmp/squad-skills/plugins/github-multi-account .claude/skills/github-multi-account
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Github Multi Account en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición es relevante, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Github Multi Account automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Github Multi Account no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición relevante, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

GitHub Multi-Account Proxy

Confidence: medium — proxy architecture is proven in production via ghe/ghp wrappers; the transparent layer is new.

Problem

When you have two GitHub accounts (EMU work + personal), every gh command risks running against the wrong identity. The original approach used gh auth switch aliases (ghp/ghw), but three friction points remained:

  1. Cognitive load — users must remember ghe vs ghp for every command
  2. Token expiry — expired tokens in ~/.config/gh-emu or ~/.config/gh-public silently break automation (including Ralph)
  3. Git credential gap — git push/pull uses the global credential helper, ignoring GH_CONFIG_DIR isolation

Solution

A transparent gh PowerShell function that intercepts every gh call, detects which account to use from the git remote URL, sets GH_CONFIG_DIR, and delegates to the real gh.exe. Combined with a token health monitor and git credential helper integration.

Key insight: The existing GH_CONFIG_DIR isolation architecture is 90% there — the proxy just makes it transparent. No new dependencies, zero changes to Ralph.

How It Works (with the proxy)

User/script types: gh pr list
    │
    ├─ Is GH_CONFIG_DIR already set? ──YES──► delegate to gh.exe (respect explicit choice)
    │                                          ◄── Ralph sets this in Step -1
    │                                          ◄── ghe/ghp set this explicitly
    │
    └─ NO → detect from git remote URL
         │
         ├─ Remote matches "tamirdresher_microsoft"
         │  └─► GH_CONFIG_DIR = ~/.config/gh-emu
         │
         ├─ Remote matches "tamirdresher/"
         │  └─► GH_CONFIG_DIR = ~/.config/gh-public
         │
         └─ No remote / no match
            └─► GH_CONFIG_DIR = ~/.config/gh-emu (default = work)

Components

ComponentFilePurpose
Transparent proxygh-proxy.ps1Auto-routes gh → correct GH_CONFIG_DIR
Token healthgh-proxy.ps1Test-GhTokenHealth / Repair-GhToken functions
Setup scriptsetup.ps1One-time installation of proxy + credential helper
Routing tableConfigurable in gh-proxy.ps1Maps remote URL patterns → config dirs

Routing Table

The proxy uses a regex routing table to match git remote URLs:

powershell
$script:GH_ROUTING_TABLE = @(
    @{ Pattern = 'tamirdresher_microsoft'; ConfigDir = "$HOME\.config\gh-emu";    Label = 'EMU' }
    @{ Pattern = 'tamirdresher/';          ConfigDir = "$HOME\.config\gh-public"; Label = 'Personal' }
)
$script:GH_DEFAULT_CONFIG = "$HOME\.config\gh-emu"  # Default to EMU (work context)

Token Health Monitor

Proactively check if tokens are valid before they break automation:

powershell
# Check all profiles
Test-GhTokenHealth

# Check specific profile
Test-GhTokenHealth -Profile emu

# Repair expired token (opens browser)
Repair-GhToken -Profile public

Git Credential Integration

After setup, git push/pull also respects GH_CONFIG_DIR:

powershell
git config --global credential.helper '!gh auth git-credential'

Setup

Quick Install

powershell
# From the plugin directory:
.\setup.ps1

# Or manually: dot-source the proxy in your $PROFILE
. "path\to\gh-proxy.ps1"
git config --global credential.helper '!gh auth git-credential'

Prerequisites

  • GitHub CLI (gh) installed and authenticated for both accounts
  • Isolated config dirs already created:
    • ~/.config/gh-emu/ — EMU/work account
    • ~/.config/gh-public/ — personal account
  • If not set up yet, run setup-gh-isolated-auth.ps1 first (from the team scripts)

Verify

powershell
# Token health check
Test-GhTokenHealth

# Should show both profiles healthy:
#   Name    Account                  Healthy Error
#   ----    -------                  ------- -----
#   emu     tamirdresher_microsoft   True
#   public  tamirdresher             True

# Test auto-routing (run from a personal repo)
cd ~/repos/some-personal-repo
gh api user --jq '.login'   # → tamirdresher

# Run from a work repo
cd ~/repos/some-emu-repo
gh api user --jq '.login'   # → tamirdresher_microsoft

Files

FileDescription
SKILL.mdThis skill document (AI reads this to understand the setup)
README.mdHuman-readable overview and install instructions
gh-proxy.ps1Transparent proxy function + token health monitor
setup.ps1One-time setup: installs proxy to $PROFILE, configures git credential helper
manifest.jsonPlugin metadata and version

Integration with Ralph

Ralph needs zero changes. Here's why:

  1. Ralph already sets GH_CONFIG_DIR in Step -1 (ralph-watch.ps1 lines 1086-1098)
  2. The proxy's FIRST check is "Is GH_CONFIG_DIR already set?" — if yes, it delegates immediately without overriding
  3. The proxy is a complete no-op when Ralph is running

Token Expiry Alerting

Add to Ralph's Step -1 for proactive monitoring:

powershell
$health = Test-GhTokenHealth -Profile $(if ($remoteUrl -match 'tamirdresher_microsoft') { 'emu' } else { 'public' })
if (-not $health.Healthy) {
    Write-Host "Token expired for $($health.Name). Manual re-auth needed." -ForegroundColor Red
}

Backward Compatibility

  • ghe / ghp explicit wrappers continue to work (they set GH_CONFIG_DIR, proxy respects it)
  • gh-auto-context.ps1 prompt hook becomes OPTIONAL (proxy handles auto-detection)
  • CMD wrappers (gh-emu.cmd, gh-personal.cmd) unchanged
  • Agents can gradually switch from ghe/ghp to bare gh for in-repo commands

For Squad Agents

You no longer need to use ghe/ghp for in-repo commands. The transparent proxy auto-detects the correct account. Use bare gh freely:

powershell
# These all auto-route correctly based on repo context:
gh pr list
gh issue create --title "Fix bug"
gh api user --jq '.login'

Still use ghe/ghp when:

  • Running commands outside a git repo (e.g., ghe repo list)
  • Explicitly targeting a specific account regardless of repo context

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Se ofrecen como archivos de lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Github Multi Account?

Transparent gh proxy that auto-routes commands to the correct GitHub account based on repo context. Uses GH_CONFIG_DIR isolation — no more account-switching chaos.

¿Por qué usar Github Multi Account en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Github Multi Account está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Github Multi Account en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/tamirdresher/squad-skills/tree/main/plugins/github-multi-account. TypingMind lee su archivo SKILL.md, empaqueta sus archivos y la instala como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Github Multi Account?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Github Multi Account?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Github Multi Account con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Github Multi Account?

Sí. tamirdresher la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇