explaingit

miguelbalvin-dev/gam

Analysis updated 2026-05-18

0TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A command-line tool that lets developers manage and switch between multiple GitHub accounts using secure OAuth login instead of passwords or tokens.

Mindmap

mindmap
  root((GAM))
    Purpose
      Multiple GitHub Accounts
      One Terminal
    Auth
      OAuth Device Flow
      No Passwords Or PATs
      OS Keychain Storage
    Commands
      gam add
      gam use
      gam list
      gam status
      gam doctor
    Architecture
      Commands Layer
      Services Layer
      GitHub Client
      Credential Helper

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Manage separate personal and work GitHub accounts from one terminal without juggling SSH keys or tokens.

USE CASE 2

Switch which credentials git push and git pull use by running a single command to change the active account.

USE CASE 3

Authenticate to GitHub via a secure browser-based OAuth flow instead of creating and copying personal access tokens.

USE CASE 4

Run a built-in health check to diagnose problems with git config, stored tokens, or the credential helper.

What is it built with?

TypeScriptNode.jsCommander.jsOAuth

How does it compare?

miguelbalvin-dev/gam0xradioac7iv/tempfs7vignesh/pgpulse
Stars000
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

On Linux you need to install libsecret separately for keychain support.

In plain English

GAM, short for Git Account Manager, is a command line tool for developers who need to work with more than one GitHub account, for example a personal account and a separate work account, from the same computer. Instead of juggling personal access tokens or SSH keys, GAM handles authentication for you using GitHub's own browser-based OAuth login flow, and it comes with a built-in OAuth client so there is no setup required before you can start using it. To get going, you install the tool globally through npm, then run a command to add each GitHub account you want to manage. Adding an account opens your browser to GitHub's device login page, and once you approve it there, GAM asks you to pick a short local nickname for that account, like work or personal, separate from your actual GitHub username. Tokens are stored securely in your operating system's keychain rather than as plain text files. Once you have added your accounts, you can switch between them with a single command, and GAM automatically updates your global Git username and email to match. It also registers itself as a Git credential helper, so when you run git push or git pull, the currently active account's credentials are used automatically without you having to log in again or juggle multiple SSH keys. Other commands let you list all configured accounts and see which one is active, check the current account's status and confirm your Git configuration matches it, remove an account and its stored token, and run a built-in health check called doctor that verifies Git is installed, accounts are configured correctly, tokens exist with the right permissions, and the credential helper is properly registered, offering a fix suggestion for anything that fails. Under the hood, the code is organized into clearly separated layers: thin command handlers, a services layer holding the actual business logic with no direct file or network access, a module for talking to GitHub's API and OAuth device flow, and a module for running Git commands, plus a storage layer for saving configuration and tokens. It requires Node.js 18 or later, Git, and on Linux, the libsecret library for keychain support. Accounts set up before this alias feature existed are automatically upgraded the first time they are read, without changing any stored data.

Copy-paste prompts

Prompt 1
I need a Node.js CLI tool that lets me manage multiple GitHub accounts and switch which one git push uses. How would I implement a git credential helper in TypeScript?
Prompt 2
Show me how to implement GitHub's OAuth Device Flow (RFC 8628) in a command-line tool using Node.js.
Prompt 3
How do I store an OAuth token securely in the OS keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) from a Node.js CLI app?
Prompt 4
I want to build a CLI health-check command, like doctor, that runs several checks and reports pass or fail with suggested fixes. Show me a pattern for this in TypeScript.
Prompt 5
How can I make git push and git pull automatically use different credentials depending on which account is currently active in my own CLI tool?

Frequently asked questions

What is gam?

A command-line tool that lets developers manage and switch between multiple GitHub accounts using secure OAuth login instead of passwords or tokens.

What language is gam written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, Commander.js.

How hard is gam to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is gam for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.