CLI Commands
Interactive TUI
Section titled “Interactive TUI”gitswitchOpens the full terminal UI. Navigate profiles, add/edit, switch themes, and manage identities interactively.
Keybindings:
↑/↓ork/j— Navigate profilesenter— Switch to selected profilea— Add new profilee— Edit selected profilectrl+d(in edit mode) — Delete profilec— Cycle color theme (12 palettes)?— Show CLI quick referenceq— Quit
Quick switch
Section titled “Quick switch”gitswitch workSwitch immediately to a profile. Useful in scripts or when you know the profile name.
List & Show
Section titled “List & Show”Show current identity
Section titled “Show current identity”gitswitch currentDisplays the active profile name and email.
List all profiles
Section titled “List all profiles”gitswitch listShows all available profiles with their email addresses.
Profile management
Section titled “Profile management”Add a profile
Section titled “Add a profile”gitswitch add NICKNAME USERNAME EMAIL [FLAGS]Flags:
--ssh-key <path>— Path to SSH private key--gpg-key <id>— GPG signing key ID--gh-user <username>— GitHub username forgh auth switch
Example:
gitswitch add work "Alice Smith" alice@company.com \ --ssh-key ~/.ssh/id_work \ --gh-user alice-workEdit a profile
Section titled “Edit a profile”gitswitch edit NICKNAMEModify an existing profile (TUI).
Remove a profile
Section titled “Remove a profile”gitswitch remove NICKNAMEDelete a profile permanently.
Repo-specific identity
Section titled “Repo-specific identity”Pin identity to repo
Section titled “Pin identity to repo”gitswitch pin NICKNAMEPin a profile to the current repo. This profile will be recommended (or automatically switched) when you enter this directory.
Unpin identity
Section titled “Unpin identity”gitswitch unpinRemove the pin, fall back to auto-recommendation based on usage history.
System commands
Section titled “System commands”Initialize/reimport git config
Section titled “Initialize/reimport git config”gitswitch initRe-imports your current global git config as the default profile. Useful if you’ve manually edited ~/.gitconfig.
Show version
Section titled “Show version”gitswitch versionDisplay current version and check for updates.
Upgrade
Section titled “Upgrade”gitswitch upgradeUpgrade to the latest release.
Shell integration setup
Section titled “Shell integration setup”gitswitch installSets up:
- Prompt segment (shows active identity in your shell prompt)
- Identity nudge (suggests appropriate identity when entering a repo)
- Tab completion (completes
gitswitchcommands and profile names)
Detects and configures:
- Starship → adds
[custom.gitswitch]to~/.config/starship.toml - oh-my-zsh → creates plugin at
~/.oh-my-zsh/custom/plugins/gitswitch/ - Powerlevel10k → prints manual step for
~/.p10k.zsh - Raw zsh/bash/fish → appends to rc file
Idempotent — safe to run multiple times.
gitswitch helpShow help text.
gitswitch COMMAND helpShow help for a specific command.
Full syntax reference
Section titled “Full syntax reference”gitswitch # Open TUIgitswitch PROFILE # Switch to profilegitswitch add NICK NAME EMAIL [FLAGS] # Add profilegitswitch remove NICK # Remove profilegitswitch edit NICK # Edit profile (TUI)gitswitch switch NICK # Switch (explicit command)gitswitch current # Show active identitygitswitch list # List all profilesgitswitch pin [NICK] # Pin profile to repogitswitch unpin # Remove pingitswitch init # Reimport git configgitswitch install # Set up shell integrationgitswitch version # Show version and check updatesgitswitch upgrade # Upgrade to latestgitswitch help # Show helpExit codes
Section titled “Exit codes”0— Success1— General error2— Profile not found3— Invalid input
Environment variables
Section titled “Environment variables”GITSWITCH_CONFIG_DIR— Override config directory (default:~/.config/gitswitch)