Skip to content

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

  1. github.com/acme/docsmatches patterngithub.com/acmeselectsOrg App
  2. github.com/tools/buildmatches patterngithub.com/toolsselectsTools App
Simplified App-only URL matching: the longest matching pattern selects the GitHub App. This is not the full App and personal access token resolution, and not how patterns are passed to --patterns.

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.

Terminal window
gh extension install AmadeusITGroup/gh-app-auth

Then follow Get started to register a GitHub App and clone a private repository with it.

  • 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 exec runs a command with a token from the same configuration, so scripts and Git share one source of truth.