codex

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package codex implements the Codex OAuth API usage provider.

Reads credentials from ~/.codex/auth.json (or $CODEX_HOME/auth.json), hits {base}/wham/usage for session/weekly metrics and credits balance, where {base} honors a chatgpt_base_url override in the Codex config (~/.codex/config.toml or $CODEX_HOME/config.toml) — matching the Codex CLI's own override plumbing — and defaults to chatgpt.com.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct{}

Provider fetches Codex usage data.

func (Provider) BrandBg added in v0.3.0

func (Provider) BrandBg() string

BrandBg returns the background color used on button faces.

func (Provider) BrandColor

func (Provider) BrandColor() string

BrandColor is deep indigo #3941FF — the bottom stop of the lavender→ indigo gradient used on the loading reference card. A single hex (rather than a runtime gradient) keeps Codex's rendered buttons visually uniform with every other provider; the gradient only survives on the pre-data loading SVG as a subtle brand accent.

func (Provider) Fetch

Fetch returns the latest Codex usage snapshot using the browser-proxied path when available and the OAuth direct path otherwise.

func (Provider) ID

func (Provider) ID() string

ID returns the provider identifier used by the registry.

func (Provider) MetricIDs

func (Provider) MetricIDs() []string

MetricIDs enumerates every metric this provider can emit.

func (Provider) Name

func (Provider) Name() string

Name returns the human-readable provider name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL