git-userhub
v4.9.5
Published
Switch Git accounts in one command. No config editing. No SSH key chaos.
Maintainers
Readme
git-user
💡 npm Package Note: This package is published as
git-userhubon npm. Once installed, your terminal command isgit-user.
⚡ Quick Start
1. Installation
npm install -g git-userhub2. Register Your Identities
git-user registerInteractive prompts guide you to set up your work, personal, or freelance profiles with names, emails, and bound SSH keys.
3. Switch Instantly
# Switch active identity globally
git-user switch work
# Or switch for the current repository only
git-user switch personal --local4. Interactive Terminal UI (TUI)
Prefer an interactive visual menu? Launch the keyboard-driven TUI:
git-user tuiNavigate with ↑ / ↓ (or k / j), switch panes with Tab ⇥, and select with Enter ↵.
🎯 What It Handles Automatically
When you switch identities, git-user updates your environment atomically in <0.1 seconds:
- 👤 Git Identity: Updates
user.nameanduser.email. - 🔑 SSH Key: Sets
core.sshCommandso Git operations automatically use the bound SSH key. - 🖋️ Commit Signing: Configures SSH/GPG commit signing parameters automatically.
- 📂 Directory Auto-Switching: Binds workspace folders (
~/work,~/personal) to switch identity automatically viaincludeIf.
🔥 Key Features & Highlights
| Feature | Highlight | Documentation |
| :--- | :--- | :--- |
| ⚡ Atomic Switch | Swaps name, email, and SSH keys in under 100ms | Learn More → |
| 📂 Auto-Switch Directories | Bind folders (git-user bind-path work ~/work/) to auto-switch | Learn More → |
| 🪝 Pre-Commit Guard | Block accidental commits if the wrong identity is active | Learn More → |
| 🖋️ Commit Signing | Native SSH & GPG commit signing support | Learn More → |
| 🔄 Encrypted Sync | Sync identities across machines via a private Git repo | Learn More → |
| 🖥️ Rich TUI | Keyboard-navigable (↑ ↓ ↵ Tab) terminal interface | Learn More → |
| 🎨 Terminal Prompt | Show active Git identity in Zsh, Bash, Fish, or Starship prompt | Integration Guide → |
📌 Command Reference Cheat Sheet
# Core Operations
git-user register # Guided setup for a new identity
git-user switch <name> # Switch active global identity
git-user switch <name> --local # Switch identity for current repository only
git-user switch -c <name> -e <email> # Create and switch in one step
git-user current # Print currently active identity
git-user list # List all registered identities
# Directory & Auto-Switching
git-user bind-path <name> <dir> # Bind directory to auto-switch identity
git-user unbind-path <name> <dir> # Remove directory binding
# Security & SSH Management
git-user pubkey # Output public key of active identity
git-user pubkey publish [platform] # Upload public key to GitHub/GitLab/Bitbucket
git-user sign <name> [--on|--off] # Toggle automatic SSH commit signing
git-user hook install # Install pre-commit guard hook
# Sync & Maintenance
git-user sync # Sync identities across devices
git-user doctor # Run environment health check
git-user tui # Open interactive terminal interface
git-user --update # Update to latest version📚 Full Documentation & Deep Dives
For detailed guides, troubleshooting, terminal prompt customization, and security architecture:
- 📖 Main Project Repository & Documentation
- 🐚 Terminal & Shell Prompt Integration Guide
- 🔒 Security Architecture & Audit Details
- 💬 Report Issues & Request Features
