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-janus

v1.0.1

Published

Janus helps you switch between multiple Git accounts on a single machine

Readme

Janus

Manage multiple Git identities on a single machine — personal, work, or anything else.


How it works

Janus uses three native mechanisms that Git and SSH already support — it just wires them together for you automatically:

| Mechanism | What it does | |---|---| | ~/.janus/<profile>.gitconfig | Stores the name + email for each profile | | ~/.gitconfig [includeIf "gitdir:..."] | Auto-applies the right identity based on which folder you're in | | ~/.ssh/config Host block | Routes SSH auth to the correct key per profile |


Installation

# Install globally from npm
npm install -g git-janus

The CLI command is janus:

janus --help

Or run from source:

git clone https://github.com/dev-juri/git-janus.git
cd git-janus
npm install
npm run build
npm link          # makes `janus` available globally

During development, use npm run dev -- instead of janus:

npm run dev -- add
npm run dev -- list

Quick start

1. Add a profile

janus add

You'll be walked through:

  • Profile name (e.g. work)
  • Your full name and email for commits
  • Git host (github.com, gitlab.com or bitbucket.org)
  • Project folder — where your repos for this profile will live
  • SSH key — auto-generate a new Ed25519 key, or point to an existing one

At the end, Janus will:

  • Create the project folder if it doesn't exist
  • Write ~/.janus/work.gitconfig with your name, email, and URL rewrite rule
  • Append an [includeIf] block to ~/.gitconfig
  • Append a Host block to ~/.ssh/config

If a new SSH key was generated, the public key is shown and you can open your Git host's SSH key settings page directly from the prompt.

You can also pre-fill the project folder path as a flag:

janus add --dir ~/work

2. That's it

Any repo cloned under the profile's project folder will automatically use that profile's identity:

cd ~/work
janus clone <repo url>   # uses work SSH key + work identity automatically

Commands

janus add [--dir <path>]

Interactive wizard to create a new profile. Automates:

  • Project folder creation
  • SSH key generation (or import of existing key)
  • ~/.gitconfig patching ([includeIf] block)
  • ~/.ssh/config patching (Host alias block)

janus clone <url> [destination] [git clone options]

Clones a repo using the correct SSH key for the active profile — no alias required. Detects the profile from the current directory, falling back to the last janus use selection.

cd ~/work
janus clone [email protected]:org/repo.git          # standard SSH URL
janus clone https://github.com/org/repo.git      # HTTPS — converted to SSH automatically
janus clone org/repo                             # shorthand
janus clone [email protected]:org/repo.git ~/dest   # custom destination

Any extra flags are passed directly to git clone (--depth, --branch, etc.).

janus use <profile>

Manually sets a profile as the global Git identity fallback — affects all directories that don't have a matching [includeIf] block.

janus use work

Janus saves your current identity before overwriting it, so you can restore it with janus reset.

janus use <profile> --local

Sets the identity for the current repository only — writes to .git/config. Useful when a repo lives outside its profile's normal folder.

cd ~/some-other-place/work-repo
janus use work --local

This overrides everything — even [includeIf] blocks.

janus reset

Restores the global identity to what it was before the last janus use call.

janus use work   # switches to work
# ... do work ...
janus reset           # restores previous identity exactly

If there's no snapshot (i.e. janus use was never run), janus reset fully unsets user.name and user.email from the global config, so Git falls back to whatever was in ~/.gitconfig before Janus was involved.

janus list

Shows all profiles in a table, with the currently active one highlighted.

janus list

#    Profile               Email                           Project Dir
#    --------------------------------------------------------------------------------------
#  ●  work                  [email protected]                   /Users/jane/work/
#     personal              [email protected]               /Users/jane/personal

janus status

Shows the effective Git identity in your current directory — and tells you whether it came from a folder match ([includeIf]) or the global fallback.

janus status

# Directory  /Users/jane/work/acme/some-repo
# Identity   Jane Doe <[email protected]>
# Profile    work  [folder-matched ✓]
# Global     Jane <[email protected]>  [personal]

janus remove <profile>

Removes a profile after confirmation. Cleans up:

  • The Host block in ~/.ssh/config
  • The [includeIf] block in ~/.gitconfig
  • The ~/.janus/<profile>.gitconfig file

Your project folder is never deleted.


Using existing SSH keys

When running janus add, choose "I already have a key — enter path" when prompted for SSH key setup. Janus will reference your existing key without moving or modifying it.

To import multiple existing identities, run janus add once per profile and point each to its respective key file.


The global fallback pattern

If you manage your personal identity through your default ~/.gitconfig (without adding it as a Janus profile), you don't need to do anything special. Janus only appends [includeIf] blocks — it never overwrites your existing [user] section.

The recommended setup for this case:

janus add   # add work profile only
# personal identity stays as-is in ~/.gitconfig

If you ever need to temporarily work globally under a different identity:

janus use work    # overrides global; saves your personal identity first
# ... do work ...
janus reset            # restores personal identity exactly

Platforms

Works on macOS and Windows (Windows 10+ with OpenSSH). Uses os.homedir() for all path resolution so home directories are always correct regardless of platform.