Versions in this module Expand all Collapse all v0 v0.1.0 Aug 27, 2026 Changes in this version + const AlignCenter + const AlignLeft + const AlignRight + const VerbosityDebug + const VerbosityNormal + const VerbosityQuiet + func Exit(code int, args ...interface{}) error + type ActionFunc func(context.Context, *Input, *Output) error + type App = Command + type Args []string + func (a Args) First() string + func (a Args) Get(i int) string + func (a Args) Len() int + func (a Args) Present() bool + func (a Args) Slice() []string + func (a Args) Tail() []string + type Ask struct + func NewAsk(out *Output, raw interface{}) *Ask + func (a *Ask) Run() (interface{}, error) + func (a *Ask) SetReader(r io.Reader) *Ask + type BeforeFunc func(context.Context, *Input, *Output) (context.Context, error) + type BoolFlag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value bool + func (f BoolFlag) IsRequired() bool + func (f BoolFlag) Names() []string + func (f BoolFlag) TakesValue() bool + type Choice struct + func NewChoice(question string, choices map[string]string, defaultVal interface{}) *Choice + func (c *Choice) GetChoices() map[string]string + func (c *Choice) GetPrompt() string + func (c *Choice) IsMultiselect() bool + func (c *Choice) SetErrorMessage(msg string) *Choice + func (c *Choice) SetMultiselect(multiselect bool) *Choice + func (c *Choice) SetPrompt(prompt string) *Choice + type Command struct + Action ActionFunc + After HookFunc + Aliases []string + ArgsUsage string + Before BeforeFunc + CommandNotFound CommandNotFoundFunc + Description string + Flags []Flag + Hidden bool + Name string + Stdin io.Reader + Subcommands []*Command + Usage string + UsageText string + Version string + VersionPrinter VersionPrinterFunc + func New() *Command + func (c *Command) Run(ctx context.Context, args []string) error + type CommandNotFoundFunc func(context.Context, *Input, *Output, string) + type Confirmation struct + func NewConfirmation(question string, defaultVal bool, trueAnswerRegex string) *Confirmation + type DurationFlag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value time.Duration + func (f DurationFlag) IsRequired() bool + func (f DurationFlag) Names() []string + func (f DurationFlag) TakesValue() bool + type ExitError struct + Code int + Err error + func (e *ExitError) Error() string + func (e *ExitError) ExitCode() int + func (e *ExitError) Unwrap() error + type Flag interface + IsRequired func() bool + Names func() []string + TakesValue func() bool + type Float64Flag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value float64 + func (f Float64Flag) IsRequired() bool + func (f Float64Flag) Names() []string + func (f Float64Flag) TakesValue() bool + type Float64SliceFlag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value []float64 + func (f Float64SliceFlag) IsRequired() bool + func (f Float64SliceFlag) Names() []string + func (f Float64SliceFlag) TakesValue() bool + type Formatter struct + func NewFormatter() *Formatter + func (f *Formatter) Escape(text string) string + func (f *Formatter) Format(message string) string + func (f *Formatter) GetStyle(name string) (string, error) + func (f *Formatter) HasStyle(name string) bool + func (f *Formatter) IsDecorated() bool + func (f *Formatter) SetDecorated(decorated bool) + func (f *Formatter) SetStyle(name string, code string) + type GenericFlag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value flag.Value + func (f GenericFlag) IsRequired() bool + func (f GenericFlag) Names() []string + func (f GenericFlag) TakesValue() bool + type HookFunc func(context.Context, *Input, *Output) error + type Input struct + func (in *Input) Args() Args + func (in *Input) Bool(name string) bool + func (in *Input) Command() *Command + func (in *Input) Duration(name string) time.Duration + func (in *Input) FindCommand(name string) *Command + func (in *Input) Float64(name string) float64 + func (in *Input) Float64Slice(name string) []float64 + func (in *Input) Generic(name string) interface{} + func (in *Input) Int(name string) int + func (in *Input) Int64(name string) int64 + func (in *Input) IntSlice(name string) []int + func (in *Input) IsInteractive() bool + func (in *Input) IsSet(name string) bool + func (in *Input) NArg() int + func (in *Input) Root() *Command + func (in *Input) String(name string) string + func (in *Input) StringSlice(name string) []string + func (in *Input) Uint(name string) uint + type Int64Flag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value int64 + func (f Int64Flag) IsRequired() bool + func (f Int64Flag) Names() []string + func (f Int64Flag) TakesValue() bool + type IntFlag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value int + func (f IntFlag) IsRequired() bool + func (f IntFlag) Names() []string + func (f IntFlag) TakesValue() bool + type IntSliceFlag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value []int + func (f IntSliceFlag) IsRequired() bool + func (f IntSliceFlag) Names() []string + func (f IntSliceFlag) TakesValue() bool + type NotFoundError struct + Command string + func (e *NotFoundError) Error() string + type Output struct + func NewOutput() *Output + func (o *Output) Ask(question string, defaultVal interface{}) (interface{}, error) + func (o *Output) AskHidden(question string) (string, error) + func (o *Output) AskString(question, defaultVal string) (string, error) + func (o *Output) Choice(question string, choices map[string]string, defaultVal interface{}) (interface{}, error) + func (o *Output) Confirm(question string, defaultVal bool) (bool, error) + func (o *Output) Debug(args ...interface{}) + func (o *Output) Debugf(format string, args ...interface{}) + func (o *Output) Error(args ...interface{}) + func (o *Output) Errorf(format string, args ...interface{}) + func (o *Output) GetVerbosity() int + func (o *Output) Info(args ...interface{}) + func (o *Output) Infof(format string, args ...interface{}) + func (o *Output) RenderTable(t *Table) string + func (o *Output) SetVerbosity(level int) + func (o *Output) Success(args ...interface{}) + func (o *Output) Successf(format string, args ...interface{}) + func (o *Output) Table(header []string, rows [][]string) string + func (o *Output) TableAny(header []string, rows [][]interface{}) string + func (o *Output) Verbose(args ...interface{}) + func (o *Output) Verbosef(format string, args ...interface{}) + func (o *Output) Warn(args ...interface{}) + func (o *Output) Warnf(format string, args ...interface{}) + type Question struct + func NewQuestion(question string, defaultVal interface{}) *Question + func (q *Question) GetAutocompleterValues() []string + func (q *Question) GetDefault() interface{} + func (q *Question) GetMaxAttempts() *int + func (q *Question) GetNormalizer() func(string) string + func (q *Question) GetQuestion() string + func (q *Question) GetValidator() func(string) (interface{}, error) + func (q *Question) IsHidden() bool + func (q *Question) SetAutocompleterValues(values []string) *Question + func (q *Question) SetHidden(hidden bool) *Question + func (q *Question) SetMaxAttempts(attempts int) *Question + func (q *Question) SetNormalizer(normalizer func(string) string) *Question + func (q *Question) SetValidator(validator func(string) (interface{}, error)) *Question + type StringFlag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value string + func (f StringFlag) IsRequired() bool + func (f StringFlag) Names() []string + func (f StringFlag) TakesValue() bool + type StringSliceFlag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value []string + func (f StringSliceFlag) IsRequired() bool + func (f StringSliceFlag) Names() []string + func (f StringSliceFlag) TakesValue() bool + type Table struct + func NewTable() *Table + func (t *Table) AddRow(row []string, first bool) *Table + func (t *Table) AddRowAny(row []interface{}, first bool) *Table + func (t *Table) AddSection(title string) *Table + func (t *Table) AddSeparator() *Table + func (t *Table) Render() string + func (t *Table) SetCellAlign(align int) *Table + func (t *Table) SetHeader(header []string, align int) *Table + func (t *Table) SetRows(rows [][]string, align int) *Table + func (t *Table) SetStyle(style string) *Table + type UintFlag struct + Aliases []string + DefaultText string + Hidden bool + Name string + Required bool + Sources ValueSource + Usage string + Value uint + func (f UintFlag) IsRequired() bool + func (f UintFlag) Names() []string + func (f UintFlag) TakesValue() bool + type UsageError struct + Msg string + func (e *UsageError) Error() string + type ValueSource interface + Lookup func() (string, bool) + String func() string + func EnvVars(envs ...string) ValueSource + type VersionPrinterFunc func(context.Context, *Input, *Output)