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

github-switcher

v0.1.3

Published

Manage multiple GitHub accounts on the same machine via SSH and git config.

Readme

github-switcher

Manage multiple GitHub accounts on the same machine via SSH and git config. Provides both an interactive CLI and explicit commands to add, list, delete, and switch accounts.

Installation

  • Run via npx (recommended):
npx github-switcher
  • Or install globally:
npm install -g github-switcher
github-switcher

Usage

  • Interactive mode (no subcommand):
npx github-switcher

This opens an Inquirer-based menu to:

  • List accounts
  • Add account
  • Switch account
  • Delete account

When adding an account interactively, you can choose to log in with GitHub in your browser. The CLI will:

  • Start a GitHub device authorization flow.

  • Ask you to open a GitHub URL and enter a short code.

  • Automatically fetch your GitHub username and primary email and pre-fill them for the new account.

  • Add an account:

npx github-switcher add \
  --id work \
  --username your-github-username \
  --email [email protected] \
  --label "Work" \
  --ssh-key-path ~/.ssh/id_github-work
  • List accounts:
npx github-switcher list
  • Delete an account:
npx github-switcher delete work --remove-key
  • Switch account (updates git identity):
npx github-switcher switch work

When switching:

  • git config --global user.name and git config --global user.email are updated.
  • If you run the command inside a git repository, the local repo config (git config user.name / user.email) is also updated.

SSH configuration

For each account, github-switcher:

  • Ensures ~/.ssh exists.
  • Generates an SSH keypair (by default ~/.ssh/id_github-<id>).
  • Manages a dedicated block in ~/.ssh/config between:
    • # github-switcher account: <id>
    • # github-switcher end

Each account gets a host alias like:

Host github-work
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_github-work

Use this alias in your git remotes, for example:

git remote add origin git@github-work:your-github-username/your-repo.git

Account storage

Accounts are stored globally in:

~/.github-switcher/accounts.json

This file tracks:

  • All configured accounts
  • The current active account id
  • Timestamps for creation and updates

Notes

  • The CLI expects git and ssh-keygen to be available on your PATH.
  • Node.js 18 or newer is recommended.
  • The GitHub browser login flow works out of the box - no configuration needed.