Skip to content
$ gitswitch
Nord
★ star

Profiles

A profile is a named collection of git identity settings:

  • Display name
  • Email address
  • SSH key (optional)
  • GPG signing key (optional)
  • GitHub username (optional)
FieldRequiredExampleNotes
NicknameYesworkShort name, no spaces. Shown in TUI and CLI.
Full NameYesAlice SmithName on commits. Can include spaces.
EmailYesalice@company.comEmail on commits. Should match GitHub/git identity.
SSH KeyNo~/.ssh/id_workPath to SSH private key. Can include ~ or $HOME.
GPG KeyNo1234567890ABCDEF16-character GPG key ID.
GitHub UserNoalice-workGitHub username for gh auth switch integration.
Terminal window
gitswitch
# Press 'a' to add
# Fill in fields with arrow keys + Tab
Terminal window
gitswitch add work "Alice Smith" alice@company.com \
--ssh-key ~/.ssh/id_work \
--gpg-key 1234567890ABCDEF \
--gh-user alice-work

Only name, email, and nickname are required:

Terminal window
gitswitch add personal "Alice" alice@gmail.com

Profiles are stored at:

~/.config/gitswitch/profiles.json

Example structure:

{
"profiles": [
{
"nickname": "personal",
"name": "Alice",
"email": "alice@gmail.com",
"sshKey": "",
"gpgKey": "",
"githubUser": ""
},
{
"nickname": "work",
"name": "Alice Smith",
"email": "alice@company.com",
"sshKey": "~/.ssh/id_work",
"gpgKey": "1234567890ABCDEF",
"githubUser": "alice-work"
}
]
}

You can edit this file manually if needed (edit carefully!).

Terminal window
gitswitch list

Shows all profiles with their email addresses.

Terminal window
gitswitch current

Displays the active profile (nickname and email).

Terminal window
gitswitch
# Select profile, press 'e' to edit

Or CLI (when available):

Terminal window
gitswitch edit work
# (Note: currently only TUI editing is supported)
Terminal window
gitswitch
# Select profile, press Ctrl+D to delete (in edit mode)

Or CLI:

Terminal window
gitswitch remove work
  • No spaces or special characters (keep it simple)
  • Lowercase recommended (easier to type)
  • Examples: work, personal, clienta, oss
  • Can include spaces (e.g., Alice Smith)
  • Appears on every commit you make
  • Should match GitHub for better attribution
  • Must be a valid email address
  • Should match your GitHub account (or work/personal accounts)
  • Appears on every commit you make
  • Can differ from SSH key email (git config and SSH are separate)
  • Path to private key (not public key)
  • Must be readable by your user
  • Can use ~ for home directory
  • Optional — if not set, SSH agent handles key selection

Example paths:

  • ~/.ssh/id_work
  • /Users/alice/.ssh/id_rsa
  • $HOME/.ssh/id_custom
  • 16-character GPG key ID (from gpg --list-secret-keys --keyid-format LONG)
  • Must exist in your keyring (from gpg --list-keys)
  • Optional — if not set, no signing key is forced
  • Example: 1234567890ABCDEF

To find your GPG key ID:

Terminal window
gpg --list-secret-keys --keyid-format LONG
# Output:
# sec rsa4096/1234567890ABCDEF 2023-01-15 [SC]
# 1234567890ABCDEF1234567890ABCDEF12345678

Use the 16-character ID after the slash.

  • Your GitHub username (not email)
  • Used for gh auth switch integration
  • Optional — if not set, GitHub CLI is not switched
  • Example: alice-work or alice-personal

Check your GitHub username:

Terminal window
gh auth status
# Shows your authenticated accounts
Terminal window
gitswitch add clienta "Your Name" you@clienta.com \
--ssh-key ~/.ssh/id_clienta
gitswitch add clientb "Your Name" you@clientb.com \
--ssh-key ~/.ssh/id_clientb
gitswitch add personal "Your Name" you@personal.com

Switch before working:

Terminal window
cd ~/clienta-project
gitswitch clienta
cd ~/clientb-project
gitswitch clientb
Terminal window
gitswitch add work "Alice" alice@company.com \
--ssh-key ~/.ssh/id_work \
--gh-user alice-work
gitswitch add oss "Alice" public@github.com \
--ssh-key ~/.ssh/id_oss \
--gh-user alice-oss
Terminal window
gitswitch add personal "Alice" alice@gmail.com \
--ssh-key ~/.ssh/id_personal \
--gh-user alice
gitswitch add work "Alice" alice@company.com \
--ssh-key ~/.ssh/id_work \
--gh-user alice-corp

Each gitswitch command switches git identity, SSH key, and GitHub account.

CLI Reference
Configuration
Quick Start