pub fn resolve_token() -> Option<(SecretString, TokenSource)>Expand description
Resolves a GitHub token using the priority chain with session-level caching.
Caches the resolved token to avoid repeated subprocess calls to gh auth token.
The cache is valid for the lifetime of the session (CLI invocation).
Checks sources in order:
GH_TOKENenvironment variableGITHUB_TOKENenvironment variable- GitHub CLI (
gh auth token) - System keyring (native aptu auth)
Returns the token and its source, or None if no token is found.