Documentation
¶
Index ¶
- Constants
- Variables
- func DrawBox(title string, width int)
- func Input(title, placeholder string) (string, error)
- func InputWithOptions(title, placeholder string, options []SelectOption) (string, error)
- func Mute(text string) string
- func PrintError(message string)
- func PrintInfo(message string)
- func PrintProgress(current, total int, message string)
- func PrintStep(icon, message string)
- func PrintSubStep(message string)
- func PrintSubStepEnd(message string)
- func PrintSuccess(message string)
- func PrintWarning(message string)
- func Select(title string, options []SelectOption) (string, error)
- type Console
- type Prompter
- type SelectOption
- type Silent
- type Spinner
- type Table
Constants ¶
View Source
const ( IconCheck = "✓" IconCross = "✗" IconArrow = "→" IconBolt = "⚡" IconPackage = "📦" IconRocket = "🚀" IconFolder = "📁" IconBranch = "🌿" IconSparkle = "✨" IconWarning = "⚠" IconInfo = "ℹ" IconTree = "├─" IconTreeEnd = "└─" )
Icons using Unicode characters
View Source
const ( BoxTopLeft = "┌" BoxTopRight = "┐" BoxBottomLeft = "└" BoxBottomRight = "┘" BoxHorizontal = "─" BoxVertical = "│" BoxCross = "┼" BoxTeeDown = "┬" BoxTeeUp = "┴" BoxTeeRight = "├" BoxTeeLeft = "┤" )
Box drawing characters
Variables ¶
View Source
var ( // Primary colors Success = color.New(color.FgGreen, color.Bold) Error = color.New(color.FgRed, color.Bold) Warning = color.New(color.FgYellow, color.Bold) Info = color.New(color.FgCyan) Muted = color.New(color.Faint) Bold = color.New(color.Bold) // Accent colors Primary = color.New(color.FgBlue, color.Bold) Accent = color.New(color.FgMagenta) )
Color scheme for the TUI
Functions ¶
func InputWithOptions ¶ added in v0.2.0
func InputWithOptions(title, placeholder string, options []SelectOption) (string, error)
InputWithOptions shows an interactive input with selectable options
func PrintError ¶ added in v0.2.0
func PrintError(message string)
func PrintProgress ¶ added in v0.2.0
Progress indicator helpers
func PrintSubStep ¶ added in v0.2.0
func PrintSubStep(message string)
func PrintSubStepEnd ¶ added in v0.2.0
func PrintSubStepEnd(message string)
func PrintWarning ¶ added in v0.2.0
func PrintWarning(message string)
Types ¶
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console implements Prompter for terminal interaction
type Prompter ¶
type Prompter interface {
Confirm(message string) bool
Input(prompt, defaultValue string) string
Print(message string)
Printf(format string, args ...interface{})
}
Prompter handles user interaction
type SelectOption ¶ added in v0.2.0
type Silent ¶
type Silent struct {
// contains filtered or unexported fields
}
Silent implements Prompter with auto-confirm (for -f flag or tests)
type Spinner ¶ added in v0.2.0
type Spinner struct {
// contains filtered or unexported fields
}
Spinner provides a simple loading animation
func NewSpinner ¶ added in v0.2.0
NewSpinner creates a spinner with dots animation
func (*Spinner) Stop ¶ added in v0.2.0
func (s *Spinner) Stop()
Stop stops the spinner and clears the line
Click to show internal directories.
Click to hide internal directories.