tui

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Colors
	ColorSuccess = lipgloss.Color("2")
	ColorError   = lipgloss.Color("1")
	ColorWarn    = lipgloss.Color("3")
	ColorInfo    = lipgloss.Color("4")
	ColorMuted   = lipgloss.Color("8")
	ColorPrimary = lipgloss.Color("63") // Matches standard EnvCrypt color

	// Base Styles
	StyleSuccess = lipgloss.NewStyle().Foreground(ColorSuccess)
	StyleError   = lipgloss.NewStyle().Foreground(ColorError)
	StyleWarn    = lipgloss.NewStyle().Foreground(ColorWarn)
	StyleInfo    = lipgloss.NewStyle().Foreground(ColorInfo)
	StyleMuted   = lipgloss.NewStyle().Foreground(ColorMuted)
	StylePrimary = lipgloss.NewStyle().Foreground(ColorPrimary)

	// Icons
	IconCheck = StyleSuccess.Render("[✓]")
	IconCross = StyleError.Render("[x]")
	IconWarn  = StyleWarn.Render("[!]")
	IconInfo  = StyleInfo.Render(">")

	// Structural Styles
	HeaderStyle = lipgloss.NewStyle().Foreground(ColorMuted).Bold(true)

	BoxStyleWarn = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(ColorWarn).
					Padding(1).
					MarginTop(1)

	BoxStylePrimary = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(ColorPrimary).
					Padding(1).
					MarginTop(1)
)

Functions

func ConfirmDangerousAction

func ConfirmDangerousAction(prompt, expected string) bool

func ConfirmOverwrite

func ConfirmOverwrite(path string) bool

func Error

func Error(msg string, err error) error

func Info

func Info(msg string)

func IsInteractive added in v1.1.1

func IsInteractive() bool

func PadRight

func PadRight(s string, width int) string

func PrintEnvSummary

func PrintEnvSummary(env map[string]string)

func PrintServiceRoleDetail

func PrintServiceRoleDetail(role *config.ServiceRole)

func PrintServiceRolePermissions

func PrintServiceRolePermissions(perm *config.ServiceRolePermsResponse, repoPrincipal string)

func PrintServiceRoleSecret

func PrintServiceRoleSecret(keyPair *config.ServiceRoleKeyPair)

func PromptWithDefault

func PromptWithDefault(label, defaultVal string) string

func RenderDiff

func RenderDiff(diff cryptoutils.DiffingResult, oldMap, newMap map[string]string, showSecrets bool)

func RunActionWithSpinner

func RunActionWithSpinner(title string, action func() error) error

func RunEnvPicker

func RunEnvPicker(projectName string) (string, error)

func RunForm

func RunForm(fields []FormField, prefills []string) ([]string, error)

func RunPicker

func RunPicker(title string, items []string) (string, error)

func RunProjectsTable

func RunProjectsTable(projects []config.Project) error

func RunServiceRolesTable

func RunServiceRolesTable(roles []config.ServiceRole) error

func Spacer

func Spacer()

Replaces standard output functions

func StripANSI

func StripANSI(s string) string

func Success

func Success(msg string)

func Truncate

func Truncate(s string, max int) string

func VisibleLen

func VisibleLen(s string) int

func Warn

func Warn(msg string)

Types

type FormField

type FormField struct {
	Label    string
	Secret   bool
	Required bool
}

FormField defines a single input field in a form.

Jump to

Keyboard shortcuts

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