Documentation
¶
Overview ¶
Package auth loads (and, when necessary, refreshes) the OAuth credentials that Claude Code and Codex already store on disk / in the Keychain. We reuse the official tools' credentials rather than managing our own login.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaudeAuth ¶
type ClaudeAuth struct {
// contains filtered or unexported fields
}
ClaudeAuth provides a current Claude access token, reloading from the store (Keychain on macOS, ~/.claude/.credentials.json elsewhere) and refreshing via the refresh token when needed.
func NewClaudeAuth ¶
func NewClaudeAuth() *ClaudeAuth
NewClaudeAuth returns an empty holder; the token is loaded lazily.
func (*ClaudeAuth) Refresh ¶
func (a *ClaudeAuth) Refresh(ctx context.Context) (string, error)
Refresh exchanges the refresh token for a new access token and writes the rotated credentials back to the store so the official CLI stays in sync.
type CodexAuth ¶
type CodexAuth struct {
// contains filtered or unexported fields
}
CodexAuth loads and refreshes the Codex OAuth tokens stored in ~/.codex/auth.json (or $CODEX_HOME/auth.json).
func NewCodexAuth ¶
func NewCodexAuth() *CodexAuth
func (*CodexAuth) AccountID ¶
AccountID returns the ChatGPT account id, sent as the chatgpt-account-id header on usage requests.
func (*CodexAuth) Refresh ¶
Refresh exchanges the refresh token for a new access token and writes the rotated tokens back to auth.json so the Codex CLI stays in sync.