acct
acct [--help] [--version]
Running acct in a terminal opens guided setup, while non-interactive processes receive the tip sheet; --help lists every command.
npm install -g acct-sh
acct
acct --helpACCT · V0.2
The npm package is acct-sh, and acct is the command you run to manage your folder-based GitHub identity.
An explicit profile applies to gh, status, and exec for the current process, while Git HTTPS still follows the directory.
acct searches upward from the Git worktree root, or the current directory outside Git, and ignores markers below the repository root. An empty profile explicitly unbinds the repository.
The longest canonical directory binding wins, with strict mode refusing conflicts between a worktree and its common Git directory.
When no profile applies, strict mode blocks managed operations that require an identity.
Git identity and managed authentication follow your folder when the IDE uses the Git installation where you configured acct. Zed’s Git integration uses Git for repository operations, while Vim and Neovim can use the same setup through shell commands or Git plugins that invoke that Git installation.
In JetBrains IDEs, select your Git executable and enable Use credential helper under Settings → Version Control → Git so HTTPS operations use acct’s helper.
JetBrains Git settingsZed disables Git hooks and credential helpers in untrusted projects, so the project must be trusted for acct’s managed Git operations.
An IDE’s own GitHub account and pull-request integration stay separate. For gh commands in an IDE task that does not load your shell hook, use acct exec to resolve the folder’s profile explicitly.
acct status
acct exec gh pr listInstall the package, then run acct for guided setup.
acct [--help] [--version]
Running acct in a terminal opens guided setup, while non-interactive processes receive the tip sheet; --help lists every command.
npm install -g acct-sh
acct
acct --helpacct init --id <id> --user <githubUser> --email <email> --name <name> [options]
Run without flags for guided setup, or provide the profile fields to create a profile, bind a directory tree, and install identity includes and global chaining hooks non-interactively.
acct init \
--id work \
--user your-work-user \
--email you@company.com \
--name "Your Name" \
--bind ~/WorkA profile is one GitHub user, git identity, and credential set.
acct profile add --id <id> --user <githubUser> --email <email> --name <name> [options]
Create a profile without binding a folder, then connect it to a directory with acct bind.
acct profile add \
--id personal \
--user you-home \
--email you@home \
--name "Your Name"acct profile list
Print every profile as id, user@host, email, and protocol.
acct profile listacct profile show <id>
Print one profile as JSON with its token omitted.
acct profile show workacct profile remove <id>
Remove a profile after unbinding its directories. Secrets and SSH keys shared by other profiles are preserved.
acct profile remove workacct profile token <id> (--import-gh | --stdin)
Store a token in the OS keychain. One of --import-gh or --stdin is required.
acct profile token work --import-gh
printf '%s' "$PAT" | acct profile token work --stdinacct profile ssh-key <id> (--generate | --path <path>) [--protocol https|ssh]
Generate an ed25519 key for the profile, or attach an existing private key. The scoped HTTPS helper stays installed for SSH profiles too.
acct profile ssh-key work --generate
acct profile ssh-key work --path ~/.ssh/id_workLongest matching bound path wins. Leave the tree and that account stops applying.
acct bind <dir> <profileId> [--enforce strict|warn|off]
Map a canonical directory tree to a profile. Bind a repository root or a parent tree; a subdirectory inside a repository is rejected. Installed identity includes are refreshed automatically.
acct bind ~/Personal personalacct rebind <old> <new>
Move a binding and its nested binding subtree to a new canonical directory. Doctor reports missing or moved paths.
acct rebind ~/OldWork ~/Workacct local set [profileId] [--unbound]
Set the repository-root .acct marker and matching local Git identity include. An empty profile explicitly unbinds the repository. A marker below the root is ignored and diagnosed.
acct local set work
acct local set --unboundacct local clear
Remove the root-local marker and only acct's local identity include, returning to directory binding resolution.
acct local clearacct unbind <dir>
Remove a directory’s profile binding while keeping the profile itself.
acct unbind ~/DownloadsWhen something feels off, run these before changing config.
acct status [--profile <id>]
Show how the current directory resolves, including its binding, profile, identity, token presence, and authenticated account. When errors are found, explain the problem and suggested commands, indicate whether commit or push can proceed, and exit with code 1.
acct statusacct whoami [--profile <id>]
Print expected GitHub user, actual login, and commit email. Exit codes: 0 for a match, 1 for a mismatch, 2 when the principal is unknown or the directory is unbound.
acct whoamiacct doctor [--online]
Inspect helper order, hook coverage, stale shims, missing bindings, tokens, and keyring availability. The default offline check makes no API calls and does not persist token values from gh, although first access may migrate existing plaintext secrets.
acct doctor
acct doctor --onlineacct ssh-test <id>
Test SSH auth for a profile against github.com using that profile's key.
acct ssh-test workThese commands supply GH_TOKEN for gh, while Git HTTPS continues to follow the directory binding.
acct exec [--profile <id>] [--allow-cross-profile] <command...>
Run a command with the profile’s GH_TOKEN while Git HTTPS follows the directory binding or .acct marker. Commands that mutate global gh authentication, including gh auth switch, login, and token, are refused.
acct exec gh pr list
acct exec --profile work --allow-cross-profile gh api useracct clone <url> [git-clone-args...] [--profile <id>]
Clone with the selected profile environment. Git HTTPS credentials still follow the directory binding, not GH_TOKEN. Unknown profiles and strict worktree conflicts are refused.
acct clone https://github.com/org/repo.gitChoose whether identity mismatches block an operation, produce a warning, or receive no enforcement, with local settings taking precedence.
acct enforce <strict|warn|off|on>
Set the default enforcement mode, using on as an alias for strict, or override a specific binding with acct bind --enforce.
acct enforce strictacct install [--repo] [--global] [--force]
Wire scoped Git identity and global v3 chaining hooks. Use --repo for a repository with a local hooksPath override; its previous local path is baked into separate repository shims.
acct installacct uninstall [--restore-backup]
Remove managed includes and restore recorded hook paths only where acct owns the shims. Per-repository shim directories are removed. Existing OS credential helpers can still answer for GitHub; review the uninstall warning.
acct uninstall --restore-backupThe hook resolves the profile from the current directory on each prompt after stripping any previously exported ACCT_PROFILE.
acct hook <bash|zsh|fish|powershell>
Print a hook to load from your shell startup file so changing directories refreshes the profile environment or clears it outside bound folders.
eval "$(acct hook zsh)"
eval "$(acct hook bash)"
acct hook fish | source
acct hook powershell | Out-String | Invoke-Expressionacct shell-env [--powershell | --fish]
Print environment exports for the current directory’s profile, which the shell hook normally handles for you.
acct shell-envacct wrap-install
Install optional PATH shims that invoke gh as acct exec gh, then add the wrap-path export to your shell.
acct wrap-install
eval "$(acct wrap-path)"acct wrap-path [--powershell | --fish]
Print the PATH export for wrapper shims, installing them first if they are missing.
eval "$(acct wrap-path)"Git hooks call these commands automatically; run them by hand only when debugging their behavior.
acct hook-run <pre-commit|pre-merge-commit|pre-push> [remote] [url]
Pre-commit and pre-merge-commit check effective identity. Pre-push checks every outgoing recorded identity and the actual remote authentication. Post-commit only chains existing hooks; it has no hook-run entry.
acct hook-run pre-pushSettings live in config.yaml, while tokens stay in your OS keychain or the explicitly selected file backend.