Overview of ghtkn
mainghtkn (G-H Token) is a tool for creating short-lived GitHub App User Access Tokens via the OAuth device flow. It is designed to replace long-lived Personal Access Tokens (PATs) for secure local development.
Tokens can be cached in several backends:
- OS keyring
- The
ghtkn agent(recommended for containers, VMs, or minimal Linux environments) - A plain text file
Use ghtkn to authenticate the GitHub CLI (gh), Git, and other tools without exposing long-lived credentials.
$ ghtkn --help