Documentation
¶
Overview ¶
Package store persists signed-in accounts to a JSON file.
Index ¶
Constants ¶
View Source
const ( // FileVersion is the accounts file format written by this build. FileVersion = 1 // HomeEnvVar overrides the directory holding the accounts file. HomeEnvVar = "CODEX_USAGE_HOME" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct {
Label string `json:"label"`
Email string `json:"email,omitempty"`
PlanType string `json:"plan_type,omitempty"`
UserID string `json:"chatgpt_user_id,omitempty"`
AccountID string `json:"chatgpt_account_id,omitempty"`
FedRAMP bool `json:"fedramp,omitempty"`
Tokens auth.Tokens `json:"tokens"`
LastRefresh time.Time `json:"last_refresh"`
AddedAt time.Time `json:"added_at"`
NeedsRelogin bool `json:"needs_relogin,omitempty"`
// InCodex marks the account whose session was handed to the Codex CLI
// with `switch`. Codex's auth.json then holds the same session, and the
// newer copy wins whenever they differ.
InCodex bool `json:"in_codex,omitempty"`
}
Account is one signed-in ChatGPT account and workspace.
func (*Account) ApplyIdentity ¶
ApplyIdentity copies identity claims onto the account.
type File ¶
File is the on-disk accounts file.
func (*File) Find ¶
Find resolves a label or email to account positions. An exact label match wins; otherwise every account with that email matches.
type Store ¶
type Store struct {
Path string
}
Store reads and writes the accounts file at Path.
Click to show internal directories.
Click to hide internal directories.