GitID is a CLI for creating, listing, inspecting, and switching Git SSH identities on one machine.
It is designed for people who regularly work across personal, work, and client repositories and want a simple way to manage SSH aliases without manually editing remotes every time.
GitID edits ~/.ssh/config, creates ed25519 SSH keys, and updates repository remotes to use your selected SSH host alias.
It can also manage repository-local git config user.name and git config user.email per identity.
Caution: GitID modifies SSH configuration. Back up ~/.ssh before using it for the first time.
npm install -g gitidCreate an identity:
gitid new personal --name "Jane Doe" --email jane@example.comList configured identities:
gitid listSwitch the current repository to a different SSH identity:
gitid use personalShow the public key so you can add it to GitHub or another Git provider:
gitid show personalStore or update the git author used when that identity is selected:
gitid set personal --name "Jane Doe" --email jane@example.comEnable shell tab completion:
gitid completion zsh > "${fpath[1]}/_gitid"
autoload -Uz compinit && compinitCreates a new ed25519 SSH identity and adds a matching Host entry to ~/.ssh/config.
You can also set git author metadata during creation with --name and --email.
Example:
gitid new workLists the SSH host aliases GitID can manage from your SSH config.
If GitID detects an outdated or broken config entry, it prints a repair prompt showing the Host block you should restore.
Prints the SSH identity currently used by the repository in your current working directory.
Updates the current repository's origin remote to use the selected SSH alias.
If the identity has managed git author settings, GitID applies them to the current repository's local git config.
GitID preserves nested repository paths and supports remotes with or without the .git suffix.
Example:
gitid use workTo skip author metadata for a one-off switch:
gitid use work --skip-authorReads the matching IdentityFile from ~/.ssh/config and prints the public key contents.
Example:
gitid show workStores git author metadata for an identity so gitid use <identity> can apply it to the current repository.
Examples:
gitid set work --name "Jane Doe" --email jane@example.com
gitid set work --clear-email--clear-name and --clear-email tell GitID to unset the local repo value for that field the next time the identity is applied.
Prints a shell completion script that adds tab completion for commands, shells, and identity aliases.
Examples:
gitid completion bash >> ~/.bashrc
source ~/.bashrcmkdir -p ~/.zsh/completions
gitid completion zsh > ~/.zsh/completions/_gitid
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinitGitID now handles several older real-world config cases more safely:
- exact alias matching instead of substring matching
- legacy
gitta_<identity>key paths from early releases - broken historical
IdentityFilepaths created by older GitID versions - clearer repair prompts when the SSH config is out of sync with the local key files
- managed git author metadata that can be reapplied when a repository drifts out of sync
If a config entry is unsupported or broken, GitID will not silently continue. It will tell you what is wrong and print the Host block that should be restored in ~/.ssh/config.
GitID is your solution if you are:
- Having a hard time managing multiple Git identity files on a single user account
- Struggling with permission issues when accidentally pushing from a wrong identity file
- Tired of having to modify git URLs every time you clone or add a new remote
First, clone the repository:
git clone https://github.com/inderdeepbajwa/gitid.git
cd gitidThen install the dependencies:
npm installFinally, build the code:
npm run buildRun the tests:
npm test -- --runInBandThis CLI is meant for managing SSH identities on a single machine, the identity names you use are local to your machine and do not have to correspond to your actual GitHub username.