Documentation
¶
Index ¶
- Constants
- func GetRefinement() (string, error)
- func InitTheme(cfg ThemeConfig)
- func RunSetupWizard() (*config.Config, error)
- func RunWithSpinner(ctx context.Context, provider llm.Provider, req llm.SuggestRequest) ([]llm.CommandSuggestion, error)
- func SelectCommand(suggestions []llm.CommandSuggestion, shell string, provider llm.Provider) (string, error)
- func SetTheme(t *Theme)
- func ShowCommand(cmd string)
- func ShowCommandHelp(command, shell string, provider llm.Provider) error
- func ShowError(msg string)
- func Truncate(s string, maxLen int) string
- type Styles
- type Theme
- type ThemeConfig
Constants ¶
const ( EnabledIcon = "●" DisabledIcon = "○" SuccessIcon = "✓" FailIcon = "✗" )
Status indicators
const SomethingElse = "__something_else__"
Variables ¶
This section is empty.
Functions ¶
func GetRefinement ¶
GetRefinement prompts the user for additional guidance
func RunSetupWizard ¶
RunSetupWizard runs the first-time setup wizard and returns the config
func RunWithSpinner ¶
func RunWithSpinner(ctx context.Context, provider llm.Provider, req llm.SuggestRequest) ([]llm.CommandSuggestion, error)
RunWithSpinner shows a spinner while executing the LLM request Returns suggestions, or error if cancelled or failed
func SelectCommand ¶
func SelectCommand(suggestions []llm.CommandSuggestion, shell string, provider llm.Provider) (string, error)
SelectCommand presents the user with a list of command suggestions and returns the selected one. Returns the selected command or SomethingElse if user wants to refine their request. If provider is non-nil and user presses 'h', shows help for the highlighted command.
func ShowCommand ¶
func ShowCommand(cmd string)
ShowCommand displays the command that will be executed (to stderr, keeping stdout clean)
func ShowCommandHelp ¶
ShowCommandHelp renders scrollable help for a command
Types ¶
type Styles ¶
type Styles struct {
// Text styles
Title lipgloss.Style
Subtitle lipgloss.Style
Success lipgloss.Style
Error lipgloss.Style
Muted lipgloss.Style
Bold lipgloss.Style
Highlighted lipgloss.Style
// Table styles
TableHeader lipgloss.Style
TableCell lipgloss.Style
TableBorder lipgloss.Style
// UI element styles
Spinner lipgloss.Style
Command lipgloss.Style
// contains filtered or unexported fields
}
Styles returns styled text helpers bound to a renderer
func DefaultStyles ¶
func DefaultStyles() *Styles
DefaultStyles returns styles for stderr (default TUI output)
func NewStyledWithTheme ¶
NewStyledWithTheme creates styles with a specific theme
func (*Styles) FormatEnabled ¶
FormatEnabled returns a styled enabled/disabled indicator
func (*Styles) FormatResult ¶
FormatResult returns a styled success/fail result
type Theme ¶
type Theme struct {
// Primary colors
Primary lipgloss.Color // main accent color (commands, highlights)
Secondary lipgloss.Color // secondary accent (headers, borders)
// Semantic colors
Success lipgloss.Color // success states, enabled
Error lipgloss.Color // error states, disabled
Warning lipgloss.Color // warnings
Muted lipgloss.Color // dimmed/secondary text
Text lipgloss.Color // primary text
// UI element colors
Spinner lipgloss.Color // loading spinner
Border lipgloss.Color // borders and dividers
Background lipgloss.Color // background (if needed)
}
Theme defines the color palette for the UI
func ThemeFromConfig ¶
func ThemeFromConfig(cfg ThemeConfig) *Theme
ThemeFromConfig creates a theme with config overrides applied