@kishar/haia
v1.0.1
Published
Git wrapper for managing multiple identities
Maintainers
Readme
Haia
Git Identity Manager — A CLI tool for developers who manage multiple Git identities (work, personal, client projects, etc.) with automatic SSH host alias switching and local git configuration.
Features
- 🎭 Multi-Profile Support — Create and manage unlimited identity profiles
- 📦 Smart Clone — Clone repositories with automatic SSH host alias rewriting. Supports standard URLs (
git@,https://) and short syntax (user/repo) - 🚀 Quick Init — Initialize new repos with pre-configured identity
- ⚙️ Local Config — Automatically sets
user.nameanduser.emailper repository - 📡 Connection Testing — Verify SSH connections for your profiles
- 🎯 Interactive Menu — Run
haiawithout arguments for a guided experience
Installation
From npm
npm install -g haiaFrom Source
git clone https://github.com/syam-fh/haia.git
cd haia
npm install
npm linkQuick Start
1. Configure Your First Profile
haia configYou'll be prompted to enter:
- Profile name (e.g., "Work", "Personal")
- Git username
- Git email
- SSH Host alias (e.g.,
github.com-work)
2. Set Up SSH Config
Make sure your ~/.ssh/config matches your profile's SSH host alias:
# Work GitHub
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_work
# Personal GitHub
Host github.com-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_personal3. Clone with Identity
You can use the full URL or the short user/repo syntax:
# Short syntax (GitHub) - Automatically uses your profile's SSH host
haia clone my-org/backend-api
# Standard URL
haia clone [email protected]:my-org/backend-api.gitSelect your profile, and Haia will:
- Rewrite the URL to use your SSH host alias (e.g.,
[email protected]:my-org/backend-api.git) - Clone the repository
- Configure local
user.nameanduser.email
Commands
| Command | Description |
|---------|-------------|
| haia | Show interactive menu |
| haia clone <url\|user/repo> | Clone repository with identity profile. Supports user/repo shortcut |
| haia init [directory] | Initialize new repository with identity profile |
| haia commit | Stage all changes and commit |
| haia push | Push changes to remote origin |
| haia ping [profile] | Test SSH connection for a specific profile |
| haia config | Manage identity profiles |
| haia --help | Show help message |
Configuration
Profiles are stored in ~/.haia/config.json:
{
"profiles": {
"work": {
"name": "Work",
"username": "john-work",
"email": "[email protected]",
"sshHost": "github.com-work"
},
"personal": {
"name": "Personal",
"username": "johndoe",
"email": "[email protected]",
"sshHost": "github.com-personal"
}
}
}Requirements
- Node.js >= 16.0.0
- Git installed and available in PATH
License
MIT © Syam
