Help us shape the future of Go! Take the 2026 Go Developer Survey

tty

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatStatusLines

func FormatStatusLines(info *UsageInfo) string

FormatStatusLines returns the canonical three-line CLI output for status info.

Types

type Options

type Options struct {
	Debug bool
}

Options configures FetchStatusWithOptions.

type UsageInfo

type UsageInfo struct {
	MonthlyUsage string
	CreditsUsed  string
	CreditsTotal string
	NextReset    string
}

UsageInfo holds parsed Codex /status output.

func FetchStatus

func FetchStatus(ctx context.Context) (*UsageInfo, error)

FetchStatus launches Codex in an ephemeral ttywatch session and parses /status output.

func FetchStatusWithOptions

func FetchStatusWithOptions(ctx context.Context, opts Options) (*UsageInfo, error)

FetchStatusWithOptions launches Codex with optional verbose logging.

func ParseStatusSnapshot

func ParseStatusSnapshot(stdout string) (*UsageInfo, error)

ParseStatusSnapshot extracts monthly usage, credits, and reset from tty-watch snapshot text.

Jump to

Keyboard shortcuts

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