Skip to content
Bedatty-EngineeringPublic

About

A GitHub CLI account manager with an interactive picker and SSH signing key setup.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bedatty Engineering

ghp

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.

Contents

Features

  • Switch accounts directly or choose one from an interactive fzf menu.
  • 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.

Requirements

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

Install the latest version directly:

curl -fsSL https://raw.githubusercontent.com/Bedatty-Engineering/ghp/main/scripts/install.sh | bash

To 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" bash

You can also clone the repository and install from the checkout:

git clone https://github.com/Bedatty-Engineering/ghp.git
cd ghp
./scripts/install.sh

The 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

Update the installed command from a checkout:

./scripts/update.sh

Or run the updater directly from GitHub:

curl -fsSL https://raw.githubusercontent.com/Bedatty-Engineering/ghp/main/scripts/update.sh | bash

For 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.sh

For 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 | bash

You can also run ./ghp directly from a checkout without installing it.

Usage

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 commands

The interactive menu needs fzf. All other commands work without it.

GitHub Enterprise

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.com

The default host is github.com.

SSH signing keys

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.

Privacy

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.

License

MIT. See LICENSE.

About

A GitHub CLI account manager with an interactive picker and SSH signing key setup.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages