tui

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(result *Result) error

Execute handles the action from the TUI result.

func FormatPrompt

func FormatPrompt(prompt string) string

FormatPrompt renders the full LLM prompt for --explain output.

func PrintContext

func PrintContext(snap plsctx.Snapshot, projectHistory, globalHistory []history.Entry) string

PrintContext renders the LLM context (detected environment, project history, global history) to stderr so that --verbose output doesn't interfere with --json on stdout.

func PrintToolLog

func PrintToolLog(rounds []llm.ToolRound) string

PrintToolLog renders the tool-use rounds from the LLM generation loop.

Types

type Action

type Action int

Action represents the user's chosen action from the TUI.

const (
	ActionNone Action = iota
	ActionRun
	ActionCopy
	ActionQuit
)

type Model

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

Model is the bubbletea model for the interactive TUI.

func New

func New(candidates []llm.Candidate) Model

New creates a new TUI Model from a list of candidates.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

type Result

type Result struct {
	Action    Action
	Candidate llm.Candidate
}

Result holds the chosen action and the selected candidate.

func RunTUI

func RunTUI(candidates []llm.Candidate) (*Result, error)

RunTUI creates a bubbletea program, runs it, and returns the result.

Jump to

Keyboard shortcuts

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