https://github.com/ziyifast/gum
Switch Git identities in one command. Like nvm, but for Git.
https://github.com/ziyifast/gum
bash cli command-line developer-tools git git-config productivity shell ssh
Last synced: 20 days ago
JSON representation
Switch Git identities in one command. Like nvm, but for Git.
- Host: GitHub
- URL: https://github.com/ziyifast/gum
- Owner: ziyifast
- License: mit
- Created: 2026-06-02T12:05:46.000Z (22 days ago)
- Default Branch: main
- Last Pushed: 2026-06-03T04:38:35.000Z (22 days ago)
- Last Synced: 2026-06-03T06:23:13.719Z (22 days ago)
- Topics: bash, cli, command-line, developer-tools, git, git-config, productivity, shell, ssh
- Language: Shell
- Homepage: https://ziyifast.github.io/gum/
- Size: 2.36 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README

# GUM - Git User Manager
**Switch Git identities in one command.**
[](LICENSE)
[](https://www.gnu.org/software/bash/)
[](#installation)
[](https://ziyifast.github.io/gum/)
[**Website**](https://ziyifast.github.io/gum/) | [English](README.md) | [δΈζ](README_CN.md)
---
A lightweight CLI tool to manage and switch between multiple Git identities (user.name, user.email, SSH keys). Like `nvm` for Node.js versions, but for Git accounts.
## The Problem
```bash
# Every. Single. Day.
git config --global user.name "zhangsan"
git config --global user.email "zhangsan@company.com"
# ... edit ~/.ssh/config ...
# ... ssh-add the right key ...
# π€
```
## The Solution
```bash
gum use work # Done. All of it.
gum use home # Back to personal. That's it.
```
## Demo
```
$ gum create work
Git user.name: zhangsan
Git user.email: zhangsan@tencent.com
Select SSH config: (β/β select, Enter confirm)
β― git.woa.com (key: ~/.ssh/id_rsa)
github.com (key: ~/.ssh/id_rsa_github)
Configure manually
β Profile 'work' created!
$ gum use work
β Switched to 'work' (global)
user.name = zhangsan
user.email = zhangsan@tencent.com
ssh.host = git.woa.com
```
## Features
- **One-command switching**: `gum use work` / `gum use home`
- **Quick setup**: `gum init` creates work & home profiles in one flow
- **Smart detection**: Auto-reads existing `~/.ssh/config` entries
- **Interactive UI**: Arrow key selection (β/β/j/k) for all menus
- **SSH key management**: Auto-generates ed25519 keys
- **Non-destructive**: SSH config managed via marker comments, your entries stay untouched
- **Scope control**: Global (`--global`) or per-repo (`--local`)
- **Customizable**: `~/.gum/config` for your own defaults
- **Zero dependencies**: Pure Bash, works on macOS and Linux
## Installation
Choose your preferred method:
### One-line install (curl | bash)
```bash
curl -fsSL https://raw.githubusercontent.com/ziyifast/gum/main/packaging/install-remote.sh | bash
```
### Homebrew (macOS / Linux)
One-liner:
```bash
brew install ziyifast/tap/gum
```
Or in two steps if you prefer:
```bash
brew tap ziyifast/tap
brew install gum
```
### apt-get (Debian / Ubuntu)
Download the `.deb` from [Releases](https://github.com/ziyifast/gum/releases):
```bash
wget https://github.com/ziyifast/gum/releases/latest/download/gum_1.1.0_all.deb
sudo dpkg -i gum_1.1.0_all.deb
```
### Scoop (Windows)
Requires [Git for Windows](https://git-scm.com/download/win) (provides Git Bash).
```powershell
scoop bucket add ziyifast https://github.com/ziyifast/gum
scoop install gum
```
### From source
```bash
git clone https://github.com/ziyifast/gum.git
cd gum
sudo make install # System-wide (/usr/local/bin)
# OR
bash install.sh # User-local (~/.gum/bin)
```
After installation, reload your shell:
```bash
source ~/.zshrc # or ~/.bashrc
```
## Quick Start
### Setup
```bash
gum init # Guided setup for work & home profiles
# or
gum create work # Create profiles individually
gum create home
```
### Use
```bash
gum use work # Switch globally
gum use home --local # Switch for current repo only
gum current # Check active profile
gum list # See all profiles
```
## Commands
| Command | Description |
|---------|-------------|
| `gum init` | Quick setup wizard (create work & home) |
| `gum create ` | Create a new identity profile |
| `gum list` | List all profiles (alias: `ls`) |
| `gum use ` | Switch globally |
| `gum use --local` | Switch for current repo only |
| `gum current` | Show active profile |
| `gum show ` | Show profile details + public key |
| `gum delete ` | Delete a profile (alias: `rm`) |
| `gum import ` | Import current git config as profile |
| `gum config [show\|edit\|reset]` | Manage gum settings |
| `gum help` | Show help |
## How It Works
`gum use work` does all of this in one command:
1. Sets `git config --global user.name` and `user.email`
2. Updates the relevant SSH config block in `~/.ssh/config`
3. Adds the SSH key to `ssh-agent`
4. Records the active profile
SSH config is managed with marker comments β your own entries are never modified:
```ssh-config
# Your config (untouched)
Host myserver
HostName 10.0.1.1
User admin
# >>> gum managed: work >>>
Host git.woa.com
HostName git.woa.com
IdentityFile ~/.ssh/id_rsa
User git
# <<< gum managed: work <<<
```
## Configuration
Customize defaults in `~/.gum/config`:
```bash
gum config edit
```
```bash
# Default profile names for 'gum init'
GUM_DEFAULT_PROFILES=("work" "home")
# Or customize for your workflow:
GUM_DEFAULT_PROFILES=("company" "personal" "freelance")
```
## Requirements
- bash 4.0+ or zsh
- git
- ssh-keygen & ssh-agent
## File Structure
```
~/.gum/
βββ bin/gum # Executable
βββ config # User settings
βββ profiles/ # Identity profiles
β βββ work.conf
β βββ home.conf
βββ current # Active profile name
```
## Documentation
- [Architecture Guide](docs/architecture.md) β Code structure and design decisions
- [Contributing](CONTRIBUTING.md) β How to contribute
- [Changelog](CHANGELOG.md) β Version history
## Contributing
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## License
[MIT](LICENSE)