A simple tool to manage your Git accounts and projects
Project description
Git Account Manager
A web application to manage multiple Git accounts and configure local projects to use specific accounts, simplifying context switching between personal, work, or other Git identities.
Features
- Account Management: Create and manage multiple Git accounts (e.g., personal, work).
- SSH Key Generation: Automatically generates ED25519 SSH keys for each account.
- SSH Config Management: Updates the
~/.ssh/configfile with appropriate host entries for seamless SSH authentication with different accounts. - SSH Config Sync: Imports existing account configurations from
~/.ssh/configinto the application database. - Project-specific Git Configuration: Configures local Git repositories to use a specific account by Setting the local
user.nameanduser.email. - Git Repository Remote URL Management Updating the remote URL (e.g.,
origin) to use the account-specific SSH host defined in~/.ssh/config. - Validation: Validates project configuration and SSH connectivity for configured accounts.
- Web Interface: Provides a simple web UI built with FastAPI, Bootstrap, and jQuery for managing accounts and projects.
- Database Storage: Persists account and project data for easy retrieval and management.
Setup and Installation
-
Prerequisites:
- uv (Extremely fast Python package and project manager)
- Git installed and configured
-
Installation:
uv pip install git-account-manager
Running the Application
-
Start the server:
# Start the FastAPI server uv run git-manager
-
Access the UI: Open your web browser and navigate to
http://127.0.0.1:8000
Usage
- Create Accounts: Use the "Account Management" section to add new Git accounts (name, email, type). An SSH key pair and
~/.ssh/configentry will be generated automatically. Copy the public key and add it to your Git provider (e.g., GitHub). - Sync SSH Config: Use the "Sync SSH Config" button to import accounts found in your
~/.ssh/configfile into the application's database. - Configure Projects: Use the "Project Management" section. Select a local project path (must be a Git repository), give it a name, and choose the account it should use. The application will update the Git config (
user.name,user.email) and the remote URL for that project. - Validate Projects: Use the "Validate" button next to a configured project to check if the SSH connection works with the associated account.
Features In Detail
SSH Key Management
- Generates Ed25519 SSH keys for each account
- Automatically updates SSH config file
- Handles both personal and work account types
Git Repository Configuration
- Validates Git repositories
- Manages remote URLs (HTTPS and SSH formats)
- Configures repository-specific user settings
Project Structure
src/git_account_manager/ # Source code directory
├── __init__.py
├── database.py # Database configuration and setup
├── dependencies.py # FastAPI dependencies
├── git_manager.py # Git operations handling
├── main.py # FastAPI application entry point
├── models.py # SQLModel database models
├── services.py # Business logic implementation
├── ssh_manager.py # SSH key and config management
├── routers/ # API routes
│ ├── __init__.py
│ ├── accounts.py # Account management endpoints
│ └── projects.py # Project management endpoints
└── static/ # Static files (HTML, CSS, JS)
Technology Stack
- Backend: 🐍 Python, FastAPI, SQLModel, SQLite
- Frontend: HTML, CSS, JavaScript, Bootstrap 5, jQuery
- Build/Package Management: uv
- Linting/Formatting: Ruff
- Git Hooks: pre-commit
Configuration
- SSH Configuration: Managed in
~/.ssh/config. The application adds entries likeHost github-<name>-<type>. - Database: A SQLite database file named
git_accounts.dbis created in the user's home directory under.git-account-manager.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git_account_manager-0.1.1.tar.gz.
File metadata
- Download URL: git_account_manager-0.1.1.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c9c5dcf0eb38d6c0d6a12ae1a77b928733ed385dfb80b79cfbb7824a349a37b
|
|
| MD5 |
fdfbbfcad7df1a5d6a8863e4381ff77f
|
|
| BLAKE2b-256 |
80925ba3ee51e7311c024e8b9a0646e15562cd771f1948c15392dfd02a073940
|
File details
Details for the file git_account_manager-0.1.1-py3-none-any.whl.
File metadata
- Download URL: git_account_manager-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3759c49c1c3b6a3a0fa89e91f53bccc170df990342e3ed6d5ac939b14b15c73
|
|
| MD5 |
a4d46b6b3826ef2c59a0f13119f844ef
|
|
| BLAKE2b-256 |
675b85f3f94981d574deeee6e08a54f37dd6bc795fe52fce017eec9779dfe5c0
|