acct

acct

Switch GitHub accounts by folder. Automatically.

Bind a directory to a GitHub user, email, and token. Open that folder and you are that account. Leave it and that identity is gone. No global switch. No wrong-account pushes.

See how it works
cwd: /Users/you/Work/api
reason: binding
enforce: strict
binding: /Users/you/Work
profile: work
github: your-work-user@github.com
identity: Your Name <you@company.com>
protocol: https
token: present (keychain)
auth principal: your-work-user

Install

Three steps to folder-scoped GitHub accounts.

Install the CLI, bind a folder to a profile, then add the shell hook so every new terminal picks up the right account from your current directory. Full command reference.

01 · Install
02 · Init + bind
03 · Hook + verify

The problem

Multiple GitHub accounts on one machine is easy to get wrong.

Work in ~/Work, personal in ~/Personal. Without folder-scoped identity, git and gh keep using the last account you switched to. That is how commits and pushes leak across jobs.

No manual account switching.No silent wrong-account push.

Git config is not login

Setting user.name and user.email only changes the commit stamp. Pushing still uses whatever credentials are active, so you can author as one person and authenticate as another.

gh auth switch is global

Switching accounts in the GitHub CLI affects your whole machine. Open a personal repo after a work day and you can still be on the wrong account.

Credentials ignore your folders

HTTPS helpers usually key off the host (github.com), not which project directory you are in. Two people on the same host look the same to git.

SSH offers every key

Your agent will try keys until one works. Without locking identity to a folder, the wrong key can win.

What acct controls

Everything that can leak a GitHub identity across folders.

One tool keeps commit author, push credentials, SSH key, and gh aligned to the directory you are in.

Git identity

Sets the right name and email for commits inside each bound folder, so work and personal authorship stay separate.

HTTPS push / pull

Serves the token for this folder's GitHub account. If nothing matches, it refuses instead of falling back to the wrong credentials.

SSH

Uses only the SSH key for the active profile, so the agent cannot authenticate you as someone else.

GitHub CLI (gh)

Points gh at the same account as the folder. You do not need gh auth switch when you change directories.

Guards

Optional hooks stop commits and pushes when the email or GitHub user does not match the bound profile.

How it chooses

  1. 1. Explicit profile override
  2. 2. Repo-local .acct file
  3. 3. Longest matching folder bind
  4. 4. Unbound (no acct identity)

More specific paths always beat broader ones.

Releases

FAQ

Common questions, plain answers.

Every flag is on the command reference. Deep rules: invariants and threat model.

Keep work and personal GitHub accounts
tied to the right folders.

Install once, bind your trees, and stop switching accounts by hand.

Install stepsView on GitHub