@hypercodingdev/zit
v1.1.2
Published
Folder-based Git identity manager. Associate workspace folders with Git accounts — SSH keys, author name, and email are applied automatically.
Maintainers
Readme
zit
A folder-based Git identity manager. Associate workspace folders with Git accounts — SSH keys, author name, and email are applied automatically to every repo inside.
No manual switching. No ssh-agent. No shell hooks. Uses git's native includeIf to make it work everywhere — terminal, VS Code, JetBrains, any git client.
How It Works
- Register your git accounts with
zit add - Create workspace folders linked to accounts with
zit workspace init - Clone repos inside workspace folders with
zit clone - After that,
git push,git pull,git commit— everything uses the correct identity automatically
Under the hood, zit uses:
includeIf "gitdir:"— git's native conditional config that auto-loads identity settings based on repo locationcore.sshCommand— tells git which SSH key to use, no ssh-agent needed
Installation
npm install -g @hypercodingdev/zitRequires Node.js >= 18, git, and ssh-keygen.
After installing, run this to enable tab completion (recommended):
zit completion --installThis adds auto-complete to your shell so you can type zit <tab> to see commands, zit remove <tab> to see account names, etc. Restart your shell or run source ~/.zshrc (or ~/.bashrc) to activate.
Quick Start
# Register an account
zit add
# Account name: work
# Git user name: John Doe
# Git email: [email protected]
# → Generates SSH key, prints public key to paste into GitHub/GitLab
# Create a workspace folder linked to that account
zit workspace init ~/work work
# → Creates ~/work/, configures git includeIf
# Clone a repo inside the workspace
cd ~/work
zit clone [email protected]:my-org/my-repo.git
# From now on, git just works — no zit needed
cd ~/work/my-repo
git commit -m "uses work identity automatically"
git push # uses work SSH key automaticallyCommands
All commands have short aliases for convenience.
| Command | Alias | Description |
|---------|-------|-------------|
| zit add | | Register a new git account |
| zit remove <account> | zit rm | Remove an account and SSH keys |
| zit list | zit ls | List all registered accounts |
| zit workspace <sub> | zit wsp | Manage workspace folders |
| zit clone <url> | | Clone with workspace SSH key |
| zit status | | Show current workspace info |
| zit completion | | Output shell completion script |
| zit uninstall | | Remove all zit data and configs |
zit add
Register a new git account interactively. Generates an SSH keypair.
zit add # default: ed25519
zit add -t rsa # specify key typeSupported key types: ed25519 (default), rsa, ecdsa, ecdsa-sk, ed25519-sk, dsa
zit remove <account>
Remove an account and its SSH keys. Alias: zit rm
zit remove work
zit remove work --force # also removes linked workspaceszit list
List all registered accounts with their emails. Alias: zit ls
$ zit list
Registered accounts:
personal [email protected]
work [email protected]zit workspace init <path> <account>
Create a workspace folder linked to an account. Alias: zit wsp
zit workspace init ~/work work
zit workspace init ~/personal personalzit workspace list
List all workspaces.
$ zit workspace list
Workspaces:
work ~/work work
personal ~/personal personalzit workspace remove <name>
Unlink a workspace. Keeps the folder and repos, but removes the identity link.
zit workspace remove workzit clone <url>
Clone a repo using the current workspace's SSH key. Must be run inside a workspace folder.
cd ~/work
zit clone [email protected]:org/repo.git
zit clone [email protected]:org/repo.git --depth 1 # extra git clone flags workzit status
Show the current directory's workspace and account info.
$ cd ~/work/my-repo && zit status
Workspace: work
Path: ~/work
Account: work
Name: John Doe
Email: [email protected]
SSH Key: ~/.ssh/id_ed25519_workUninstall
zit uninstallThis removes all zit data in one step:
- All workspace
includeIfentries from~/.gitconfig - All workspace gitconfig files
- All SSH keys for registered accounts (use
--keep-keysto skip) - The
~/.config/zit/config directory - Tab completion from your shell profile
Workspace folders and repos inside them are not deleted.
After running zit uninstall, remove the CLI itself:
npm uninstall -g @hypercodingdev/zitWhat zit Does to Your System
~/.config/zit/config— stores registered accounts and workspace mappings~/.config/zit/workspaces/*.gitconfig— per-workspace git config files~/.gitconfig— addsincludeIfentries (one per workspace)~/.ssh/id_<type>_<name>— SSH keypairs for each account
Platform Support
- Linux
- macOS
License
MIT
