#account #github #ssh-key #git #command-line-tool

app gitshift

Git SSH for managing multiple GitHub accounts

3 releases (1 stable)

1.1.0 Jun 14, 2025
0.2.0 Jun 14, 2025
0.1.0 Jan 27, 2025

#57 in Email

Download history 6/week @ 2025-05-08 252/week @ 2025-06-12 7/week @ 2025-06-19

259 downloads per month

MIT license

18KB
320 lines

GitShift 🔀

Rust License: MIT

A secure CLI tool for managing multiple GitHub accounts with SSH keys. Switch between work and personal accounts seamlessly! 🔐

[GitShift Demo]

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

cargo install --git https://github.com/rohansen856/gitshift.git
# Nightly required or edition2024 support
cargo +nightly install gitshift 

Quick Start 🚀

  1. Add New Account
gitshift add --name work --algorithm ed25519
  1. List Accounts
gitshift ls
  1. Activate Account
gitshift activate work
  1. 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 ls | List accounts | gitshift ls activate | Switch account | gitshift activate personal clone | Clone repository | gitshift clone git@github.com:user/repo.git info | Show account details | gitshift info work

Development 🛠️

Build Instructions

git clone https://github.com/rohansen856/gitshift.git
cd gitshift
cargo build --release

Troubleshooting 🐞

Q: Getting "Permission denied" when cloning A:

  1. Verify active account: gitshift ls

  2. Check GitHub SSH setup: ssh -T git@github.com

  3. Confirm key permissions: ls -la ~/.config/gitshift/ssh_keys

Q: Error saving configuration A: Ensure proper directory permissions:

chmod 700 ~/.config/gitshift

Dependencies

~8–21MB
~251K SLoC