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

@guruvedhanth-s/git-id

v2.1.1

Published

CLI tool to manage multiple Git identities with automatic GitHub SSH key setup. Use regular git commands with --profile flag.

Readme

Git Identity Manager - CLI Tool

Development README for the Git Identity Manager CLI package

A CLI tool to manage multiple Git identities with automatic GitHub SSH key setup. Use the regular git command with --profile flag to work with different GitHub accounts.

Features

  • Use Regular Git - Just add --profile to any git command
  • Multiple Git Profiles - Create and switch between different Git identities
  • GitHub OAuth Integration - Sign in with GitHub to auto-configure everything
  • Automatic SSH Key Management - Generates and uploads SSH keys to GitHub
  • Automatic Shell Configuration - Sets up --profile support on installation
  • Profile-based Cloning - Clone repos with the correct identity automatically

For Users

Installation from npm

npm i -g @guruvedhanth-s/git-id

That's it! Shell configuration is automatic.

For complete documentation, see:


For Developers

Setup Development Environment

# Clone the repository
git clone https://github.com/guruvedhanth-s/Git-Identity-Manager.git
cd Git-Identity-Manager/git-id-cli

# Install dependencies
npm install

# Build TypeScript
npm run build

# Link globally for testing
npm link

Development Workflow

# Build after changes
npm run build

# Run in development mode
npm run dev

# Test the CLI
git-id --version
git-id list

Quick Start

# Create a profile with GitHub sign-in
git-id add --github

# List your profiles  
git-id list

# Clone with a profile
git clone https://github.com/user/repo.git --profile work

# Check current identity
git-id current

Commands Overview

Using --profile with Git

Add --profile <name> to any git command:

# Clone with profile
git clone https://github.com/company/project.git --profile work
git clone https://github.com/personal/repo.git --profile personal

# Push with profile
git push origin main --profile work

# Pull with profile  
git pull --profile personal

# Any git command works!
git fetch --profile work
git commit -m "message" --profile personal

Profile Management Commands

# List all profiles
git-id list

# Create new profile (with GitHub sign-in)
git-id add --github

# Create new profile (manual)
git-id add --manual

# Switch profile in current repo
git-id use work
git-id use personal --global  # Apply globally

# Show current identity
git-id current

# Test SSH connection
git-id test work

# Delete a profile
git-id delete oldprofile
git-id delete --all  # Delete all profiles

Usage Examples

Create and Use Profiles

# Create work profile
git-id add --github
→ Name: work
→ Sign in with work GitHub account

# Create personal profile
git-id add --github
→ Name: personal  
→ Sign in with personal GitHub account

# Clone work repository
git clone https://github.com/company/project.git --profile work
cd project
git-id current  # Verify: Profile: work

# Clone personal repository
git clone https://github.com/username/my-project.git --profile personal
cd my-project
git-id current  # Verify: Profile: personal

Switch Profile in Existing Repo

cd existing-repo

# Check current identity
git-id current

# Switch to different profile
git-id use work

# Verify
git config user.email  # Shows work email

Work with Multiple Accounts

# Setup profiles for each account
git-id add --github  # work
git-id add --github  # personal
git-id add --github  # client

# Use different profiles for different repos
git clone [email protected]:company/repo.git --profile work
git clone [email protected]:username/project.git --profile personal
git clone [email protected]:client/app.git --profile client

# Each repo automatically uses the correct identity and SSH key

Project Structure

git-id-cli/
├── src/
│   ├── index.ts              # Main CLI entry point
│   ├── profile-manager.ts    # Profile CRUD operations
│   ├── github-auth.ts        # GitHub OAuth flow
│   ├── ssh-manager.ts        # SSH key generation & upload
│   ├── git-config.ts         # Git configuration management
│   ├── git-wrapper.ts        # Git command wrapper for --profile
│   ├── prompts.ts            # CLI prompts
│   └── types.ts              # TypeScript types
├── scripts/
│   └── postinstall.js        # Automatic shell configuration
├── dist/                     # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README.md                 # This file

How It Works

Profile Storage

Profiles are stored in ~/.git-id/profiles.json:

{
  "work": {
    "name": "John Doe",
    "email": "[email protected]",
    "github": "john-work",
    "sshKey": "~/.ssh/id_ed25519_work",
    "signingKey": null
  }
}

SSH Key Management

  • Key Generation: ED25519 keys are generated per profile
  • Key Location: ~/.ssh/id_ed25519_<profile>
  • SSH Config: Auto-configured in ~/.ssh/config with host aliases
  • GitHub Upload: Public keys uploaded via OAuth during profile creation

Git Configuration

When you use a profile, these Git configs are set:

git config --local user.name "John Doe"
git config --local user.email "[email protected]"
git config --local core.sshCommand "ssh -i ~/.ssh/id_ed25519_work"

Shell Integration

The postinstall script adds this function to your shell:

git() {
    if [[ " $* " == *" --profile "* ]]; then
        gitp "$@"
    else
        command git "$@"
    fi
}

This intercepts git --profile commands and routes them through the CLI tool.


File Locations

| What | Location | |------|----------| | Profiles | ~/.git-id/profiles.json | | SSH Keys | ~/.ssh/id_ed25519_<profile> | | SSH Config | ~/.ssh/config | | Shell Config | ~/.bashrc or ~/.zshrc |


Development Commands

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run in dev mode (with ts-node)
npm run dev

# Link globally for testing
npm link

# Unlink
npm unlink -g

# Test the build
npm pack  # Creates tarball to inspect

# Publish to npm (with build)
npm publish

Troubleshooting Development Issues

TypeScript Errors

# Clean and rebuild
rm -rf dist/
npm run build

Testing Locally

# Link the package
npm link

# Test commands
git-id --version
git-id list
git-id add --github

# Unlink when done
npm unlink -g

Shell Function Not Working

# Check if linked
which git-id
which gitp

# Reload shell config
source ~/.bashrc

# Test function
type git  # Should show "git is a function"

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

MIT