GitHub CLI extension and Git credential helper
Authenticate across organizations. Keep Git simple.
Precise GitHub App and personal access token routing for Git and GitHub CLI workflows. Configure each credential once, then let the credential helper pick the right one for every remote.
App-only URL matching, illustrated
github.com/acme/docsmatches patterngithub.com/acmeselectsOrg Appgithub.com/acme/apimatches patterngithub.com/acme/apiselectsAPI Appgithub.com/tools/buildmatches patterngithub.com/toolsselectsTools App
--patterns.The problem it solves
Section titled “The problem it solves”A GitHub App installation token belongs to one installation, and installation tokens expire after an hour. A developer or pipeline that touches repositories in several organizations, including submodules, ends up juggling several credentials by hand.
gh-app-auth is a Git credential helper packaged as a GitHub CLI extension. You register each
GitHub App or personal access token (PAT) together with the repository patterns it covers. When Git
asks for credentials, the helper matches the remote against those patterns and returns the right
one.
Install
Section titled “Install”gh extension install AmadeusITGroup/gh-app-authThen follow Get started to register a GitHub App and clone a private repository with it.
How it fits together
Section titled “How it fits together”- Patterns choose credentials. App patterns are matched against whole path segments, and the longest match selects the GitHub App. See how credential routing works.
- Tokens stay short-lived and in memory. Installation tokens are cached in memory for 55 minutes per process and are never written to disk. Private keys live in the OS keyring by default; see the known limitations before relying on a filesystem fallback.
- One helper for Git and the CLI.
gh app-auth execruns a command with a token from the same configuration, so scripts and Git share one source of truth.
Where to go next
Section titled “Where to go next”- Start here: Get started: install, register an App, clone, and run a command.
- Guides: Manage credentials, Git integration and CI.
- Reference: CLI, configuration and environment and the GitHub Actions.
- Understand: routing, security model and architecture.
- Troubleshoot and contribute: troubleshooting and development.