A cross-platform CLI tool that helps developers manage multiple Git SSH identities and per-repository authors safely. No global Git config changes, no silent remote rewrites.
Working with multiple Git accounts (work, personal, clients) can be confusing. gitprofile makes it simple:
- ✅ Repository-scoped authors only – Never touches global
git config user.* - ✅ Explicit SSH identities – Use aliases like
github-workinstead of guessing - ✅ Clear instructions – Always shows you exactly how to clone and push
- ✅ Safe by default – No silent changes, everything requires confirmation
npm install -g @john-daniels/gitprofileRequirements:
- Node.js 18 or higher
gitinstalledssh-keygenavailable (usually pre-installed on macOS/Linux)
gitprofile initThis will:
- Generate a new SSH key (e.g.,
~/.ssh/id_ed25519_work) - Ask for your author name and email
- Optionally add an SSH alias to
~/.ssh/config - Show you your public key to add to GitHub/GitLab
After setup, gitprofile shows you exactly how to use it:
Clone a repository:
git clone git@github-work:ORG/REPO.gitUpdate an existing repository:
git remote set-url origin git@github-work:ORG/REPO.gitSet author for current repository:
gitprofile set authorShows a high-level overview of available commands.
Create a new Git profile (SSH key + author). Interactive prompts guide you through:
- Profile nickname (e.g.,
work,personal) - Author name and email
- Git provider (GitHub, GitLab, Bitbucket)
- Whether to add SSH alias to
~/.ssh/config - Whether to apply author to current repository (if in a Git repo)
List all configured profiles with their details:
- Nickname
- Author name and email
- SSH alias
- SSH key path
- Provider
Apply an existing profile's author to the current Git repository. Only modifies local repository config, never global.
Show detailed help explaining:
- Core concepts (SSH identity vs Git author)
- How configuration works
- Where files are stored
Run diagnostics to check:
- Git installation
- SSH directory and keys
- ssh-agent status
These are two separate concepts that gitprofile keeps clear:
- SSH alias (e.g.,
github-work) – Controls which account you authenticate as when talking to GitHub/GitLab - Git author (name + email) – Controls who commits are attributed to inside a repository
You can use different combinations:
- Same SSH identity, different authors per repo
- Different SSH identities, same author
- Any combination that makes sense for your workflow
- Profiles:
~/.gitprofile/config.json(per-machine, per-user) - SSH keys:
~/.ssh/id_ed25519_<nickname>(standard SSH location) - SSH aliases:
~/.ssh/config(only appended when you create profiles)
Important: gitprofile never modifies:
- Global Git config (
~/.gitconfig) - Existing SSH keys
- Git remotes (you update those yourself)
On first run, gitprofile scans your system for existing SSH keys and SSH config entries. If found, it offers to import them as profiles. This is completely optional and safe – no files are modified during bootstrap.
# Create work profile
gitprofile init
# Nickname: work
# Author: Jane Doe <jane@company.com>
# Provider: github
# Create personal profile
gitprofile init
# Nickname: personal
# Author: Jane Doe <jane@gmail.com>
# Provider: githubNow you can clone work repos with git@github-work:... and personal repos with git@github-personal:....
cd ~/projects/work-repo
gitprofile set author
# Select: work
cd ~/projects/personal-repo
gitprofile set author
# Select: personalEach repository now has its own author config, independent of global settings.
- ✅ macOS
- ✅ Linux
- ✅ Windows (with Git Bash or WSL)
- ❌ No global Git mutations – Only repository-local config changes
- ❌ No silent remote rewrites – You control your remotes manually
- ✅ Every destructive action requires confirmation
- ✅ All output is copy-paste friendly
Make sure ~/.ssh/config has the Host block. Run gitprofile init again and say "yes" when asked to add the SSH alias, or add it manually:
Host github-<nickname>
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_<nickname>
IdentitiesOnly yes
Verify your SSH key is added to your Git provider (GitHub/GitLab). The public key is shown after gitprofile init.
Run gitprofile doctor to see diagnostics for Git, SSH, and ssh-agent.
Contributions welcome! See CONTRIBUTORS.md for guidelines.
MIT License – see LICENSE for details.
Found a bug or have a feature request? Open an issue on GitHub.