cli

package
v2.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ExitOK             = 0
	ExitUsage          = 1
	ExitIO             = 2
	ExitAbort          = 3
	ExitInternal       = 4
	ExitManagedInstall = 5 // `update` refused: binary is managed by brew / go install
)

Variables

This section is empty.

Functions

func Decide

func Decide(args []string) (printVersion bool, textPath string)

Decide maps root-level legacy args to startup decisions. It is pure: no os.Exit, no I/O, no usage dump.

func ExitCode

func ExitCode(err error) int

ExitCode maps an error returned by Execute into a process exit code.

func NewRoot

func NewRoot(opts ...Option) *cobra.Command

NewRoot builds the root command. Root-level unknown args intentionally fall through to the TUI; recognized subcommands keep strict cobra parsing.

Types

type ExitError

type ExitError struct {
	Code int
	Err  error
}

ExitError carries the process exit code for command failures.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

type Option

type Option func(*env)

func WithCodeLoader

func WithCodeLoader(load func(string) (string, error)) Option

func WithHistoryLoader

func WithHistoryLoader(load func() []storage.Record) Option

func WithHomeRunner

func WithHomeRunner(run func(context.Context, string, string) error) Option

func WithModelRunner

func WithModelRunner(run func(context.Context, tea.Model) error) Option

func WithSettingsStore

func WithSettingsStore(load func() config.Settings, save func(config.Settings) error) Option

func WithStdin

func WithStdin(stdin io.Reader) Option

func WithWriters

func WithWriters(stdout, stderr io.Writer) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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