Documentation
¶
Index ¶
- func ValidateFormat(format, value string) error
- type Confirm
- func (c *Confirm) Affirmative(text string) *Confirm
- func (c *Confirm) Description(description string) *Confirm
- func (c *Confirm) Key(key string) *Confirm
- func (c *Confirm) Negative(text string) *Confirm
- func (c *Confirm) Run() error
- func (c *Confirm) Title(title string) *Confirm
- func (c *Confirm) Validate(validate func(bool) error) *Confirm
- func (c *Confirm) Value(value *bool) *Confirm
- func (c *Confirm) WithTheme(theme *huh.Theme) *Confirm
- type Input
- func (i *Input) CharLimit(limit int) *Input
- func (i *Input) Description(description string) *Input
- func (i *Input) Format(format string) *Input
- func (i *Input) Key(key string) *Input
- func (i *Input) Placeholder(placeholder string) *Input
- func (i *Input) Required(required bool) *Input
- func (i *Input) Run() error
- func (i *Input) Title(title string) *Input
- func (i *Input) Validate(validate func(string) error) *Input
- func (i *Input) Value(value *string) *Input
- func (i *Input) WithTheme(theme *huh.Theme) *Input
- type MultiSelect
- func (m *MultiSelect[T]) Description(description string) *MultiSelect[T]
- func (m *MultiSelect[T]) Height(height int) *MultiSelect[T]
- func (m *MultiSelect[T]) Key(key string) *MultiSelect[T]
- func (m *MultiSelect[T]) Limit(limit int) *MultiSelect[T]
- func (m *MultiSelect[T]) Options(options ...Option[T]) *MultiSelect[T]
- func (m *MultiSelect[T]) Run() error
- func (m *MultiSelect[T]) Title(title string) *MultiSelect[T]
- func (m *MultiSelect[T]) Validate(validate func([]T) error) *MultiSelect[T]
- func (m *MultiSelect[T]) Value(value *[]T) *MultiSelect[T]
- func (m *MultiSelect[T]) WithTheme(theme *huh.Theme) *MultiSelect[T]
- type Option
- type Select
- func (s *Select[T]) CLI() (*cobra.Command, error)
- func (s *Select[T]) Description(description string) *Select[T]
- func (s *Select[T]) Handler(h func(ctx context.Context, value T, fields map[string]string) (any, error)) *Select[T]
- func (s *Select[T]) Height(height int) *Select[T]
- func (s *Select[T]) Options(options ...Option[T]) *Select[T]
- func (s *Select[T]) RegisterCLI(parent *cobra.Command) error
- func (s *Select[T]) RegisterTools(server *mcp.Server) error
- func (s *Select[T]) Run(ctx context.Context) (any, error)
- func (s *Select[T]) Title(title string) *Select[T]
- func (s *Select[T]) ToCLI() (*cobra.Command, error)
- func (s *Select[T]) ToSubcommands() ([]*cobra.Command, error)
- func (s *Select[T]) ToTools() ([]ToolDef, error)
- func (s *Select[T]) ToolPrefix(prefix string) *Select[T]
- func (s *Select[T]) Validate(validate func(T) error) *Select[T]
- func (s *Select[T]) Value(value *T) *Select[T]
- func (s *Select[T]) WithTheme(theme *huh.Theme) *Select[T]
- type Text
- func (t *Text) CharLimit(limit int) *Text
- func (t *Text) Description(description string) *Text
- func (t *Text) Key(key string) *Text
- func (t *Text) Lines(lines int) *Text
- func (t *Text) Placeholder(placeholder string) *Text
- func (t *Text) Required(required bool) *Text
- func (t *Text) Run() error
- func (t *Text) Title(title string) *Text
- func (t *Text) Validate(validate func(string) error) *Text
- func (t *Text) Value(value *string) *Text
- func (t *Text) WithTheme(theme *huh.Theme) *Text
- type Theme
- func (t *Theme) FangColorScheme() func(lipgloss.LightDarkFunc) fang.ColorScheme
- func (t *Theme) WithError(c color.Color) *Theme
- func (t *Theme) WithMuted(c color.Color) *Theme
- func (t *Theme) WithPrimary(c color.Color) *Theme
- func (t *Theme) WithSecondary(c color.Color) *Theme
- func (t *Theme) WithSurface(c color.Color) *Theme
- func (t *Theme) WithSurfaceLight(c color.Color) *Theme
- type ToolDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateFormat ¶
Types ¶
type Confirm ¶
type Confirm struct {
// contains filtered or unexported fields
}
func NewConfirm ¶
func NewConfirm() *Confirm
func (*Confirm) Affirmative ¶
func (*Confirm) Description ¶
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
func (*Input) Description ¶
func (*Input) Placeholder ¶
type MultiSelect ¶
type MultiSelect[T comparable] struct { // contains filtered or unexported fields }
func NewMultiSelect ¶
func NewMultiSelect[T comparable]() *MultiSelect[T]
func (*MultiSelect[T]) Description ¶
func (m *MultiSelect[T]) Description(description string) *MultiSelect[T]
func (*MultiSelect[T]) Height ¶
func (m *MultiSelect[T]) Height(height int) *MultiSelect[T]
func (*MultiSelect[T]) Key ¶
func (m *MultiSelect[T]) Key(key string) *MultiSelect[T]
func (*MultiSelect[T]) Limit ¶
func (m *MultiSelect[T]) Limit(limit int) *MultiSelect[T]
func (*MultiSelect[T]) Options ¶
func (m *MultiSelect[T]) Options(options ...Option[T]) *MultiSelect[T]
func (*MultiSelect[T]) Run ¶
func (m *MultiSelect[T]) Run() error
func (*MultiSelect[T]) Title ¶
func (m *MultiSelect[T]) Title(title string) *MultiSelect[T]
func (*MultiSelect[T]) Validate ¶
func (m *MultiSelect[T]) Validate(validate func([]T) error) *MultiSelect[T]
func (*MultiSelect[T]) Value ¶
func (m *MultiSelect[T]) Value(value *[]T) *MultiSelect[T]
func (*MultiSelect[T]) WithTheme ¶
func (m *MultiSelect[T]) WithTheme(theme *huh.Theme) *MultiSelect[T]
type Option ¶
type Option[T comparable] struct { Key string Value T // contains filtered or unexported fields }
func NewOption ¶
func NewOption[T comparable](key string, value T) Option[T]
func NewOptions ¶
func NewOptions[T comparable](values ...T) []Option[T]
func (Option[T]) Description ¶
type Select ¶
type Select[T comparable] struct { // contains filtered or unexported fields }
func NewSelect ¶
func NewSelect[T comparable]() *Select[T]
func (*Select[T]) Description ¶
func (*Select[T]) RegisterCLI ¶
RegisterCLI adds all generated subcommands to an existing Cobra command.
func (*Select[T]) ToCLI ¶
ToCLI generates Cobra commands from the Select menu. Each MCP-enabled option becomes a subcommand. Fields become flags on the subcommand.
func (*Select[T]) ToSubcommands ¶
ToSubcommands generates Cobra subcommands without a root wrapper. Use this to attach commands directly to an existing Cobra root.
func (*Select[T]) ToolPrefix ¶
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
func (*Text) Description ¶
func (*Text) Placeholder ¶
type Theme ¶
type Theme struct {
// Primary is the main accent color (titles, commands)
Primary color.Color
// Secondary is for less prominent elements (descriptions, comments)
Secondary color.Color
// Muted is for dimmed/inactive elements
Muted color.Color
// Surface is for backgrounds (e.g., code blocks, usage boxes)
Surface color.Color
// SurfaceLight is for backgrounds on dark terminals (defaults to slightly lighter Surface)
SurfaceLight color.Color
// Error is for error states
Error color.Color
}
Theme defines colors for yeahno CLI output. Use NewTheme() or DefaultTheme() to create one.
func (*Theme) FangColorScheme ¶
func (t *Theme) FangColorScheme() func(lipgloss.LightDarkFunc) fang.ColorScheme
FangColorScheme converts the theme to a fang.ColorScheme. Use this with fang.WithColorSchemeFunc().
func (*Theme) WithPrimary ¶
WithPrimary returns a copy of the theme with a new primary color.
func (*Theme) WithSecondary ¶
WithSecondary returns a copy of the theme with a new secondary color.
func (*Theme) WithSurface ¶
WithSurface returns a copy of the theme with a new surface color.