Authentication
gh-cached needs a GitHub personal access token to call the GitHub GraphQL API. It resolves a token in the following order:
GH_TOKENenvironment variableGITHUB_TOKENenvironment variablegh auth token --hostname <host>(GitHub CLI, host-specific)gh auth token(GitHub CLI, any host)
If none of these are available, gh-cached exits with an error.
Personal access token
Create a token at GitHub Settings > Developer settings > Personal access tokens. The token needs the repo scope for private repositories.
Set it in your shell:
GitHub CLI
If you already use gh and have run gh auth login, gh-cached will use it automatically as a fallback.
GitHub Enterprise
For GitHub Enterprise hosts, pass the full repository path:
gh-cached resolves the API endpoint as https://ghe.example.com/api/graphql and uses gh auth token --hostname ghe.example.com when looking for a token.