@pegasou/oh-my-git
v1.0.0
Published
CLI + GUI toolkit for managing multiple GitHub identities on a single machine. It creates per‑profile SSH keys, host aliases, and Git include rules so the right identity is used automatically per project.
Readme
oh-my-git
CLI + GUI toolkit for managing multiple GitHub identities on a single machine. It creates per‑profile SSH keys, host aliases, and Git include rules so the right identity is used automatically per project.
Installation
npm install @pegasou/oh-my-git -gFeatures
- Multiple GitHub profiles on one machine with automatic identity selection per project.
- Per‑profile SSH keys and host aliases managed in
~/.ssh/config. - Directory‑to‑profile mapping via
git includeIfrules. - CLI + GUI (Tauri) to manage profiles and mappings.
- GitHub CLI helpers (
gh login,gh switch, key sync).
How It Works
- Each profile owns its own SSH key and host alias in
~/.ssh/config. - Project directories map to profiles via
[includeIf "gitdir:..."]in~/.gitconfig. - Each include file sets
user.name,user.email, and URL rewrite rules for the profile alias. - All edits are wrapped in markers so they can be safely updated/removed.
Example managed SSH block:
# >>> oh-my-git:ssh:work
Host github.com-work
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_work
IdentitiesOnly yes
# <<< oh-my-git:ssh:workExample managed Git include:
# >>> oh-my-git:include:work-1a2b3c
[includeIf "gitdir:~/code/work/"]
path = ~/.config/oh-my-git/includes/work.gitconfig
# <<< oh-my-git:include:work-1a2b3cSupported Platforms
- macOS ✅
- Linux ✅
- Windows (planned)
Development
Requirements:
bun- Rust toolchain + Tauri prerequisites (for GUI builds)
Install deps:
bun installRun dev mode:
bun run devRun all tests (turbo):
bun run testBuild everything:
bun run buildBuild release package (GUI + CLI, output in build/oh-my-git):
bun run releaseInstall the release package globally:
npm install -g ./build/oh-my-gitCLI Usage
Initialize config:
omg config initShow status:
omg statusCreate profile:
omg profile add \
--label Work \
--name "Jane Doe" \
--email [email protected] \
--generate-key \
--gh-user janedoeMap directory:
omg dir map ~/code/work workApply profile to current repo:
omg repo use workTest SSH:
omg ssh test workGitHub CLI helpers:
omg gh login work
omg gh switch work
omg gh link work
omg gh key add work
omg gh key remove workClone with profile (SSH only):
omg clone [email protected]:owner/repo.git
omg clone ssh://[email protected]/owner/repo.git --profile work
omg clone [email protected]:owner/repo.git --dir ~/code/repoNotes:
omg clonerewritesgithub.comto your profile’s host alias.- Only SSH clone URLs are supported.
GUI Usage
- Create, edit, and delete profiles
- Generate SSH keys from the form
- Link profile to a GitHub account (from
gh auth status) - Edit mappings (per profile)
- Switch light/dark mode
- Sync SSH public key to GitHub (requires
gh auth login)
Open GUI from CLI (requires a release build in build/oh-my-git):
omg guiRun GUI in dev mode:
omg gui --devFiles & Backups
- Config:
~/.config/oh-my-git/config.json - Profiles:
~/.config/oh-my-git/profiles/*.json - Include files:
~/.config/oh-my-git/includes/*.gitconfig - Backups:
~/.config/oh-my-git/backups/*
Versioning & Releases
This repo uses Changesets for versioning and release notes.
Add a changeset:
bun run changesetBump versions + changelogs:
bun run versionBuild release package:
bun run releasePublish to npm (from the release bundle):
npm publish ./build/oh-my-git