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

@moritakaaz/ghml

v1.0.2

Published

GitHub Multi-Login - Switch between multiple GitHub accounts on one device using SSH keys

Downloads

437

Readme

ghml - GitHub Multi-Login

A CLI tool to manage multiple GitHub accounts on a single device using SSH keys.

Switch between personal, work, and other GitHub accounts seamlessly without manual SSH key juggling.

Install

npm install -g @moritakaaz/ghml

Quick Start

# Add your first account
ghml add

# Add another account
ghml add

# Switch global active account
ghml switch

# Check status
ghml status

Commands

| Command | Alias | Description | |---------|-------|-------------| | ghml add | | Add a new GitHub account (interactive) | | ghml remove | | Remove an account + cleanup SSH keys | | ghml list | ghml ls | List all accounts | | ghml switch | ghml sw | Switch global active account | | ghml init | | Set account for current repo | | ghml status | ghml st | Show active account info | | ghml clone [url] | | Clone repo with specific account | | ghml doctor | | Health check all accounts |

How It Works

SSH Strategy

Each account gets its own SSH key and host alias:

~/.ssh/ghml_personal        # SSH key for "personal"
~/.ssh/ghml_work            # SSH key for "work"

In ~/.ssh/config:

Host github-personal
  HostName github.com
  User git
  IdentityFile ~/.ssh/ghml_personal
  IdentitiesOnly yes

Host github-work
  HostName github.com
  User git
  IdentityFile ~/.ssh/ghml_work
  IdentitiesOnly yes

Account Priority

  1. Per-repo (set via ghml init) - highest priority
  2. Global (set via ghml switch) - fallback

Per-Repo Setup

When you run ghml init inside a repo:

  • Local git config is set (user.name, user.email)
  • Remote URL is converted to use the SSH alias (e.g., git@github-work:org/repo.git)
  • A .ghml file is created in the repo root

This means the repo will always use the assigned account, regardless of global switch.

Workflow Examples

Adding accounts

$ ghml add
# Account alias: personal
# GitHub username: myuser
# Email: [email protected]
# → SSH key generated
# → Copy the public key to https://github.com/settings/keys

$ ghml add
# Account alias: work
# GitHub username: work-user
# Email: [email protected]

Working with repos

# Clone with a specific account
ghml clone https://github.com/org/project.git

# Or configure an existing repo
cd ~/projects/work-project
ghml init
# → Select "work" account
# → Remote URL updated, local git config set

# Check what account is active
ghml status

Health check

$ ghml doctor
# [OK]   [personal] SSH private key
# [OK]   [personal] SSH config entry
# [OK]   [personal] SSH connection - Authenticated
# [OK]   [work] SSH private key
# [OK]   [work] SSH config entry
# [FAIL] [work] SSH connection - Permission denied
# → Key not added to GitHub?

Storage

| Location | Purpose | |----------|---------| | ~/.ghml/config.json | Account list + active account | | ~/.ssh/ghml_<alias> | SSH private key per account | | ~/.ssh/ghml_<alias>.pub | SSH public key per account | | ~/.ssh/config | SSH host aliases (managed via markers) | | .ghml (in repo root) | Per-repo account assignment |

Conventional Commits

This project uses Conventional Commits for versioning:

feat: add new command        # → minor version bump (1.0.0 → 1.1.0)
fix: handle edge case        # → patch version bump (1.0.0 → 1.0.1)
feat!: breaking change       # → major version bump (1.0.0 → 2.0.0)

Requirements

  • Node.js >= 16.0.0
  • Git
  • ssh-keygen (comes with Git on Windows)

License

MIT