gitp-0.1.0 is not a library.
gitp - Git Profile Switcher
A fast and intuitive git profile switcher written in Rust, with support for SSH keys, HTTPS credentials, and both global and local configurations.
Features
- 🚀 Fast - Written in Rust for blazing-fast profile switching
- 🔑 SSH Support - Manage different SSH keys for different profiles
- 🌐 Multi-scope - Switch profiles globally or per-repository
- 🎨 User-friendly - Intuitive CLI with colored output
- 🔒 Secure - HTTPS credentials can be stored in the system keychain
- 🤖 Auto-switching - Automatically switch profiles based on repo URL (coming soon)
Installation
From source
# Make sure you have Rust installed
|
# Clone and install
From crates.io (coming soon)
Quick Start
-
Create a profile:
# Enter interactive mode # Or with flags -
List profiles:
-
Switch profiles:
# Switch globally # Switch for current repo only -
Check current profile:
Usage
Profile Management
# Create a new profile interactively
# Create with specific settings
# Show profile details
# Edit existing profile
# Edit specific fields, including HTTPS credentials:
# Remove HTTPS credentials from a profile (and keychain if stored there):
# Remove a profile
# Rename a profile
Profile Switching
# Switch globally (default)
# Switch for current repository only
# Show current profile
Configuration
Profiles are stored in ~/.config/gitp/config.toml:
= "work"
[]
= "John Doe"
= "john@company.com"
= "~/.ssh/id_rsa_work"
= "ABCD1234"
[]
= "John Doe"
= "john@personal.com"
= "~/.ssh/id_rsa_personal"
Roadmap
- Basic profile management (create, list, switch, remove)
- Global git config switching
- SSH key management and SSH config generation
- Local (per-repository) profile switching
- HTTPS credential management via system keychain
- Auto-switching based on repository URLs
- Profile templates and inheritance
- Import/export profiles
- Shell prompt integration
- Homebrew formula and AUR package
Development
Project Structure
gitp/
├── src/
│ ├── main.rs # Entry point
│ ├── cli.rs # CLI definitions
│ ├── commands/ # Command implementations
│ ├── config/ # Configuration management
│ ├── credentials/ # Credential management (keychain, tokens)
│ ├── git/ # Git operations
│ ├── ssh/ # SSH configuration management
│ └── utils/ # Utilities
├── tests/ # Integration tests
└── Cargo.toml
Building
# Debug build
# Release build
# Run tests
# Run with verbose output
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT).
Acknowledgments
- Inspired by various git profile switchers in the ecosystem
- Built with excellent Rust crates: clap, serde, git2, and more