tui

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunSearch

func RunSearch(initialQuery string, searchFunc SearchFunc, addFunc AddFunc) error

RunSearch runs the search TUI and returns selected packages

Types

type AddFunc

type AddFunc func(pkg string) error

AddFunc is a function that adds a package

type AddResultMsg

type AddResultMsg struct {
	Package string
	Success bool
	Err     error
}

AddResultMsg contains add result

type AddRunnerModel

type AddRunnerModel struct {
	// contains filtered or unexported fields
}

func NewAddRunnerModel

func NewAddRunnerModel(existingNames []string) AddRunnerModel

func (AddRunnerModel) GetResult

func (m AddRunnerModel) GetResult() *AddRunnerResult

func (AddRunnerModel) Init

func (m AddRunnerModel) Init() tea.Cmd

func (AddRunnerModel) Update

func (m AddRunnerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (AddRunnerModel) View

func (m AddRunnerModel) View() string

type AddRunnerResult

type AddRunnerResult struct {
	Name    string
	Type    string
	Image   string
	SSHHost string
	SSHUser string
}

func RunAddRunnerTUI

func RunAddRunnerTUI(existingNames []string) (*AddRunnerResult, error)

type AddRunnerStep

type AddRunnerStep int
const (
	RunnerStepName AddRunnerStep = iota
	RunnerStepType
	RunnerStepDockerImage
	RunnerStepCheckingImage
	RunnerStepSSHHost
	RunnerStepSSHUser
	RunnerStepDone
)

type AddToolchainResult

type AddToolchainResult struct {
	Name               string
	Runner             string
	BuildType          string
	CC                 string
	CXX                string
	CMakeToolchainFile string
}

AddToolchainResult is the result of the TUI

func RunAddToolchainTUI

func RunAddToolchainTUI(existingNames []string, existingRunners []string) (*AddToolchainResult, error)

type CreationMsg

type CreationMsg struct{}

CreationMsg indicates project creation started

type CreationResultMsg

type CreationResultMsg struct {
	Success bool
	Message string
}

CreationResultMsg contains creation result

type DockerImage

type DockerImage struct {
	Repository   string
	Tag          string
	ID           string
	Size         string
	Created      string
	Architecture string
}

func (DockerImage) FullName

func (d DockerImage) FullName() string

type ImageCheckProgress

type ImageCheckProgress struct {
	Phase string // "pulling", "checking"
}

type ImageCheckResult

type ImageCheckResult struct {
	Success bool
	Error   string
}

type ImagesLoadedMsg

type ImagesLoadedMsg []DockerImage

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model represents the TUI state

func InitialModel

func InitialModel() Model

InitialModel creates the initial model

func (Model) GetConfig

func (m Model) GetConfig() ProjectConfig

GetConfig returns the final configuration

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model

func (Model) IsCancelled

func (m Model) IsCancelled() bool

IsCancelled returns true if the user canceled

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model

func (Model) View

func (m Model) View() string

View renders the UI

type ProjectConfig

type ProjectConfig struct {
	Name           string
	IsLibrary      bool
	CppStandard    int
	TestFramework  string
	Benchmark      string
	ClangFormat    string
	PackageManager string // "vcpkg", "meson", "bazel", or "none"
	VCS            string // "git" or "none"
	UseHooks       bool
	GitHooks       []string
	PreCommit      []string
	PrePush        []string
	// Template fields
	UseTemplate  bool   // True if using a template
	TemplateName string // Selected template name
}

ProjectConfig holds the user's choices

type Question

type Question struct {
	Question string
	Answer   string
	Complete bool
}

type SearchFunc

type SearchFunc func(query string) ([]SearchResult, error)

SearchFunc is a function that searches for packages

type SearchModel

type SearchModel struct {
	// contains filtered or unexported fields
}

SearchModel represents the search TUI state

func NewSearchModel

func NewSearchModel(initialQuery string, searchFunc SearchFunc, addFunc AddFunc) SearchModel

NewSearchModel creates a new search model

func (SearchModel) Init

func (m SearchModel) Init() tea.Cmd

Init initializes the model

func (SearchModel) Update

func (m SearchModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model

func (SearchModel) View

func (m SearchModel) View() string

View renders the UI

type SearchResult

type SearchResult struct {
	Name        string
	Version     string
	Description string
}

type SearchResultsMsg

type SearchResultsMsg struct {
	Results []SearchResult
	Err     error
}

SearchResultsMsg contains search results

type SearchState

type SearchState int

SearchState represents the current state of the search UI

const (
	SearchStateInput SearchState = iota
	SearchStateSearching
	SearchStateResults
	SearchStateAdding
	SearchStateDone
)

type Step

type Step int

Step represents the current step in the project creation flow

const (
	StepProjectName    Step = iota
	StepProjectMode         // Template or Custom?
	StepTemplateSelect      // Select template
	StepProjectType
	StepCppStandard
	StepTestFramework
	StepBenchmark
	StepClangFormat
	StepPackageManager
	StepGitHooks
	StepPreCommit
	StepPrePush
	StepCreating
	StepDone
)

type ToolchainModel

type ToolchainModel struct {
	// contains filtered or unexported fields
}

ToolchainModel represents the TUI state for adding a CI target

func NewToolchainModel

func NewToolchainModel(existingNames []string, existingRunners []string) ToolchainModel

NewToolchainModel creates a new model for adding a CI target

func (ToolchainModel) GetResult

func (m ToolchainModel) GetResult() *AddToolchainResult

func (ToolchainModel) Init

func (m ToolchainModel) Init() tea.Cmd

func (ToolchainModel) IsCancelled

func (m ToolchainModel) IsCancelled() bool

func (ToolchainModel) Update

func (m ToolchainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ToolchainModel) View

func (m ToolchainModel) View() string

type ToolchainStep

type ToolchainStep int

ToolchainStep represents the current step in the target creation flow

const (
	ToolchainStepName ToolchainStep = iota
	ToolchainStepRunner
	ToolchainStepCompilerCC
	ToolchainStepCompilerCXX
	ToolchainStepCMakeToolchain
	ToolchainStepBuildType
	ToolchainStepDone
)

Jump to

Keyboard shortcuts

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