Help us shape the future of Go! Take the 2026 Go Developer Survey

tui

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTTY

func IsTTY() bool

func NewProgram

func NewProgram(
	progressCh <-chan types.ProgressUpdate,
	workerCh <-chan WorkerUpdate,
	providerName string,
	providerOK bool,
	numWorkers int,
	queryFn func(string) string,
) *tea.Program

NewProgram builds a Bubbletea program. Returns nil when stdout is not a TTY. workerCh may be nil for single-goroutine mode. queryFn handles query commands after extraction completes.

func RenderFileSummary

func RenderFileSummary(total, code, docs, other int) string

RenderFileSummary renders a summary of files discovered

func RenderProgress

func RenderProgress(p types.ExtractionProgress, width int) string

RenderProgress renders a progress bar with extraction stats This is a pure rendering function - state lives in the Bubbletea model

func RenderProviderStatus

func RenderProviderStatus(provider string, isHealthy bool) string

RenderProviderStatus renders the current LLM provider info

func RunPlainProgress

func RunPlainProgress(ch <-chan types.ProgressUpdate)

RunPlainProgress reads from ch and prints progress lines to stdout. Used when stdout is not a TTY.

Types

type ConfigViewModel

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

ConfigViewModel is the TUI model for config viewing/editing.

func NewConfigViewModel

func NewConfigViewModel() ConfigViewModel

func (ConfigViewModel) Init

func (m ConfigViewModel) Init() tea.Cmd

func (ConfigViewModel) Quitting

func (m ConfigViewModel) Quitting() bool

func (ConfigViewModel) Update

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

func (ConfigViewModel) View

func (m ConfigViewModel) View() string

func (ConfigViewModel) ViewContent

func (m ConfigViewModel) ViewContent() string

type DoctorModel

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

DoctorModel is the TUI model for health check.

func NewDoctorModel

func NewDoctorModel() DoctorModel

func (DoctorModel) Init

func (m DoctorModel) Init() tea.Cmd

func (DoctorModel) Quitting

func (m DoctorModel) Quitting() bool

func (DoctorModel) Update

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

func (DoctorModel) View

func (m DoctorModel) View() string

func (DoctorModel) ViewContent

func (m DoctorModel) ViewContent() string

type ExtractModel

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

ExtractModel is the TUI model for extraction configuration.

func NewExtractModel

func NewExtractModel() ExtractModel

func (ExtractModel) Directory

func (m ExtractModel) Directory() string

func (ExtractModel) FooterHelp

func (m ExtractModel) FooterHelp() string

FooterHelp returns context-appropriate footer text for the current step.

func (ExtractModel) Init

func (m ExtractModel) Init() tea.Cmd

func (ExtractModel) Mode

func (m ExtractModel) Mode() ExtractionMode

func (ExtractModel) Quitting

func (m ExtractModel) Quitting() bool

func (ExtractModel) Source

func (m ExtractModel) Source() ExtractSource

func (ExtractModel) Starting

func (m ExtractModel) Starting() bool

func (ExtractModel) Update

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

func (ExtractModel) View

func (m ExtractModel) View() string

func (ExtractModel) ViewContent

func (m ExtractModel) ViewContent() string

type ExtractSource

type ExtractSource int

ExtractSource selects where to read data from.

const (
	SourcePath   ExtractSource = iota // browse filesystem
	SourceAncora                      // ancora SQLite snapshot
)

type ExtractionMode

type ExtractionMode int

ExtractionMode controls whether the cache is honoured.

const (
	ModeUpdate     ExtractionMode = iota // incremental — respect cache
	ModeRegenerate                       // full — ignore cache
)

type GraphStatusModel

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

func NewGraphStatusModel

func NewGraphStatusModel() GraphStatusModel

func (GraphStatusModel) FooterHelp

func (m GraphStatusModel) FooterHelp() string

func (GraphStatusModel) Init

func (m GraphStatusModel) Init() tea.Cmd

func (GraphStatusModel) Quitting

func (m GraphStatusModel) Quitting() bool

func (GraphStatusModel) Update

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

func (GraphStatusModel) View

func (m GraphStatusModel) View() string

func (GraphStatusModel) ViewContent

func (m GraphStatusModel) ViewContent() string
type MenuModel struct {
	// contains filtered or unexported fields
}

func NewMenuModel

func NewMenuModel() MenuModel

NewMenuModel creates the main menu TUI.

func NewMenuModelWithVersion

func NewMenuModelWithVersion(ver string) MenuModel

NewMenuModelWithVersion creates the main menu TUI with version info.

func (m MenuModel) Init() tea.Cmd
func (m MenuModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
func (m MenuModel) View() string

type Model

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

Model is the top-level Bubbletea model.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type Pool

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

Pool manages N worker goroutines and sends status updates on a channel. Callers create a Pool, call Run(), and range over Updates() to display per-worker progress.

func NewPool

func NewPool(n int, jobs <-chan string, results chan<- workerResult) *Pool

NewPool creates a Pool with n workers reading from jobs.

func (*Pool) Run

func (p *Pool) Run(process func(file string) error)

Run launches n worker goroutines. Each goroutine reads from jobs, sends WorkerUpdates, and writes results. Run returns when all workers exit.

func (*Pool) Updates

func (p *Pool) Updates() <-chan WorkerUpdate

Updates returns the channel of WorkerUpdate messages.

type ProjectsModel added in v1.3.0

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

func NewProjectsModel added in v1.3.0

func NewProjectsModel() ProjectsModel

func (ProjectsModel) FooterHelp added in v1.3.0

func (m ProjectsModel) FooterHelp() string

func (ProjectsModel) Init added in v1.3.0

func (m ProjectsModel) Init() tea.Cmd

func (ProjectsModel) Quitting added in v1.3.0

func (m ProjectsModel) Quitting() bool

func (ProjectsModel) Update added in v1.3.0

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

func (ProjectsModel) View added in v1.3.0

func (m ProjectsModel) View() string

func (ProjectsModel) ViewContent added in v1.3.0

func (m ProjectsModel) ViewContent() string

type QueryModel

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

QueryModel is the TUI model for interactive federated search.

func NewQueryModel

func NewQueryModel() QueryModel

func (QueryModel) Init

func (m QueryModel) Init() tea.Cmd

func (QueryModel) ModeName

func (m QueryModel) ModeName() string

func (QueryModel) Quitting

func (m QueryModel) Quitting() bool

func (QueryModel) Update

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

func (QueryModel) View

func (m QueryModel) View() string

func (QueryModel) ViewContent

func (m QueryModel) ViewContent() string

type UninstallModel added in v1.3.0

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

func NewUninstallModel added in v1.3.0

func NewUninstallModel() UninstallModel

func (UninstallModel) FooterHelp added in v1.3.0

func (m UninstallModel) FooterHelp() string

func (UninstallModel) Init added in v1.3.0

func (m UninstallModel) Init() tea.Cmd

func (UninstallModel) Quitting added in v1.3.0

func (m UninstallModel) Quitting() bool

func (UninstallModel) Update added in v1.3.0

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

func (UninstallModel) View added in v1.3.0

func (m UninstallModel) View() string

func (UninstallModel) ViewContent added in v1.3.0

func (m UninstallModel) ViewContent() string

type WatchModel

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

WatchModel is the TUI model for the Watch screen.

func NewWatchModel

func NewWatchModel() WatchModel

NewWatchModel creates a WatchModel. The daemon is lazily loaded.

func (WatchModel) FooterHelp

func (m WatchModel) FooterHelp() string

func (WatchModel) Init

func (m WatchModel) Init() tea.Cmd

func (WatchModel) Quitting

func (m WatchModel) Quitting() bool

func (WatchModel) Update

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

func (WatchModel) View

func (m WatchModel) View() string

View renders the watch screen content only (menu wraps with header/footer).

func (WatchModel) ViewContent

func (m WatchModel) ViewContent() string

type WorkerStatus

type WorkerStatus struct {
	ID     int
	File   string // current file being processed (empty = idle)
	Idle   bool
	Done   bool
	ErrMsg string
}

WorkerStatus describes the current state of one extraction worker.

type WorkerUpdate

type WorkerUpdate struct {
	Status WorkerStatus
}

WorkerUpdate is sent on the worker channel when a worker changes state.

Jump to

Keyboard shortcuts

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