Skip to main content

Professional CLI tool for managing multiple GitHub identities with wizard-based profile creation and SSH key management

Project description

GitHub Switcher

CI PyPI Python License

Professional CLI for managing multiple GitHub identities with automated SSH key management and seamless profile switching

๐ŸŽ‰ What's New in v0.2.0

  • ๐Ÿ”’ Passphrase-Protected SSH Keys - Generate encrypted keys for enhanced security
  • ๐Ÿ” SSH Key Fingerprinting - SHA256 fingerprints for unique identification
  • ๐Ÿ”Œ SSH Agent Integration - Intelligent detection and management
  • ๐Ÿ›ก๏ธ Advanced Connection Testing - Comprehensive diagnostics with recovery guidance
  • ๐Ÿ“Š Enhanced Detection Command - Rich SSH environment analysis
  • ๐Ÿ”ง Non-Destructive Operations - Preserve existing SSH setups
  • ๐Ÿ“ˆ Profile Metadata Tracking - Enhanced storage with security status

โœจ Key Features

  • ๐Ÿ” Advanced SSH Management - Generate, import, fingerprint, and manage SSH keys with passphrase support
  • โšก Seamless Profile Switching - Switch Git identities in seconds with intelligent matching
  • ๐ŸŽฏ Interactive Commands - Smart wizards with case-insensitive profile matching and rich feedback
  • ๐Ÿ” Intelligent SSH Detection - Auto-detect existing setup with deduplication and ssh-agent integration
  • ๐Ÿ›ก๏ธ Enterprise Security - Passphrase-protected keys, ssh-agent integration, comprehensive connection testing
  • ๐ŸŒ Cross-Platform - Enhanced support for macOS, Linux, and Windows with improved configuration handling
  • ๐Ÿข Production-Ready - 320+ tests, 89%+ coverage, type-safe, professionally maintained

๐Ÿ“ฆ Installation

Recommended: UV (Modern & Fast)

UV is a modern, fast Python package and project manager written in Rust. It's 10-100x faster than pip and provides better dependency resolution.

First, install UV if you don't have it:

macOS:

brew install uv

Linux/WSL:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Alternative (any platform):

pip install uv

Then install GitHub Switcher:

uv tool install github-switcher

UV provides faster installation (10x+ faster), better dependency resolution, and isolated tool management

Standard: pip

pip install github-switcher

macOS/Linux: Homebrew

brew tap mostafagamil/github-switcher
brew install github-switcher

๐Ÿ”ง System Requirements

  • Python 3.10+ - Modern Python runtime
  • Git - Required for SSH operations and profile management
    • macOS: xcode-select --install or brew install git
    • Windows: Git for Windows (includes Git Bash)
    • Linux: Usually pre-installed (sudo apt install git if needed)
  • SSH client - For secure GitHub connectivity (included with Git)

๐Ÿš€ Quick Start

# Verify installation
ghsw --version

# Create your first profile (interactive wizard)
ghsw create

# List all profiles
ghsw list

# Switch between profiles
ghsw switch work
ghsw switch personal

# Test SSH connection
ghsw test work

๐Ÿ’ป Interactive Commands

All commands support interactive mode when no arguments are provided:

# Interactive profile creation - detects existing SSH keys
ghsw create

# Interactive switching - shows numbered profile list
ghsw switch
# ๐Ÿ”ง Select a profile to switch to:
#   1. work - john@company.com ๐ŸŸข Active
#   2. personal - john@gmail.com โšช Inactive
# ๐ŸŽฏ Enter profile number or name: 2

# Interactive profile management
ghsw delete          # Choose from list
ghsw copy-key        # Copy SSH public key to clipboard
ghsw test            # Test GitHub connection
ghsw regenerate-key  # Generate new SSH key

๐Ÿ”’ Enhanced Security Features (v0.2.0)

Passphrase-Protected SSH Keys: Generate and manage encrypted SSH keys for enhanced security:

ghsw regenerate-key work
# ๐Ÿ” Generate passphrase-protected key? [Y/n]: Y
# ๐Ÿ”‘ Enter passphrase for new SSH key: โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข
# โœ… New encrypted SSH key generated!

SSH Key Fingerprinting: Every key gets a unique SHA256 fingerprint for identification:

ghsw list
# ๐Ÿ“‹ GitHub Profiles:
#   ๐ŸŸข work - john@company.com (Active)
#       ๐Ÿ” SSH: Protected โ€ข SHA256:abc123def456... โ€ข Ed25519
#   โšช personal - john@gmail.com 
#       ๐Ÿ”“ SSH: Unprotected โ€ข SHA256:def456abc123... โ€ข Ed25519

SSH Agent Integration: Intelligent detection and management of loaded keys:

ghsw detect
# ๐Ÿ”Œ SSH Agent Status:
#   โœ… ssh-agent running (PID: 12345)
#   ๐Ÿ”‘ 2/4 keys loaded in agent
#   ๐Ÿ” 1 passphrase-protected key requires unlock

๐Ÿ” Advanced SSH Intelligence

GitHub Switcher provides enterprise-grade SSH key management with comprehensive analysis:

ghsw detect
# ๐Ÿ” Analyzing SSH environment...
# ๐Ÿ“Š SSH Key Analysis:
#   ๐Ÿ”‘ Total keys found: 4
#   โœ… Ed25519 keys: 2 (recommended)
#   ๐Ÿ” Passphrase-protected: 1
#   ๐Ÿ”“ Unencrypted: 3
# ๐Ÿท๏ธ Profile Associations:
#   โœ… work โ†’ id_ed25519_work (SHA256:abc123...)
#   โœ… personal โ†’ id_ed25519_personal (SHA256:def456...)
# ๐Ÿ”Œ SSH Agent Status:
#   โœ… ssh-agent running
#   ๐Ÿ”‘ 2 keys loaded in agent
# ๐ŸŒ GitHub Connectivity: โœ… All connections optimal

Enterprise SSH Features (v0.2.0):

  • ๐Ÿ” Passphrase Protection - Generate and detect encrypted SSH keys for enhanced security
  • ๐Ÿ” Key Fingerprinting - SHA256 fingerprints for unique identification and deduplication
  • ๐Ÿ”Œ SSH Agent Integration - Intelligent detection and management of ssh-agent loaded keys
  • ๐Ÿ›ก๏ธ Advanced Connection Testing - Comprehensive diagnostics with specific error guidance and recovery suggestions
  • ๐Ÿ”ง Non-Destructive Operations - Copy (don't move) existing keys, preserve original setup
  • ๐Ÿ“ˆ Profile Metadata Tracking - Enhanced profile storage with SSH key attributes and usage history
  • ๐Ÿ› ๏ธ Enhanced Detection Command - Rich SSH environment analysis with security insights and key metadata

๐Ÿ“‹ Command Reference

Command Description
ghsw create [options] Create new profile with interactive wizard
ghsw list Show all profiles with SSH security status and activity
ghsw switch [profile] Switch to profile (interactive if no argument)
ghsw current Display currently active profile
ghsw delete [profile] Remove profile and clean up SSH keys
ghsw copy-key [profile] Copy SSH public key to clipboard
ghsw test [profile] Test SSH connection to GitHub
ghsw regenerate-key [profile] Generate new SSH key with passphrase protection (v0.2.0)
ghsw detect Comprehensive SSH environment analysis with security insights

๐Ÿข Enterprise Features

  • ๐Ÿ”’ Advanced Security (v0.2.0) - Passphrase-protected keys, SHA256 fingerprinting, ssh-agent integration, secure defaults
  • Comprehensive Testing - 320+ tests with 89%+ coverage ensuring reliability across all platforms
  • Intelligent Error Handling - Robust error recovery with specific guidance for SSH issues
  • Cross-Platform Excellence - Automated testing on macOS, Linux, and Windows with platform optimizations
  • Type Safety - Full type hints and static analysis validation with mypy
  • Enterprise Documentation - Complete guides covering advanced SSH features and security practices

๐Ÿ“– Documentation

๐Ÿค Support & Contributing

๐Ÿ’ก Example Workflows

Development Teams

# Set up work and personal profiles
ghsw create --name work --fullname "John Doe" --email john@company.com
ghsw create --name personal --fullname "John Doe" --email john.personal@gmail.com

# Switch contexts quickly
ghsw switch work      # Work on company projects
ghsw switch personal  # Contribute to open source

Freelancers

# Manage multiple clients
ghsw create --name client-a --email john@client-a.com
ghsw create --name client-b --email john@client-b.com
ghsw create --name personal --email john@personal.com

# Quick client switching
ghsw switch client-a  # Work on Client A projects
ghsw switch client-b  # Switch to Client B work

๐Ÿ“Š Quality Metrics

  • Test Coverage - Enterprise-grade test suite with 320+ tests and 89%+ coverage
  • Cross-Platform - Automated CI testing on macOS, Linux, Windows with performance optimization
  • Type Safety - Full mypy validation with strict settings and comprehensive type coverage
  • Code Quality - Linted with ruff, formatted consistently, maintained to professional standards
  • Security (v0.2.0) - Passphrase-protected Ed25519 keys, SHA256 fingerprinting, ssh-agent integration, proper permissions

๐ŸŒŸ Support the Project

If GitHub Switcher helps improve your workflow, consider supporting its development:

Buy Me A Coffee

Your support helps maintain and enhance GitHub Switcher with new features and improvements!

๐Ÿ“„ License

MIT License - see LICENSE for details.


Made with โค๏ธ for developers managing multiple GitHub identities

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_switcher-0.2.0.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_switcher-0.2.0-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

Details for the file github_switcher-0.2.0.tar.gz.

File metadata

  • Download URL: github_switcher-0.2.0.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for github_switcher-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a31bd37b60ecee5d6442f07155285b48d1fee7f7898349391e211522f1a258a9
MD5 263a0c13301aa61dfcce6a4497637199
BLAKE2b-256 285962c5b1cef57fa163dafac90b6f05bb8de9ed4d7d83b6e2f99a5f58fc7b71

See more details on using hashes here.

File details

Details for the file github_switcher-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for github_switcher-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36a746aeb277cc0a56fb884879a184814081bd07d2c4e6c673a710fd0325addf
MD5 eb9502d6dfcf464399c682a55f36fec6
BLAKE2b-256 bd763aa4dbf40d3091c2e6aa948be8915e2dc712aa0f2c9a5b2a7cdaf0a9a2d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page