npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-profile-setup

v1.0.1

Published

Cross-platform CLI tool to manage multiple Git profiles with SSH keys and shell aliases

Readme

Usage Examples

Interactive Mode with Alias Creation

$ git-profile-setup add

✔ Initialized
ℹ Configuring Git profile for John Doe...
✔ SSH key generated & config updated!

📋 Your public SSH key:
──────────────────────────────────────────────────
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK... [email protected]
──────────────────────────────────────────────────

✨ Add this key to your cloud service account (GitHub, GitLab, Bitbucket, etc.)
   See "Adding SSH Keys to Cloud Services" section below for detailed instructions

🔧 SSH Host alias created: github.com-john-doe
   Use this in your git remote URL:
   [email protected]:username/repo.git

✔ Git profile configured globally

🐚 Detected 3 shell(s):
   • Bash → /home/user/.bashrc
   • Zsh → /home/user/.zshrc
   • Fish → /home/user/.config/fish/config.fish

? Would you like to create a shell alias to switch to this profile? › Yes

? Select shells to add the alias to: ›
  ↑/↓: Navigate • Space: Toggle • Enter: Confirm
◉ Bash → /home/user/.bashrc
◉ Zsh → /home/user/.zshrc
◯ Fish → /home/user/.config/fish/config.fish

📝 Adding aliases to selected shells...

✔ Added alias to Bash (/home/user/.bashrc)
✔ Added alias to Zsh (/home/user/.zshrc)
✔ Profile configured successfully!

✨ Alias created: git-john-doe
   Run this command to switch to this profile:
   $ git-john-doe

🔄 To use the alias immediately, reload your shell:

   Bash/Git Bash: source ~/.bashrc  (or restart terminal)
   Zsh: source ~/.zshrc  (or restart terminal)

   Or simply restart your terminal

Command Line Mode

$ git-profile-setup add \
  --name "Jane Smith" \
  --email "[email protected]" \
  --type work

✔ Initialized
ℹ Configuring Git profile for Jane Smith...
✔ SSH key generated & config updated!

📋 Your public SSH key:
──────────────────────────────────────────────────
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK... [email protected]
──────────────────────────────────────────────────

✨ Add this key to your cloud service account (GitHub, GitLab, Bitbucket, etc.)
   See "Adding SSH Keys to Cloud Services" section below for detailed instructions

🔧 SSH Host alias created: github.com-jane-smith
   Use this in your git remote URL:
   [email protected]:username/repo.git

✔ Git profile configured globally

🐚 Detected 2 shell(s):
   • PowerShell → C:\Users\jane\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
   • Git Bash → C:\Users\jane\.bashrc

? Would you like to create a shell alias to switch to this profile? › Yes
? Select shells to add the alias to: ›
◉ PowerShell → C:\Users\jane\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
◉ Git Bash → C:\Users\jane\.bashrc

📝 Adding aliases to selected shells...

✔ Added alias to PowerShell (C:\Users\jane\Documents\PowerShell\Microsoft.PowerShell_profile.ps1)
✔ Added alias to Git Bash (C:\Users\jane\.bashrc)
✔ Profile configured successfully!

✨ Alias created: git-jane-smith
   Run this command to switch to this profile:
   $ git-jane-smith

🔄 To use the alias immediately, reload your shell:

   PowerShell: . $PROFILE  (or restart terminal)
   Bash/Git Bash: source ~/.bashrc  (or restart terminal)

   Or simply restart your terminal

Skip Alias Creation

$ git-profile-setup add --skip

✔ Initialized
? Enter name › John Doe
? Enter email › [email protected]
? Select profile type › personal

ℹ Configuring Git profile for John Doe...
✔ SSH key generated & config updated!

📋 Your public SSH key:
──────────────────────────────────────────────────
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK... [email protected]
──────────────────────────────────────────────────

✨ Add this key to your cloud service account (GitHub, GitLab, Bitbucket, etc.)
   See "Adding SSH Keys to Cloud Services" section below for detailed instructions

🔧 SSH Host alias created: github.com-john-doe
   Use this in your git remote URL:
   [email protected]:username/repo.git

✔ Git profile configured globally
✔ Profile John Doe configured!

💡 Tip: Run without --skip flag to create shell aliases

Multiple Profile Workflow

1. Create Personal Profile

$ git-profile-setup add
? Enter name › John Doe
? Enter email › [email protected]
? Select profile type › personal

# ... setup process ...

✔ Profile configured successfully!
✨ Alias created: git-john-doe

2. Create Work Profile

$ git-profile-setup add
? Enter name › John Doe
? Enter email › [email protected]
? Select profile type › work

# ... setup process ...

✔ Profile configured successfully!
✨ Alias created: git-john-doe-work

3. Switch Between Profiles

# Switch to personal profile
$ git-john-doe

# Verify
$ git config user.name
John Doe
$ git config user.email
[email protected]

# Switch to work profile
$ git-john-doe-work

# Verify
$ git config user.name
John Doe
$ git config user.email
[email protected]

4. Use Different SSH Keys

# Clone personal project
$ git clone [email protected]:username/personal-project.git

# Clone work project
$ git clone [email protected]:company/work-project.git

# Or update existing remote
$ cd existing-repo
$ git remote set-url origin [email protected]:username/repo.git

Shell-Specific Alias Behavior

Bash/Zsh/Git Bash

# Alias added to ~/.bashrc or ~/.zshrc
alias git-john-doe='git config user.name "John Doe" && git config user.email "[email protected]"'

# Usage
$ git-john-doe
$ git config user.name
John Doe

Fish

# Alias added to ~/.config/fish/config.fish
alias git-john-doe 'git config user.name "John Doe"; and git config user.email "[email protected]"'

# Usage
$ git-john-doe
$ git config user.name
John Doe

PowerShell

# Function added to Microsoft.PowerShell_profile.ps1
function git-john-doe { git config user.name "John Doe"; git config user.email "[email protected]" }

# Usage
PS> git-john-doe
PS> git config user.name
John Doe

Error Handling

No Shells Detected

$ git-profile-setup add

✔ Initialized
✔ SSH key generated & config updated!
✔ Git profile configured globally
⚠ No supported shells detected. Skipping alias creation.

💡 Supported shells: Bash, Zsh, Fish, PowerShell, Git Bash
   Install one of these shells to use shell aliases

SSH Key Generation Failed

$ git-profile-setup add

✔ Initialized
ℹ Configuring Git profile for John Doe...
✖ Failed SSH key setup
ssh-keygen command not found
✖ Failed to configure Git profile

User Cancels Selection

$ git-profile-setup add

✔ Initialized
✔ SSH key generated & config updated!
✔ Git profile configured globally

🐚 Detected 3 shell(s):
   • Bash → /home/user/.bashrc
   • Zsh → /home/user/.zshrc
   • Fish → /home/user/.config/fish/config.fish

? Would you like to create a shell alias to switch to this profile? › No

✔ Profile John Doe configured!

💡 You can manually switch to this profile using:
   git config user.name "John Doe"
   git config user.email "[email protected]"

Adding SSH Keys to Cloud Services

After generating your SSH key, you need to add the public key (.pub file) to your cloud service accounts. The public key file is located at:

Location: ~/.ssh/id_ed25519_{type}.pub

For example:

  • Personal profile: ~/.ssh/id_ed25519_personal.pub
  • Work profile: ~/.ssh/id_ed25519_work.pub

GitHub

  1. Copy your public key:

    cat ~/.ssh/id_ed25519_personal.pub
  2. Go to GitHub Settings → SSH and GPG keys: https://github.com/settings/ssh/new

  3. Click "New SSH key"

  4. Add a descriptive title (e.g., "Personal Laptop - John Doe")

  5. Paste your public key into the "Key" field

  6. Click "Add SSH key"

GitLab

  1. Copy your public key:

    cat ~/.ssh/id_ed25519_personal.pub
  2. Go to GitLab Settings → SSH Keys: https://gitlab.com/-/profile/keys

  3. Paste your public key into the "Key" field

  4. Add a descriptive title

  5. Click "Add key"

Bitbucket

  1. Copy your public key:

    cat ~/.ssh/id_ed25519_personal.pub
  2. Go to Bitbucket Settings → Personal settings → SSH keys: https://bitbucket.org/account/settings/ssh-keys/

  3. Click "Add key"

  4. Paste your public key and add a label

  5. Click "Add key"

Azure DevOps

  1. Copy your public key:

    cat ~/.ssh/id_ed25519_personal.pub
  2. Go to Azure DevOps → User Settings → SSH Public Keys: https://dev.azure.com/{organization}/_usersSettings/keys

  3. Click "New Key"

  4. Paste your public key and add a description

  5. Click "Add"

Other Services

Most Git hosting services follow a similar pattern:

  1. Navigate to your account settings
  2. Find the SSH keys section
  3. Add a new SSH key
  4. Paste the contents of your .pub file
  5. Save the key

Important: Make sure to add the correct public key for each profile to the corresponding account. For example, add your work profile's public key to your work GitHub/GitLab account, and your personal profile's key to your personal account.

Advanced Usage

Custom Profile Type

$ git-profile-setup add
? Enter name › John Doe
? Enter email › [email protected]
? Select profile type › custom
? Enter custom profile type › freelance

# Creates alias: git-john-doe
# SSH key: ~/.ssh/id_ed25519_freelance
# SSH key public: ~/.ssh/id_ed25519_freelance.pub
# SSH host: github.com-john-doe

Update Existing Profile

Running the command again with the same name updates the existing aliases:

$ git-profile-setup add --name "John Doe" --email "[email protected]" --type personal

# ... setup ...

✔ Updated alias in Bash (/home/user/.bashrc)
✔ Profile configured successfully!

Check Current Profile

$ git config user.name
John Doe

$ git config user.email
[email protected]

List All SSH Keys

$ ls ~/.ssh/id_ed25519*
/home/user/.ssh/id_ed25519_personal
/home/user/.ssh/id_ed25519_personal.pub
/home/user/.ssh/id_ed25519_work
/home/user/.ssh/id_ed25519_work.pub

Note: The .pub files are the public keys you need to add to your cloud service accounts (GitHub, GitLab, Bitbucket, etc.). See the "Adding SSH Keys to Cloud Services" section above for instructions.

View SSH Config

$ cat ~/.ssh/config

# git-profile: John Doe
Host github.com-john-doe
  HostName github.com
  User git
  IdentityFile /home/user/.ssh/id_ed25519_personal
  IdentitiesOnly yes

# git-profile: John Doe
Host github.com-john-doe-work
  HostName github.com
  User git
  IdentityFile /home/user/.ssh/id_ed25519_work
  IdentitiesOnly yes