Documentation
¶
Index ¶
- Variables
- func Blue(text string) string
- func ColoredText(text, color string) string
- func Confirm(prompt string) (bool, error)
- func ConfirmWithDefault(prompt string, defaultYes bool) (bool, error)
- func DetectUserJourney(orgName string, userData map[string]interface{}) string
- func EvaluationConfirm(prompt string) (bool, error)
- func Green(text string) string
- func LightMagenta(text string) string
- func Max(a, b int) int
- func Min(a, b int) int
- func ParseOrgSelection(selection string) (name, id string)
- func PrintBasicText(msg string)
- func PrintContextMessage(context, message string)
- func PrintCurrentStatus(entity, name, id string)
- func PrintDivider()
- func PrintError(err error) error
- func PrintEvaluationTip(tip string)
- func PrintEvaluationWelcome(orgName string)
- func PrintFormattedMessage(level, prefix, message string, color lipgloss.Color)
- func PrintJSON(data interface{}) error
- func PrintJSONError(err error)
- func PrintLn(msg string)
- func PrintNoItemsMessage(entity, createCommand string)
- func PrintNotFoundMessage(entity, id, listCommand string)
- func PrintNotSetMessage(entity, selectCommand string)
- func PrintPlain(text string)
- func PrintStep(step int, total int, message string)
- func PrintStyledError(text string)
- func PrintStyledHighlight(text string)
- func PrintStyledInfo(text string)
- func PrintStyledSuccess(text string)
- func PrintSuccess(msg string)
- func PrintUnsetStatus(entity string)
- func PrintWarning(msg string)
- func PrintWithColor(msg, color string)
- func PrintfError(format string, args ...interface{})
- func PrintfLn(format string, args ...interface{})
- func PrintfSuccess(format string, args ...interface{})
- func PrintfWarning(format string, args ...interface{})
- func PromptWithAutoApprove(autoApprove bool, msg string, vars ...interface{}) error
- func Red(text string) string
- func RenderMarkdownTable(headers []string, rows [][]string) string
- func RunOnboarding(userJourney string) error
- func RunSpinnerWithContext(ctx context.Context, message string, operation func(ctx context.Context) error, ...) error
- func SelectApp(apps []AppOption) (string, error)
- func SelectFromItems(title string, items []SelectorItem) (string, error)
- func SelectFromItemsWithMaxRows(title string, items []SelectorItem, maxVisibleRows int) (string, error)
- func SelectFromOptions(title string, options []string) (string, error)
- func SelectFromOptionsWithMaxRows(title string, options []string, maxVisibleRows int) (string, error)
- func SelectInstall(installs []InstallOption) (string, error)
- func SelectOrg(orgs []OrgOption) (string, error)
- func SelectWorkflow(workflows []WorkflowOption) (string, error)
- func ShowConfirmDialog(message string) (bool, error)
- func ShowEvaluationWelcome()
- func StyleError(text string) string
- func StyleHighlight(text string) string
- func StyleInfo(text string) string
- func StyleSuccess(text string) string
- func Yellow(text string) string
- type AppOption
- type CLIUserError
- type ConfirmDialogModel
- type ConfirmModel
- type FinalRenderMsg
- type InstallOption
- type MultiSpinnerModel
- func (m *MultiSpinnerModel) AddSpinner(id, message string)
- func (m MultiSpinnerModel) AllCompleted() bool
- func (m MultiSpinnerModel) HasErrors() bool
- func (m MultiSpinnerModel) Init() tea.Cmd
- func (m MultiSpinnerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m MultiSpinnerModel) View() string
- type MultiSpinnerView
- func (v *MultiSpinnerView) AddSpinner(id, message string)
- func (v *MultiSpinnerView) AllCompleted() bool
- func (v *MultiSpinnerView) CompleteSpinner(id string, success bool, finalMsg string)
- func (v *MultiSpinnerView) HasErrors() bool
- func (v *MultiSpinnerView) Start()
- func (v *MultiSpinnerView) Stop()
- func (v *MultiSpinnerView) UpdateSpinner(id, message string)
- func (v *MultiSpinnerView) Wait()
- type OnboardingModel
- type OnboardingStep
- type OrgOption
- type RenderCompleteMsg
- type SelectorItem
- type SelectorModel
- type SpinnerCompleteMsg
- type SpinnerModel
- type SpinnerMsg
- type SpinnerResult
- type SpinnerResultMsg
- type SpinnerState
- type SpinnerUpdateMsg
- type SpinnerView
- type StyledText
- func (s *StyledText) Error(text string) string
- func (s *StyledText) Highlight(text string) string
- func (s *StyledText) Info(text string) string
- func (s *StyledText) Print(text string)
- func (s *StyledText) PrintError(text string)
- func (s *StyledText) PrintHighlight(text string)
- func (s *StyledText) PrintInfo(text string)
- func (s *StyledText) PrintSubtle(text string)
- func (s *StyledText) PrintSuccess(text string)
- func (s *StyledText) PrintWarning(text string)
- func (s *StyledText) Println(text string)
- func (s *StyledText) Subtle(text string) string
- func (s *StyledText) Success(text string) string
- func (s *StyledText) Warning(text string) string
- type TableModel
- type TableView
- type WorkflowOption
Constants ¶
This section is empty.
Variables ¶
var ( // Neutral colors - use terminal's default colors BorderColor = styles.BorderInactiveColor // Base styles BaseStyle = lipgloss.NewStyle(). Padding(0, 1) // Status message styles InfoStyle = lipgloss.NewStyle(). Foreground(styles.InfoColor). Bold(true). Padding(0, 1) ErrorStyle = lipgloss.NewStyle(). Foreground(styles.ErrorColor). Bold(true). Padding(0, 1) WarningStyle = lipgloss.NewStyle(). Foreground(styles.WarningColor). Bold(true). Padding(0, 1) SuccessStyle = lipgloss.NewStyle(). Foreground(styles.SuccessColor). Bold(true). Padding(0, 1) // Interactive styles FocusedStyle = lipgloss.NewStyle(). Foreground(styles.PrimaryColor). Bold(true) BlurredStyle = lipgloss.NewStyle(). Foreground(styles.SubtleColor) // Border styles: padded but border-less BorderStyle = lipgloss.NewStyle(). Padding(1) FocusedBorderStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(styles.PrimaryColor). Padding(1, 2) )
Common styles and colors for consistent theming Using ANSI colors to respect terminal color schemes
var ( EvaluationHeaderStyle = lipgloss.NewStyle(). Foreground(styles.AccentColor). Bold(true). Underline(true). Margin(1, 0) EvaluationTipStyle = lipgloss.NewStyle(). Foreground(styles.InfoColor). Italic(true). Padding(0, 1) )
Evaluation journey specific styling
Functions ¶
func ColoredText ¶
Helper functions for backward compatibility
func ConfirmWithDefault ¶
ConfirmWithDefault shows a confirmation with a default choice
func DetectUserJourney ¶
Helper function to detect user journey from org or other data
func EvaluationConfirm ¶
EvaluationConfirm shows a confirmation with evaluation journey styling
func LightMagenta ¶
func ParseOrgSelection ¶
ParseOrgSelection parses a "Name: ID" formatted string (for backward compatibility)
func PrintBasicText ¶
func PrintBasicText(msg string)
PrintBasicText prints basic text without styling (for backward compatibility)
func PrintContextMessage ¶
func PrintContextMessage(context, message string)
Context-aware messaging
func PrintCurrentStatus ¶
func PrintCurrentStatus(entity, name, id string)
func PrintDivider ¶
func PrintDivider()
func PrintError ¶
PrintError prints error messages with appropriate styling and error handling logic
func PrintEvaluationTip ¶
func PrintEvaluationTip(tip string)
func PrintEvaluationWelcome ¶
func PrintEvaluationWelcome(orgName string)
Evaluation journey specific messages
func PrintFormattedMessage ¶
Formatted printing functions
func PrintJSONError ¶
func PrintJSONError(err error)
func PrintNoItemsMessage ¶
func PrintNoItemsMessage(entity, createCommand string)
func PrintNotFoundMessage ¶
func PrintNotFoundMessage(entity, id, listCommand string)
func PrintNotSetMessage ¶
func PrintNotSetMessage(entity, selectCommand string)
func PrintPlain ¶
func PrintPlain(text string)
PrintPlain outputs plain text (replacement for pterm.Println)
func PrintStyledError ¶
func PrintStyledError(text string)
PrintError outputs error text (replacement for pterm.LightRed)
func PrintStyledHighlight ¶
func PrintStyledHighlight(text string)
PrintHighlight outputs highlighted text (replacement for pterm.LightMagenta)
func PrintStyledInfo ¶
func PrintStyledInfo(text string)
PrintInfo outputs info text (replacement for pterm.LightCyan)
func PrintStyledSuccess ¶
func PrintStyledSuccess(text string)
PrintSuccess outputs success text (replacement for pterm.LightGreen)
func PrintUnsetStatus ¶
func PrintUnsetStatus(entity string)
func PrintWithColor ¶
func PrintWithColor(msg, color string)
PrintWithColor prints colored text with the specified color
func PrintfError ¶
func PrintfError(format string, args ...interface{})
func PrintfSuccess ¶
func PrintfSuccess(format string, args ...interface{})
func PrintfWarning ¶
func PrintfWarning(format string, args ...interface{})
func PromptWithAutoApprove ¶
PromptWithAutoApprove prompts for confirmation unless auto-approved
func RenderMarkdownTable ¶
RenderMarkdown renders a simple markdown-like table
func RunOnboarding ¶
RunOnboarding runs the onboarding flow
func RunSpinnerWithContext ¶
func RunSpinnerWithContext(ctx context.Context, message string, operation func(ctx context.Context) error, json bool) error
RunSpinnerWithContext runs a spinner for the duration of a context operation
func SelectFromItems ¶
func SelectFromItems(title string, items []SelectorItem) (string, error)
SelectFromItems shows a selector with SelectorItem structs
func SelectFromItemsWithMaxRows ¶
func SelectFromItemsWithMaxRows(title string, items []SelectorItem, maxVisibleRows int) (string, error)
SelectFromItemsWithMaxRows shows a selector with SelectorItem structs and a specific max visible rows
func SelectFromOptions ¶
SelectFromOptions shows a selector with simple string options
func SelectFromOptionsWithMaxRows ¶
func SelectFromOptionsWithMaxRows(title string, options []string, maxVisibleRows int) (string, error)
SelectFromOptionsWithMaxRows shows a selector with simple string options and a specific max visible rows
func SelectInstall ¶
func SelectInstall(installs []InstallOption) (string, error)
SelectInstall shows an installation selector
func SelectWorkflow ¶
func SelectWorkflow(workflows []WorkflowOption) (string, error)
SelectWorkflow shows a workflow selector
func ShowConfirmDialog ¶
Show displays the confirmation dialog and returns the result This provides a pterm-compatible API for easy migration
func ShowEvaluationWelcome ¶
func ShowEvaluationWelcome()
ShowEvaluationWelcome displays the evaluation welcome message
func StyleError ¶
StyleError returns error-styled text (replacement for pterm.LightRed())
func StyleHighlight ¶
StyleHighlight returns highlighted text (replacement for pterm.LightMagenta())
func StyleSuccess ¶
StyleSuccess returns success-styled text (replacement for pterm.LightGreen())
Types ¶
type CLIUserError ¶
type CLIUserError struct {
Msg string
}
CLI User error for custom CLI errors
func (*CLIUserError) Error ¶
func (u *CLIUserError) Error() string
type ConfirmDialogModel ¶
type ConfirmDialogModel struct {
// contains filtered or unexported fields
}
ConfirmDialogModel represents an interactive confirmation dialog
func NewConfirmDialog ¶
func NewConfirmDialog(message string) ConfirmDialogModel
NewConfirmDialog creates a new confirmation dialog
func (ConfirmDialogModel) Init ¶
func (m ConfirmDialogModel) Init() tea.Cmd
Init initializes the confirmation dialog
func (ConfirmDialogModel) Result ¶
func (m ConfirmDialogModel) Result() (bool, bool)
Result returns whether the dialog was confirmed
func (ConfirmDialogModel) View ¶
func (m ConfirmDialogModel) View() string
View renders the confirmation dialog
type ConfirmModel ¶
type ConfirmModel struct {
// contains filtered or unexported fields
}
ConfirmModel represents a yes/no confirmation dialog
func NewConfirmModel ¶
func NewConfirmModel(prompt string) ConfirmModel
NewConfirmModel creates a new confirmation model
func (ConfirmModel) Init ¶
func (m ConfirmModel) Init() tea.Cmd
Init initializes the confirmation model
func (ConfirmModel) Result ¶
func (m ConfirmModel) Result() bool
Result returns the confirmation result
func (ConfirmModel) Selected ¶
func (m ConfirmModel) Selected() bool
Selected returns whether a choice was made
type FinalRenderMsg ¶
type FinalRenderMsg struct{}
FinalRenderMsg is used to trigger a final render before quitting
type InstallOption ¶
type MultiSpinnerModel ¶
type MultiSpinnerModel struct {
// contains filtered or unexported fields
}
MultiSpinnerModel manages multiple concurrent spinners
func NewMultiSpinner ¶
func NewMultiSpinner() MultiSpinnerModel
NewMultiSpinner creates a new multi-spinner model
func (*MultiSpinnerModel) AddSpinner ¶
func (m *MultiSpinnerModel) AddSpinner(id, message string)
AddSpinner adds a new spinner to the collection
func (MultiSpinnerModel) AllCompleted ¶
func (m MultiSpinnerModel) AllCompleted() bool
AllCompleted checks if all spinners are completed
func (MultiSpinnerModel) HasErrors ¶
func (m MultiSpinnerModel) HasErrors() bool
HasErrors checks if any spinners completed with errors
func (MultiSpinnerModel) Init ¶
func (m MultiSpinnerModel) Init() tea.Cmd
Init initializes all spinners
type MultiSpinnerView ¶
type MultiSpinnerView struct {
// contains filtered or unexported fields
}
MultiSpinnerView provides a high-level interface for managing multiple spinners
func NewMultiSpinnerView ¶
func NewMultiSpinnerView() *MultiSpinnerView
NewMultiSpinnerView creates a new multi-spinner view
func (*MultiSpinnerView) AddSpinner ¶
func (v *MultiSpinnerView) AddSpinner(id, message string)
AddSpinner adds a new spinner
func (*MultiSpinnerView) AllCompleted ¶
func (v *MultiSpinnerView) AllCompleted() bool
AllCompleted checks if all spinners are completed
func (*MultiSpinnerView) CompleteSpinner ¶
func (v *MultiSpinnerView) CompleteSpinner(id string, success bool, finalMsg string)
CompleteSpinner marks a spinner as completed
func (*MultiSpinnerView) HasErrors ¶
func (v *MultiSpinnerView) HasErrors() bool
HasErrors checks if any spinners completed with errors
func (*MultiSpinnerView) Start ¶
func (v *MultiSpinnerView) Start()
Start begins the multi-spinner display
func (*MultiSpinnerView) Stop ¶
func (v *MultiSpinnerView) Stop()
Stop stops the multi-spinner display
func (*MultiSpinnerView) UpdateSpinner ¶
func (v *MultiSpinnerView) UpdateSpinner(id, message string)
UpdateSpinner updates a spinner's message
func (*MultiSpinnerView) Wait ¶
func (v *MultiSpinnerView) Wait()
Wait waits for all spinners to complete
type OnboardingModel ¶
type OnboardingModel struct {
// contains filtered or unexported fields
}
OnboardingModel represents the onboarding flow
func NewOnboardingModel ¶
func NewOnboardingModel(userJourney string) OnboardingModel
NewOnboardingModel creates a new onboarding model
func (OnboardingModel) Init ¶
func (m OnboardingModel) Init() tea.Cmd
Init initializes the onboarding model
func (OnboardingModel) View ¶
func (m OnboardingModel) View() string
View renders the onboarding interface
type OnboardingStep ¶
OnboardingStep represents a single step in the onboarding flow
type RenderCompleteMsg ¶
type RenderCompleteMsg struct{}
RenderCompleteMsg is used to tell bubbletea that the final render is complete TODO(ja): lol wtf
type SelectorItem ¶
type SelectorItem struct {
// contains filtered or unexported fields
}
SelectorItem represents an item in the selector list
func (SelectorItem) Description ¶
func (i SelectorItem) Description() string
func (SelectorItem) FilterValue ¶
func (i SelectorItem) FilterValue() string
Implement list.Item interface
func (SelectorItem) IsEvaluation ¶
func (i SelectorItem) IsEvaluation() bool
func (SelectorItem) Title ¶
func (i SelectorItem) Title() string
func (SelectorItem) Value ¶
func (i SelectorItem) Value() string
type SelectorModel ¶
type SelectorModel struct {
// contains filtered or unexported fields
}
SelectorModel represents the list selection component
func NewSelectorModel ¶
func NewSelectorModel(title string, items []SelectorItem) SelectorModel
NewSelectorModel creates a new selector model
func NewSelectorModelWithMaxRows ¶
func NewSelectorModelWithMaxRows(title string, items []SelectorItem, maxVisibleRows int) SelectorModel
NewSelectorModelWithMaxRows creates a new selector model with a specific max visible rows
func (SelectorModel) Choice ¶
func (m SelectorModel) Choice() string
Choice returns the selected choice value
func (SelectorModel) Init ¶
func (m SelectorModel) Init() tea.Cmd
Init initializes the selector model
func (SelectorModel) Selected ¶
func (m SelectorModel) Selected() bool
Selected returns whether a choice was made
type SpinnerCompleteMsg ¶
SpinnerCompleteMsg is used to mark spinners as completed
type SpinnerModel ¶
type SpinnerModel struct {
// contains filtered or unexported fields
}
SpinnerModel represents a spinner with status and message handling
func NewSpinnerModel ¶
func NewSpinnerModel(json bool) SpinnerModel
NewSpinnerModel creates a new spinner model
type SpinnerResult ¶
SpinnerResult represents the final state of a spinner operation
type SpinnerResultMsg ¶
type SpinnerResultMsg SpinnerResult
SpinnerResultMsg is used to set the final result
type SpinnerState ¶
type SpinnerState struct {
// contains filtered or unexported fields
}
SpinnerState represents the state of an individual spinner
type SpinnerUpdateMsg ¶
SpinnerUpdateMsg is used to update spinner messages
type SpinnerView ¶
type SpinnerView struct {
// contains filtered or unexported fields
}
SpinnerView provides a high-level interface similar to the original spinner_view
func NewSpinnerView ¶
func NewSpinnerView(json bool) *SpinnerView
NewSpinnerView creates a new spinner view
func (*SpinnerView) Fail ¶
func (v *SpinnerView) Fail(err error)
Fail completes the spinner with an error message
func (*SpinnerView) Start ¶
func (v *SpinnerView) Start(text string)
Start begins the spinner with the given message
func (*SpinnerView) Success ¶
func (v *SpinnerView) Success(text string)
Success completes the spinner with a success message
func (*SpinnerView) Update ¶
func (v *SpinnerView) Update(text string)
Update changes the spinner message
type StyledText ¶
type StyledText struct {
// contains filtered or unexported fields
}
StyledText provides consistent text styling throughout the application
func NewStyledText ¶
func NewStyledText() *StyledText
NewStyledText creates a new styled text instance
func (*StyledText) Error ¶
func (s *StyledText) Error(text string) string
Error renders text in error style (red, bold)
func (*StyledText) Highlight ¶
func (s *StyledText) Highlight(text string) string
Highlight renders text in highlight style (bright, bold)
func (*StyledText) Info ¶
func (s *StyledText) Info(text string) string
Info renders text in info style (primary color)
func (*StyledText) Print ¶
func (s *StyledText) Print(text string)
Print outputs plain text without styling
func (*StyledText) PrintError ¶
func (s *StyledText) PrintError(text string)
PrintError outputs error-styled text with newline
func (*StyledText) PrintHighlight ¶
func (s *StyledText) PrintHighlight(text string)
PrintHighlight outputs highlight-styled text with newline
func (*StyledText) PrintInfo ¶
func (s *StyledText) PrintInfo(text string)
PrintInfo outputs info-styled text with newline
func (*StyledText) PrintSubtle ¶
func (s *StyledText) PrintSubtle(text string)
PrintSubtle outputs subtle-styled text with newline
func (*StyledText) PrintSuccess ¶
func (s *StyledText) PrintSuccess(text string)
PrintSuccess outputs success-styled text with newline
func (*StyledText) PrintWarning ¶
func (s *StyledText) PrintWarning(text string)
PrintWarning outputs warning-styled text with newline
func (*StyledText) Println ¶
func (s *StyledText) Println(text string)
Println outputs plain text with newline
func (*StyledText) Subtle ¶
func (s *StyledText) Subtle(text string) string
Subtle renders text in subtle style (muted)
func (*StyledText) Success ¶
func (s *StyledText) Success(text string) string
Success renders text in success style (green, bold)
func (*StyledText) Warning ¶
func (s *StyledText) Warning(text string) string
Warning renders text in warning style (yellow, bold)
type TableModel ¶
type TableModel struct {
// contains filtered or unexported fields
}
TableModel represents a data table component
func NewInteractiveTableModel ¶
func NewInteractiveTableModel(data [][]string) TableModel
NewInteractiveTableModel creates a new interactive table model
func NewTableModel ¶
func NewTableModel(data [][]string) TableModel
NewTableModel creates a new table model
type TableView ¶
type TableView struct{}
TableView provides a high-level interface for rendering tables
func (*TableView) RenderInteractive ¶
RenderInteractive displays an interactive table that users can navigate
func (*TableView) RenderKeyValue ¶
RenderKeyValue renders key-value pairs in a table format