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-context-switcher

v2.0.0

Published

Per-directory and per-remote git identities (author, SSH key, signing), built on git's native includeIf

Readme

Git Context Switcher

CI codecov npm version License: MIT

Use the right git identity — name, email, SSH key and commit signing — automatically, based on where a repo lives or where its remote points.

It's a thin layer over git's own conditional includes. Git does the matching; this tool writes the config for you, checks it, and catches the mistakes.

$ git-context add work --dir ~/work --remote github.com/acme --email [email protected] --ssh-key ~/.ssh/id_acme --sign ssh -y
✔ Added "work"

$ cd ~/src/some-acme-repo && git-context whoami
  context  work            (~/.gitconfig.d/work.gitconfig)
  name     Burton          (~/.gitconfig)
  email    [email protected]      (~/.gitconfig.d/work.gitconfig)
  signing  ssh             (~/.gitconfig.d/work.gitconfig)
  ssh      ssh -i ~/.ssh/id_acme -o IdentitiesOnly=yes  (~/.gitconfig.d/work.gitconfig)

What you get

| | | |---|---| | Directory and remote matching | --dir ~/work uses gitdir:; --remote github.com/acme uses hasconfig:remote.*.url: so a repo cloned anywhere still gets the right identity, for https and ssh URLs alike | | SSH keys and signing per context | Sets core.sshCommand so pushes use the right key, and SSH or GPG commit signing. Maintains an allowed-signers file so git log --show-signature verifies your own commits | | whoami | The identity git will actually use here, and which file each value came from | | doctor | Catches the classic mistakes: a global [user] block that silently overrides every context, gitdir: patterns missing their trailing slash, missing key files | | Identity guard | Optional. Makes git refuse to commit where no context sets an email, instead of quietly using your personal address at work | | audit | Scans a folder of repos for recent commits made with the wrong one of your emails | | Plays nicely with your config | Only touches includes that point into ~/.gitconfig.d/. Hand-written includes and everything else stay put. Backs up your gitconfig before every change | | Scriptable | Every command works non-interactively with flags; list, whoami, doctor and audit have --json |

Install

Needs Node.js 22.13+ and git 2.36+ (older git still does directory matching).

npm install -g git-context-switcher
git-context setup      # interactive wizard

Quick start

# A context per identity
git-context add personal --dir ~/personal --email [email protected] -y
git-context add work --dir ~/work --remote github.com/acme --email [email protected] --sign ssh --ssh-key ~/.ssh/id_acme -y

# Check it
git-context doctor
cd ~/work/api && git-context whoami

# Optional: refuse commits anywhere no context applies
git-context guard on

# Find past slips
git-context audit ~/src --since "6 months ago"

Upgrading from 1.x? Your contexts are migrated automatically the first time you run any command (your old ~/.gitcontexts is kept as ~/.gitcontexts.v1.bak). See the changelog for what changed.

Documentation

Contributing

See CONTRIBUTING.md. npm run check runs lint, type checks and tests; tests run real git in a throwaway home directory.

License

MIT, see LICENSE.

Security

See SECURITY.md.