github-multi-account

Configures account-locked gh CLI aliases for switching between personal and work GitHub accounts.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/codebytes/btt --skill github-multi-account-codebytes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-multi-account
Source: https://github.com/codebytes/btt/tree/main/.squad/templates/skills/github-multi-account
Command: npx skills add https://github.com/codebytes/btt --skill github-multi-account-codebytes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers with multiple GitHub accounts (personal and work/EMU) often run gh CLI commands under the wrong identity, causing commits, PRs, and repo operations to be attributed to the wrong account. This Skill detects the signed-in accounts and sets up account-locked aliases so every command targets the correct identity. ## Core Features & Use Cases - Account Detection: Runs gh auth status to list all authenticated GitHub accounts and asks the user which is personal and which is work. - Automated Alias Setup: Writes gh-personal/gh-work PowerShell functions into the user profile, creates ghp.cmd/ghw.cmd wrappers in a bin directory, and adds that directory to the user PATH. - Verification & Enforcement: Verifies each alias with gh api user and enforces usage rules so repo operations always use the correct account-bound alias. - Use Case: A developer who contributes to open source with a personal account and to employer repos with a work account can run ghp for personal repos and ghw for work repos without ever manually switching auth. ## Quick Start Ask the assistant to detect my GitHub accounts and set up the ghp and ghw aliases for my personal and work accounts.

Frequently Asked Questions about github-multi-account

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

FAQPage Schema
How do I use multiple GitHub accounts with the gh CLI?

Authenticate both accounts with gh auth login, then create account-locked aliases that run gh auth switch before each command. This Skill automates that by generating gh-personal and gh-work functions plus ghp and ghw shortcuts.

How to switch GitHub accounts automatically per repository?

Bind each repository to an account and always use the matching alias, such as ghp for personal repos and ghw for work repos. The alias runs gh auth switch to the correct user before forwarding your gh command.

Does this work with PowerShell and CMD on Windows?

Yes. It adds gh-personal and gh-work functions to the PowerShell profile and creates ghp.cmd and ghw.cmd wrapper scripts in a bin directory added to the user PATH, so both shells can use the aliases.

Why do my gh commands use the wrong GitHub account?

The gh CLI has a single active account per host, so commands default to whichever account was last switched to. Account-locked aliases fix this by switching to the intended user immediately before every command.

Can I still run plain gh commands after setup?

You can, but the Skill's usage rules say to never use bare gh for repo operations and never manually run gh auth switch. Always use ghp or ghw so the correct identity is guaranteed.