Skip to main content

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/config file with appropriate host entries for seamless SSH authentication with different accounts.
  • SSH Config Sync: Imports existing account configurations from ~/.ssh/config into the application database.
  • Project-specific Git Configuration: Configures local Git repositories to use a specific account by Setting the local user.name and user.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

  1. Prerequisites:

    • uv (Extremely fast Python package and project manager)
    • Git installed and configured
  2. Installation:

    uv pip install git-account-manager
    

Running the Application

  1. Start the server:

    # Start the FastAPI server
    uv run git-manager
    
  2. Access the UI: Open your web browser and navigate to http://127.0.0.1:8000

Usage

  1. Create Accounts: Use the "Account Management" section to add new Git accounts (name, email, type). An SSH key pair and ~/.ssh/config entry will be generated automatically. Copy the public key and add it to your Git provider (e.g., GitHub).
  2. Sync SSH Config: Use the "Sync SSH Config" button to import accounts found in your ~/.ssh/config file into the application's database.
  3. 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.
  4. 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 like Host github-<name>-<type>.
  • Database: A SQLite database file named git_accounts.db is created in the user's home directory under .git-account-manager.

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

git_account_manager-0.1.1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

git_account_manager-0.1.1-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

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

Hashes for git_account_manager-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4c9c5dcf0eb38d6c0d6a12ae1a77b928733ed385dfb80b79cfbb7824a349a37b
MD5 fdfbbfcad7df1a5d6a8863e4381ff77f
BLAKE2b-256 80925ba3ee51e7311c024e8b9a0646e15562cd771f1948c15392dfd02a073940

See more details on using hashes here.

File details

Details for the file git_account_manager-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for git_account_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3759c49c1c3b6a3a0fa89e91f53bccc170df990342e3ed6d5ac939b14b15c73
MD5 a4d46b6b3826ef2c59a0f13119f844ef
BLAKE2b-256 675b85f3f94981d574deeee6e08a54f37dd6bc795fe52fce017eec9779dfe5c0

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