tty

package
v0.0.49 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatUsageLines

func FormatUsageLines(info *UsageInfo) string

FormatUsageLines returns the canonical two-line CLI output for usage info.

Types

type Options

type Options struct {
	Debug       bool
	MaxAttempts int
}

Options configures FetchUsage.

type UsageInfo

type UsageInfo struct {
	WeeklyLimit string
	NextReset   string
}

UsageInfo holds parsed grok /usage show output.

func FetchUsage

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

FetchUsage launches grok in a PTY, submits /usage show, and parses the response.

func FetchUsageWithOptions

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

FetchUsageWithOptions launches grok with optional verbose logging and retries.

func ParseShowUsageOutput

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

ParseShowUsageOutput extracts weekly limit and next reset from grok scrollback or stdout.

Jump to

Keyboard shortcuts

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