![]() |
A GitHub CLI account switcher with interactive selection and SSH signing key setup. |
ghp is a small command line account manager for GitHub CLI.
Use it to switch between accounts already authenticated with gh, add another
account, or create an SSH signing key for an account.
- Switch accounts directly or choose one from an interactive
fzfmenu. - List accounts and inspect the active account's authentication status.
- Start or end a GitHub CLI login session.
- Create or reuse an Ed25519 SSH key for GitHub commit signing.
- Target GitHub Enterprise with
GH_HOST. - Install as a single executable; no build step or dotfiles repository required.
| Dependency | Needed for |
|---|---|
| Bash 3.2 or later | Running ghp (available by default on macOS and Linux) |
| GitHub CLI | Account and authentication commands |
| fzf | Interactive account picker |
ssh-keygen |
ghp signing-key |
curl |
Remote install, update, and uninstall scripts |
Authenticate accounts with gh auth login before switching between them.
Install the latest version directly:
curl -fsSL https://raw.githubusercontent.com/Bedatty-Engineering/ghp/main/scripts/install.sh | bashTo choose another installation directory, set GHP_INSTALL_DIR:
curl -fsSL https://raw.githubusercontent.com/Bedatty-Engineering/ghp/main/scripts/install.sh | GHP_INSTALL_DIR="$HOME/bin" bashYou can also clone the repository and install from the checkout:
git clone https://github.com/Bedatty-Engineering/ghp.git
cd ghp
./scripts/install.shThe installer copies ghp to ~/.local/bin. Add that directory to PATH if
it is not already there. To install somewhere else, pass a destination:
./scripts/install.sh "$HOME/bin"Update the installed command from a checkout:
./scripts/update.shOr run the updater directly from GitHub:
curl -fsSL https://raw.githubusercontent.com/Bedatty-Engineering/ghp/main/scripts/update.sh | bashFor a custom installation directory, pass it as an argument or set
GHP_INSTALL_DIR. The updater checks for an existing installation and only
replaces it after validating the downloaded script.
Remove the default installation from a checkout with:
./scripts/uninstall.shFor a custom directory, pass the path or set GHP_INSTALL_DIR. The remote
uninstaller is also available:
curl -fsSL https://raw.githubusercontent.com/Bedatty-Engineering/ghp/main/scripts/uninstall.sh | bashYou can also run ./ghp directly from a checkout without installing it.
ghp # Open the interactive menu
ghp use <account> # Switch to an account
ghp list # List authenticated accounts
ghp status # Show the active account and auth status
ghp login # Authenticate another account
ghp logout [account] # Log out (defaults to the active account)
ghp signing-key [account] # Create or reuse an SSH signing key
ghp help # Show all commandsThe interactive menu needs fzf. All other commands work without it.
Set GH_HOST for a single command or export it for the shell session:
GH_HOST=github.example.com ghp status
export GH_HOST=github.example.comThe default host is github.com.
ghp signing-key [account] creates a new Ed25519 key under ~/.ssh or updates
the comment on an existing generated key for that host and account. The command
prints the steps to add the public key to GitHub as a Signing Key. It does
not upload keys; keep the private key file private. On macOS, use the printed
pbcopy command to copy the public key. On Linux, display it with
cat ~/.ssh/<public-key-file> and copy the output.
The repository contains no account names, authentication data, or machine-specific paths. Authentication stays in GitHub CLI. Generated signing keys stay on the local machine.
MIT. See LICENSE.
