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

githat

v1.0.2

Published

Seamlessly manage multiple GitHub accounts on a single machine

Readme

🎩 GitHat

Switch your Git Hats

GitHat is a lightweight CLI tool that lets you bind GitHub accounts per repository and run Git commands securely using HTTPS + encrypted tokens. Seamlessly manage multiple GitHub accounts on a single machine — without SSH, without credential conflicts, and without leaking tokens.


✨ Why GitHat?

If you’ve ever:

  • worked with personal + work GitHub accounts
  • accidentally pushed a commit with the wrong identity
  • fought with SSH keys, global Git config, or credential helpers

👉 GitHat fixes all of that.

What GitHat does differently

  • ✅ No SSH setup required
  • ✅ No global Git config changes
  • ✅ No credential helper pollution
  • ✅ Repo-level account binding
  • ✅ Encrypted token storage
  • ✅ Works with standard git commands

🧠 Core Idea

GitHat introduces account-aware Git execution.

You can either:

  • explicitly choose an account
  • or bind an account to a repo and forget about it
githat personal: git push
githat git push   # auto-uses bound account

📦 Installation

npm install -g githat

Verify:

githat --version

🛠️ Getting Started

1️⃣ Add a GitHub account

GitHat uses HTTPS + Personal Access Tokens (PAT).

githat add personal \
  --user yourGithubUsername \
  --email [email protected] \
  --token YOUR_GITHUB_TOKEN

🔒 Tokens are encrypted before being stored.


2️⃣ List configured accounts

githat list

Output:

📂 GitHat Accounts:
personal → Your Name <[email protected]>
work     → Company Name <[email protected]>

3️⃣ Use an account explicitly (prefix mode)

githat personal: git clone https://github.com/user/repo
githat work: git push

✔ No SSH ✔ No prompts ✔ No credential caching


🔗 Repo-Level Binding (Recommended)

Bind an account once per repository.

Bind an account

cd my-project
githat bind personal

This creates:

.git/githat.json
{
  "account": "personal"
}

Check repo status

githat status

Output:

📌 Repo bound to: personal

Use Git normally (no prefix!)

githat git add .
githat git commit -m "Initial commit"
githat git push

🎯 GitHat automatically uses the bound account.


🔐 Security Model

GitHat is designed to never leak credentials.

Token protection

  • Tokens are encrypted at rest
  • Decrypted only in memory
  • Never written to Git config
  • Never exposed in logs

Git execution

  • credential.helper disabled
  • GIT_ASKPASS used securely
  • GIT_TERMINAL_PROMPT=0
  • No global Git state touched

🧩 Supported Commands

Account Management

githat add <name>
githat list
githat remove <name>

Repo Binding

githat bind <name>
githat status

Git Passthrough

githat personal: git push
githat git pull
githat git clone <url>

❌ What GitHat Does NOT Do (by design)

  • ❌ Does not modify ~/.gitconfig
  • ❌ Does not rely on SSH keys
  • ❌ Does not override system Git
  • ❌ Does not store tokens in plaintext
  • ❌ Does not affect normal git usage

🏗️ Architecture Overview

CLI Entry
 ├── Prefix Parser (personal:)
 ├── Repo Binding Resolver
 ├── Account Loader
 └── Git Executor
        ├── Token Injection
        ├── Identity Override
        └── Secure AskPass

🧪 Example Workflow

# Setup once
githat add personal --user john --email [email protected] --token XXX
githat add work --user john-work --email [email protected] --token YYY

# Per repo
cd work-repo
githat bind work

cd personal-repo
githat bind personal

# Forever after
githat git push   # always correct account

🚧 Roadmap

v1.1.0

  • Auto-bind on clone
  • githat unbind
  • Repo override warnings

v1.2.0

  • GitHub Enterprise support
  • Token rotation helpers

🤝 Contributing

PRs are welcome.

git clone https://github.com/yourname/githat
cd githat
npm install
npm link

📄 License

MIT License © 2025


❤️ Final Words

GitHat exists to make multi-account Git workflows boring again — no surprises, no mistakes, no stress.

If you work with multiple GitHub accounts, this tool is for you.