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

@tongmenglaysmae/gitch

v1.0.0

Published

Git account switcher — manage multiple Git identities

Readme

gitch

CI License: MIT

Switch between multiple Git accounts in seconds. Manage SSH keys, git configs, and GitHub CLI auth per profile.

Why gitch?

Managing multiple Git accounts (work, personal, open source) usually means manually editing ~/.ssh/config, juggling git config --global, and hoping you don't push to the wrong repo with the wrong identity. gitch automates all of this:

  • One command to switchgitch use work sets your global git identity, SSH routing, and GitHub CLI auth in one shot
  • Per-directory identities — bind a profile to a directory and it auto-activates when you cd into it
  • SSH key isolation — each profile gets its own SSH host alias with IdentitiesOnly yes, following GitHub's official best practices
  • Headless mode — every command works non-interactively for CI, scripts, and AI agents
  • Automatic backups — every config change is backed up, and you can restore with gitch restore

Install

Requires Bun runtime. Until this package is published under a name you control, install from source:

git clone https://github.com/Joselay/gitch.git
cd gitch
bun install
bun link

Quick Start

# Create a profile (interactive)
gitch add work

# Create a profile (headless — for CI/scripts)
gitch add work --name "John Doe" --email "[email protected]" --generate-key

# Switch global identity
gitch use work

# See who you are
gitch whoami

# List all profiles
gitch list

Commands

| Command | Description | |---|---| | gitch add <profile> | Create a new git profile | | gitch use <profile> | Switch global git identity | | gitch whoami | Show active profile | | gitch list | List all profile names | | gitch status | Detailed view of profiles and bindings | | gitch edit <profile> | Edit an existing profile | | gitch rename <old> <new> | Rename a profile (preserves SSH config and bindings) | | gitch remove <profile> | Delete a profile | | gitch bind <profile> [path] | Bind a directory to a profile | | gitch unbind [path] | Remove a directory binding | | gitch clone <profile> <repo> | Clone a repo with a profile's SSH routing | | gitch doctor | Check system health and profile validity | | gitch restore [backup] | Restore config from a backup | | gitch init <shell> | Output shell hook for auto-switching |

Directory Bindings

Bind a profile to a directory so it auto-activates when you cd into it:

# Bind current directory
gitch bind work

# Bind a specific path
gitch bind personal ~/projects/side-project

# Remove a binding
gitch unbind ~/projects/side-project

Shell Integration

Add auto-switching so gitch applies the correct profile when you cd into a bound directory.

zsh — add to ~/.zshrc:

eval "$(gitch init zsh)"

bash — add to ~/.bashrc:

eval "$(gitch init bash)"

fish — add to ~/.config/fish/config.fish:

gitch init fish | source

Once configured, gitch automatically switches your local git identity when you enter a bound directory.

Headless Mode

All commands work non-interactively for scripts, CI, and AI agents:

# Add profile without prompts
gitch add work \
  --name "John Doe" \
  --email "[email protected]" \
  --ssh-key ~/.ssh/id_ed25519_work \
  --gh-username johndoe

# Generate SSH key and add it to GitHub automatically
gitch add deploy --name "Deploy" --email "[email protected]" --generate-key --add-to-github

# Test SSH connection after setup
gitch add work --name "John" --email "[email protected]" --generate-key --test-ssh

# Remove without confirmation
gitch remove old-profile --yes

How It Works

  • Profiles are stored in ~/.gitch/config.json
  • Each profile gets an SSH host alias in ~/.ssh/config with IdentitiesOnly yes (prevents key conflicts)
  • gitch use sets git config --global user.name/email, applies url.*.insteadOf rewriting (so existing clones use the correct SSH key), and optionally switches gh auth
  • gitch bind sets git config --local user.name/email for per-directory identity
  • gitch add --add-to-github uses gh ssh-key add to register keys programmatically
  • gitch add --test-ssh verifies the SSH connection works after setup
  • Automatic backups are created before every config change (max 10 retained)

Development

bun install          # install dependencies
bun test             # run tests
bun run lint         # lint with Biome
bun run typecheck    # type check
bun run check        # lint + typecheck + test (all at once)
bun run build        # compile standalone binary to dist/gitch

See CONTRIBUTING.md for more details.

License

MIT