Skip to main content

Cross-platform Git + SSH configuration CLI

Project description

Here’s a production-quality README.md you can drop in as-is. Clear, honest, PyPI-friendly, and actually useful. No marketing fluff.


# gitconfig-cli

A **cross-platform CLI tool** to manage **Git + SSH multi-account setups** without pain.

If you use:
- multiple GitHub/GitLab accounts (work + personal),
- multiple SSH keys,
- different Git identities per repository,

this tool fixes the usual SSH chaos **once and for all**.

---

## ✨ Features

- ✅ Multi-account SSH support (work, personal, client, etc.)
- ✅ Multiple SSH keys per machine
  - `ed25519` (default, recommended)
  - `rsa` (legacy / enterprise opt-in)
- ✅ Automatic `~/.ssh/config` management with host aliases
- ✅ Per-repository Git identity switching
- ✅ SSH authentication testing (with verbose debug mode)
- ✅ SSH environment diagnostics (`doctor`)
- ✅ Configuration export for backup
- ✅ No destructive global Git changes
- ✅ Linux, macOS, and Windows support

---

## 🚀 Installation

### Using pip
```bash
pip install gitconfig-cli

Recommended (isolated install)

pipx install gitconfig-cli

🧠 How it works (important)

Instead of fighting SSH, this tool:

  • creates named SSH keys
  • assigns SSH host aliases (e.g. github-work)
  • pins the correct key per repository

You clone using aliases like:

git clone git@github-work:org/repo.git

No more “wrong account” surprises.


📦 Basic Usage

Add an SSH account

gitconfig add \
  --provider github \
  --account work \
  --email work@company.com

This will:

  • generate an SSH key
  • update ~/.ssh/config
  • register the account locally

List accounts

gitconfig list

Example output:

- work → github (ed25519) [git@github-work]
- personal → github (ed25519) [git@github-personal]

Use an account in a repo

cd some-repo
gitconfig use work

This sets only for that repo:

  • user.email
  • core.sshCommand (forces correct SSH key)

Global Git config remains untouched.


Test SSH authentication

gitconfig test work

Verbose SSH debugging:

gitconfig test work --verbose

Run SSH diagnostics

gitconfig doctor

Checks:

  • ssh availability
  • ~/.ssh permissions
  • ssh-agent status
  • common misconfigurations

Export configuration (backup)

gitconfig export

To file:

gitconfig export --output backup.json

🔐 About ssh-rsa

  • ssh-rsa is deprecated and disabled by default in modern OpenSSH.
  • Some enterprise servers still require it.

You can opt-in safely:

gitconfig add --provider github --account legacy --email x@y.com --key-type rsa

⚠️ RSA is never enabled globally, only per host alias.


🗂 Configuration Location

Internal config is stored at:

~/.config/gitconfig-cli/config.json

SSH keys and config:

~/.ssh/

❌ What this tool does NOT do

  • ❌ Upload SSH keys to GitHub/GitLab automatically
  • ❌ Modify your global Git identity without asking
  • ❌ Hide what it’s doing behind magic

Everything is explicit and inspectable.


🛠 Requirements

  • Python 3.8+
  • Git
  • OpenSSH

📄 License

MIT License — see LICENSE


🧭 Roadmap

  • JSON output for CI / scripting
  • gitconfig doctor --fix
  • Account import / restore
  • Shell completion

💬 Feedback

Issues and PRs are welcome. This tool exists to kill SSH confusion — permanently.

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

gitconfig_cli-1.0.0.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

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

gitconfig_cli-1.0.0-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file gitconfig_cli-1.0.0.tar.gz.

File metadata

  • Download URL: gitconfig_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for gitconfig_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 75d6f2548fafd6a3fd6a89baa3735082c3b6f05c4436eed94fd52e2cc37f8705
MD5 fa6633cb59a3ef6924106cac4aeff5e3
BLAKE2b-256 06100948110b4ab8579180f423c514363e3949a7cce8e24b1bd69274322b7b3f

See more details on using hashes here.

File details

Details for the file gitconfig_cli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gitconfig_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for gitconfig_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 727f79939b8859d52ee351c85b42531e2bff4eaf7a5c63873f5824dbf04a4b47
MD5 d528b491c648c62563ead748999fb6ba
BLAKE2b-256 1b3d1352148eb23cf4bc468de495c4651b84227b0e68cbc3c030358980f25384

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