@technobromo/gitconnect
v1.0.3
Published
Multi-GitHub Account Manager - Auto & Explicit Mode
Downloads
23
Maintainers
Readme
GitConnect 🔄
Multi-GitHub Account Manager - Auto & Explicit Mode
Manage multiple GitHub accounts seamlessly with per-project account selection, automatic git identity switching, and commit signing.
Features
- 🔐 Multiple Accounts - Manage multiple GitHub accounts with separate SSH keys
- 🎯 Per-Project Config - Different accounts for different projects
- 🤖 Auto Mode - Automatically use configured account
- 💬 Prompt Mode - Ask before each commit/push
- 🔏 SSH Signing - Sign commits with SSH keys
- 🪝 Git Hooks - Pre-commit and pre-push hooks
- ⚡ Quick Switch - Easy account switching with
gc use
Installation
npm install -g gitconnect
# or
npx gitconnect initQuick Start
# Initialize GitConnect
gc init
# Add your first account
gc account add
# Set account for current project
gc project set
# Commit with account prompt
gc commit -m "Your message"
# Or use git directly (with hooks installed)
git commit -m "Your message"Commands
Account Management
gc account add # Add new GitHub account
gc account list # List all accounts
gc account remove <name> # Remove an accountProject Configuration
gc project set # Set account for current project
gc project mode <mode> # Set mode: auto/prompt/off
gc project info # Show project infoCommit & Push
gc commit -m "message" # Commit with account selection
gc commit --amend # Amend last commit
gc commit --sign # Sign commit with SSH
gc push # Push with account verificationHooks
gc hooks install # Install git hooks
gc hooks uninstall # Remove git hooks
gc hooks status # Show hook status
gc hooks mode <mode> # Set hook modeUtilities
gc use <account> # Quick switch account
gc status # Show GitConnect status
gc init # Initialize configurationHook Modes
| Mode | Behavior |
|------|----------|
| prompt | Ask for account before each commit |
| auto | Use configured account automatically |
| off | Disable GitConnect hooks |
Configuration
GitConnect stores configuration in ~/.gitconnect/:
accounts.json- Your GitHub accountsprojects.json- Per-project settingssettings.json- Global settingsssh/- SSH keys (mode 0700)
How It Works
- Account Setup: Each account gets a unique SSH key pair
- Project Binding: Projects are bound to specific accounts
- Identity Switching: Git identity (name/email) is set per-commit
- SSH Key Selection: The correct SSH key is used automatically
Security
- SSH keys stored with
0700permissions - Config files use
0600permissions - No credentials stored in git history
- Local git identity only (not global)
Requirements
- Node.js >= 16.0.0
- Git
- SSH (for key generation)
Environment Variables
| Variable | Description |
|----------|-------------|
| GITCONNECT_DEBUG | Set to true to enable debug logging |
| HOME | User home directory (used for SSH key paths) |
License
MIT
Contributing
See CONTRIBUTING.md
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
