1 unstable release
new 0.1.0 | Jan 27, 2025 |
---|
#35 in Email
28 downloads per month
15KB
243 lines
GitShift 🔀
A secure CLI tool for managing multiple GitHub accounts with SSH keys. Switch between work and personal accounts seamlessly! 🔐
Features ✨
- 🧩 Multi-Account Management - Store unlimited GitHub accounts
- 🔒 Secure Storage - Automatically handles SSH key permissions
- 🚀 Context-Aware Operations - Clone/push with active account credentials
- 📋 Interactive Setup - Guided account creation process
- 🌐 Cross-Platform - Works on Linux, macOS, and Windows
Installation 📦
From Source (Recommended)
cargo install --git https://github.com/yourusername/gitshift.git
From crates.io
cargo install gitshift
Quick Start 🚀
- Add New Account
gitshift add --name work --algorithm ed25519
- List Accounts
gitshift ls
- Activate Account
gitshift activate work
- Clone Repository
gitshift clone git@github.com:company/project.git
Configuration ⚙️
File Structure
~/.config/gitshift/
├── config.json # Account configurations
├── state.json # Active account state
└── ssh_keys/ # SSH key storage (700 permissions)
Example config
[
{
"name": "work",
"email": "dev@company.com",
"ssh_key_path": "~/.config/gitshift/ssh_keys/work_id",
"public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1..."
}
]
Command Reference 📚
Command | Description | Example add | Create new account | gitshift add --name dev --algorithm rsa ls | List accounts | gitshift ls activate | Switch account | gitshift activate personal clone | Clone repository | gitshift clone git@github.com:user/repo.git
Development 🛠️
Build Instructions
git clone https://github.com/yourusername/gitshift.git
cd gitshift
cargo build --release
Troubleshooting 🐞
Q: Getting "Permission denied" when cloning A:
-
Verify active account: gitshift ls
-
Check GitHub SSH setup: ssh -T git@github.com
-
Confirm key permissions: ls -la ~/.config/gitshift/ssh_keys
Q: Error saving configuration A: Ensure proper directory permissions:
chmod 700 ~/.config/gitshift
Dependencies
~7–16MB
~215K SLoC