cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package cli implements the codex-usage commands.

Index

Constants

View Source
const (
	AuthBaseURLEnvVar    = "CODEX_USAGE_AUTH_BASE_URL"
	ChatGPTBaseURLEnvVar = "CODEX_USAGE_CHATGPT_BASE_URL"
)

Environment variables that point the CLI at other servers, for testing.

View Source
const ClaudeBinEnvVar = "CODEX_USAGE_CLAUDE_BIN"

ClaudeBinEnvVar overrides the Claude Code binary; "off" turns Claude Code support off.

Variables

This section is empty.

Functions

func ColorEnabled

func ColorEnabled(f *os.File) bool

ColorEnabled reports whether ANSI colors should be written to f.

func IsTerminal

func IsTerminal(f *os.File) bool

IsTerminal reports whether f is a terminal.

Types

type App

type App struct {
	Version     string
	Stdin       io.Reader
	Stdout      io.Writer
	Stderr      io.Writer
	Getenv      func(string) string
	HTTPClient  *http.Client
	Now         func() time.Time
	Location    *time.Location
	OpenBrowser func(url string) error
	Color       bool
	// Environ is the environment passed on to Claude Code.
	Environ func() []string
	// StdoutTerminal is set when stdout is a terminal rather than a pipe.
	StdoutTerminal bool
}

App holds the process environment; zero fields get working defaults.

func (*App) Run

func (a *App) Run(ctx context.Context, args []string) int

Run executes the command line and returns the process exit code.

Jump to

Keyboard shortcuts

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