Versions in this module Expand all Collapse all v1 v1.1.2 Jan 31, 2025 v1.1.1 Jan 30, 2025 Changes in this version + const ConfirmFlag + const EnumType + const TimeType + var ErrActionNotAllowed = errors.New("you are not allowed to take this action") + var ErrTokenExpired = errors.New("your token is expired; run `render login` to get a new one") + var RFC3339RegexString = []string + func AddErrToStack(ctx context.Context, cmd *cobra.Command, err error) tea.Cmd + func AddToStackFunc[T any](ctx context.Context, cmd *cobra.Command, breadcrumb string, in T, m tea.Model) tea.Cmd + func AddToStack[T any](stack *tui.StackModel, cmd *cobra.Command, breadcrumb string, in T, ...) tea.Cmd + func CommandName(cmd *cobra.Command, v any) (string, error) + func DefaultFormatNonInteractive(cmd *cobra.Command) + func Fatal(cmd *cobra.Command, err error) + func GetConfirmFromContext(ctx context.Context) bool + func InputToString(v any) (string, error) + func LoadCmd[T any, D any](ctx context.Context, loadData func(context.Context, T) (D, error), in T) tui.TypedCmd[D] + func NewStringFormValue(s string) *stringFormValue + func NewStringSliceFormValue(s string) *stringSliceFormValue + func NonInteractiveWithConfirm[T any](cmd *cobra.Command, loadData LoadDataFunc[T], formatText FormatTextFunc[T], ...) (bool, error) + func NonInteractive[T any](cmd *cobra.Command, loadData LoadDataFunc[T], formatText FormatTextFunc[T]) (bool, error) + func PaginatedLoadCmd[T any, D any](ctx context.Context, ...) tui.TypedCmd[D] + func ParseCommand(cmd *cobra.Command, args []string, v any) error + func ParseCommandInteractiveOnly(cmd *cobra.Command, args []string, v any) error + func PrintData[T any](cmd *cobra.Command, data T, formatText FormatTextFunc[T]) (bool, error) + func Println(cmd *cobra.Command, format string, a ...any) + func RunProgram(name string, args ...string) error + func SetConfirmInContext(ctx context.Context, confirm bool) context.Context + func SetFormatInContext(ctx context.Context, output *Output) context.Context + func StructFromFormValues(formValues FormValues, v any) error + func TimeSuggestion(str string) []string + func WrapInConfirm[D any](cmd tui.TypedCmd[D], msgFunc func() (string, error)) tui.TypedCmd[D] + type CTXConfirmKey struct + type CTXConfirmValue struct + Confirm bool + type CTXOutputKey struct + type CTXOutputValue struct + Output *Output + type CobraEnum struct + func NewEnumInput(values []string, isMultiSelect bool) *CobraEnum + func (e *CobraEnum) IsMultiSelect() bool + func (e *CobraEnum) SelectedValues() []string + func (e *CobraEnum) Set(v string) error + func (e *CobraEnum) String() string + func (e *CobraEnum) Type() string + func (e *CobraEnum) Values() []string + type CobraTime struct + func NewTimeInput() *CobraTime + func (e *CobraTime) Get() *TimeOrRelative + func (e *CobraTime) Set(v string) error + func (e *CobraTime) String() string + func (e *CobraTime) Type() string + type ConfirmFunc func() (string, error) + type FormValue interface + String func() string + type FormValues map[string]FormValue + func FormValuesFromStruct(v any) FormValues + func HuhFormFields(cmd *cobra.Command, v any) ([]huh.Field, FormValues) + type FormatTextFunc func(T) string + type InteractiveFunc func(context.Context, func(T) tui.TypedCmd[D], T) (tea.Model, error) + type LoadDataFunc func() (T, error) + type Output string + const Interactive + const JSON + const TEXT + const YAML + func GetFormatFromContext(ctx context.Context) *Output + func StringToOutput(s string) (Output, error) + func (o *Output) Interactive() bool + type RequireConfirm struct + Confirm bool + MessageFunc func(ctx context.Context, args T) (string, error) + type TextTable interface + Header func() []string + Row func() []string + type TimeOrRelative struct + Relative *string + T *time.Time + func ParseTime(now time.Time, str *string) (*TimeOrRelative, error) + func (t *TimeOrRelative) String() string + type WrapOptions struct + RequireConfirm RequireConfirm[T] + type WrappedFunc func(ctx context.Context, args T) tea.Cmd