Quick Start
1. Open the TUI
Section titled “1. Open the TUI”gitswitchFirst run automatically imports your current git config as a default profile.
You’ll see an interactive interface where you can:
- ↑/↓ to navigate profiles
enterto switch to a profileato add a new profilecto cycle color themes?to see the quick reference
2. Add a profile
Section titled “2. Add a profile”Press a in the TUI to add a new profile. You’ll be prompted for:
- Nickname — short name like
work,oss,client-a - Full Name — name to appear on commits
- Email — git commit email
- SSH Key (optional) — path to SSH private key
- GPG Key (optional) — GPG signing key ID
- GitHub Username (optional) — for
gh auth switchintegration
Example:
gitswitch add work "Alice Smith" alice@company.com \ --ssh-key ~/.ssh/id_work \ --gh-user alice-work3. Switch profiles
Section titled “3. Switch profiles”Interactive TUI
Section titled “Interactive TUI”gitswitchUse arrow keys to select a profile and press enter to switch.
Quick switch (no UI)
Section titled “Quick switch (no UI)”gitswitch workSwitches immediately and exits. Perfect for scripts or when you already know the profile.
4. Set up shell integration
Section titled “4. Set up shell integration”One command sets up everything:
gitswitch installThis adds:
- Prompt segment — shows your active identity in your shell prompt
- Identity nudge — when you
cdinto a repo, suggests the identity you usually use there - Tab completion — complete
gitswitchcommands and profile names
Supports: Starship, oh-my-zsh, Powerlevel10k, raw zsh/bash/fish.
After running, reload your shell:
source ~/.zshrc # or open a new terminalCommon workflows
Section titled “Common workflows”Contractor with multiple clients
Section titled “Contractor with multiple clients”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
# Before working on client A's repo:gitswitch clientaOpen source + work
Section titled “Open source + work”gitswitch add oss "Your Name" public@github.com \ --gh-user yourhandle-oss
gitswitch add day "Your Name" you@company.com \ --gh-user yourhandle-work
# Before opening an OSS PR:gitswitch ossMulti-account GitHub
Section titled “Multi-account GitHub”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-corpAuto-switch per repo
Section titled “Auto-switch per repo”Pin a permanent identity to a repo:
cd ~/my-work-projectgitswitch pin workNow every time you enter this repo, gitswitch will suggest (or automatically switch to) the work identity.
Remove the pin:
gitswitch unpin