tui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package tui provides interactive terminal UI components for spec.

Index

Constants

This section is empty.

Variables

View Source
var CommonGateTypes = []GateType{
	{Name: "Section has content", Description: "Require a section to be non-empty", Value: "section_not_empty"},
	{Name: "PR stack exists", Description: "Require PR stack plan in §7.3", Value: "pr_stack_exists"},
	{Name: "PRs approved", Description: "All PRs must be approved", Value: "prs_approved"},
	{Name: "Decisions resolved", Description: "All decisions must be resolved", Value: "decisions_resolved"},
	{Name: "Custom expression", Description: "Write a custom expression", Value: "expr"},
	{Name: "No gate", Description: "Skip adding a gate", Value: "none"},
}

CommonGateTypes are the built-in gate types.

View Source
var CommonRoles = []string{"anyone", "author", "pm", "tl", "designer", "engineer", "qa", "security"}

Common roles

View Source
var StageIcons = []string{"📥", "📝", "👀", "🎨", "🔧", "🏗️", "👁️", "✅", "🚀", "📊", "🎉", "📦", "🔒", "💬", "📋", "○"}

Common icons for stages

Functions

func ConfirmPreset

func ConfirmPreset(preset PresetOption) (bool, error)

ConfirmPreset shows a preset preview and asks for confirmation.

func IsInteractive

func IsInteractive() bool

IsInteractive returns true if stdin is a terminal.

func PrintError

func PrintError(message string)

PrintError prints an error message.

func PrintSuccess

func PrintSuccess(message string)

PrintSuccess prints a success message.

func PrintTitle

func PrintTitle(title string)

PrintTitle prints a title.

func PromptAddAnotherGate

func PromptAddAnotherGate() (bool, error)

PromptAddAnotherGate asks if the user wants to add another gate.

func PromptConfirm

func PromptConfirm(title string) (bool, error)

PromptConfirm asks for yes/no confirmation.

func PromptExpression

func PromptExpression() (string, string, error)

PromptExpression prompts for a custom expression.

func PromptGateType

func PromptGateType() (string, error)

PromptGateType prompts the user to select a gate type.

func PromptMultiSelectStages

func PromptMultiSelectStages(stages []string, title, description string) ([]string, error)

PromptMultiSelectStages prompts to select multiple stages.

func PromptSectionSlug

func PromptSectionSlug() (string, error)

PromptSectionSlug prompts for a section slug.

func PromptSelectStage

func PromptSelectStage(stages []string, title, description string) (string, error)

PromptSelectStage prompts to select a stage from a list.

func PromptStageIcon

func PromptStageIcon() (string, error)

PromptStageIcon prompts for a stage icon.

func PromptStageName

func PromptStageName(existing []string) (string, error)

PromptStageName prompts for a stage name.

func PromptStageOwner

func PromptStageOwner(defaultOwner string) (string, error)

PromptStageOwner prompts for a stage owner role.

func PromptStagePosition

func PromptStagePosition(stages []string) (afterStage string, err error)

PromptStagePosition prompts for where to insert a new stage.

func SelectPreset

func SelectPreset(presets []PresetOption) (string, error)

SelectPreset prompts the user to select a pipeline preset.

Types

type GateType

type GateType struct {
	Name        string
	Description string
	Value       string
}

GateType represents a type of gate.

type PresetOption

type PresetOption struct {
	Name        string
	Description string
	Stages      []string
	Features    []string
}

PresetOption represents a pipeline preset for selection.

type StageInput

type StageInput struct {
	Name     string
	Owner    string
	Icon     string
	Position string // "after:<stage>" or "before:<stage>"
}

StageInput holds input for creating a new stage.

Jump to

Keyboard shortcuts

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