ui

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Green  = "\033[0;32m"
	Yellow = "\033[0;33m"
	Red    = "\033[0;31m"
	Blue   = "\033[0;34m"
	White  = "\033[0;37m"
	Gray   = "\033[0;90m"
	Bold   = "\033[1m"
	Reset  = "\033[0m"
)

Variables

View Source
var ErrUserCancelled = errors.New("user cancelled input")

ErrUserCancelled is returned when the user cancels input (Ctrl+C or Ctrl+D)

Functions

func ClearScreen added in v1.8.0

func ClearScreen()

ClearScreen clears the terminal screen using the appropriate command for the platform.

func Confirm added in v1.5.0

func Confirm(prompt string) (bool, error)

Confirm prompts the user for a yes/no confirmation. Returns true if the user answers yes/y (case-insensitive), false otherwise.

func PrintBanner

func PrintBanner(version, provider string)

func PrintDefault added in v0.3.0

func PrintDefault(msg string)

PrintDefault prints provider name with "(default)" indicator in gray

func PrintError

func PrintError(msg string)

func PrintGray added in v0.5.1

func PrintGray(msg string)

PrintGray prints a message in gray

func PrintHeader

func PrintHeader(msg string)

func PrintInfo

func PrintInfo(msg string)

func PrintProviderOption

func PrintProviderOption(number int, name string, cfg *config.Config, secrets map[string]string, provider string)

func PrintSection

func PrintSection(msg string)

func PrintSuccess

func PrintSuccess(msg string)

func PrintWarn

func PrintWarn(msg string)

func PrintWhite added in v0.3.0

func PrintWhite(msg string)

PrintWhite prints a message in white (no color)

func Prompt

func Prompt(prompt string) (string, error)

Prompt prompts the user for input and returns the input string. Returns empty string and ErrUserCancelled if input cannot be read.

func PromptSecret

func PromptSecret(prompt string) (string, error)

func PromptWithDefault

func PromptWithDefault(prompt, defaultVal string) (string, error)

PromptWithDefault prompts the user for input with a default value. Returns the default value and ErrUserCancelled if input cannot be read.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL