ui

package
v0.19.1221 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProgram added in v0.19.807

func NewProgram(model tea.Model, interactive bool, opts ...tea.ProgramOption) *tea.Program

NewProgram creates a tea.Program for the current environment. When interactive is false, input/rendering are disabled to avoid touching a TTY.

func Print added in v0.19.1075

func Print(a ...any)

Print mirrors fmt.Print but routes to the mode-aware writer.

func PrintDebug added in v0.19.800

func PrintDebug(msg string)

func PrintError

func PrintError(err error) error

PrintError renders an error in the active output mode: agent -> envelope, json -> JSON error object, table -> human-styled text.

func PrintJSON

func PrintJSON(data interface{})

func PrintJSONError

func PrintJSONError(err error) error

PrintJSONError renders an error in the active output mode. It is equivalent to PrintError: agent -> envelope, json -> JSON error object, table -> human text. Both entry points exist for historical call sites; prefer either.

func PrintLn

func PrintLn(msg string)

func PrintRaw

func PrintRaw(msg string)

func PrintSuccess

func PrintSuccess(msg string)

func PrintTOML

func PrintTOML(data interface{})

func PrintWarning

func PrintWarning(msg string)

func Printf added in v0.19.1075

func Printf(format string, a ...any)

Printf writes formatted human output to the mode-aware writer (stderr in agent mode, stdout otherwise), so it never pollutes the agent stdout envelope.

func Println added in v0.19.1075

func Println(a ...any)

Println mirrors fmt.Println but routes to the mode-aware writer.

func SetJSONOutput added in v0.19.1075

func SetJSONOutput(v bool)

SetJSONOutput toggles plain JSON output mode. Called once during output resolution. Agent mode is tracked separately via agentmode and takes precedence in every helper.

Types

type CLIUserError

type CLIUserError struct {
	Msg string
}

func (*CLIUserError) Error

func (u *CLIUserError) Error() string

type CreateView

type CreateView struct {
	SpinnerView
	// contains filtered or unexported fields
}

func NewCreateView

func NewCreateView(model string, json, interactive bool) *CreateView

func (*CreateView) Fail

func (v *CreateView) Fail(err error) error

func (*CreateView) Start

func (v *CreateView) Start()

func (*CreateView) Success

func (v *CreateView) Success(id string)

type DeleteView

type DeleteView struct {
	SpinnerView
	// contains filtered or unexported fields
}

func NewDeleteView

func NewDeleteView(model, id string, interactive bool) *DeleteView

func (*DeleteView) Fail

func (v *DeleteView) Fail(err error) error

func (*DeleteView) Start

func (v *DeleteView) Start()

func (*DeleteView) Success

func (v *DeleteView) Success()

func (*DeleteView) SuccessQueued

func (v *DeleteView) SuccessQueued()

type ErrExitCode added in v0.19.1049

type ErrExitCode struct {
	Err  error
	Code string
	Exit int
}

ErrExitCode wraps an error with a stable machine code for the agent envelope and a custom process exit code, honored by the command wrapper. It lets a command distinguish outcomes beyond the generic exit 1, e.g. "config synced but component builds failed".

func (*ErrExitCode) Error added in v0.19.1049

func (e *ErrExitCode) Error() string

func (*ErrExitCode) ExitCode added in v0.19.1049

func (e *ErrExitCode) ExitCode() int

func (*ErrExitCode) Unwrap added in v0.19.1049

func (e *ErrExitCode) Unwrap() error

type GetView

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

func NewGetView

func NewGetView() *GetView

func (*GetView) Error

func (v *GetView) Error(err error) error

func (*GetView) Print

func (v *GetView) Print(msg string)

func (*GetView) Render

func (v *GetView) Render(data [][]string)

type ListView

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

func NewListView

func NewListView() *ListView

func (*ListView) Error

func (v *ListView) Error(err error) error

func (*ListView) Print

func (v *ListView) Print(msg string)

func (*ListView) Render

func (v *ListView) Render(data [][]string)

func (*ListView) RenderPaging

func (v *ListView) RenderPaging(data [][]string, offset, limit int, hasMore bool)

func (*ListView) RenderPagingWithContext added in v0.19.1006

func (v *ListView) RenderPagingWithContext(data [][]string, offset, limit int, hasMore bool, contextLabel, contextValue string)

func (*ListView) RenderTotal added in v0.19.1006

func (v *ListView) RenderTotal(data [][]string, total int)

type SpinnerView

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

func NewSpinnerView

func NewSpinnerView(json, interactive bool) *SpinnerView

func (*SpinnerView) Fail

func (v *SpinnerView) Fail(err error)

func (*SpinnerView) Start

func (v *SpinnerView) Start(text string)

func (*SpinnerView) Success

func (v *SpinnerView) Success(text string)

func (*SpinnerView) Update

func (v *SpinnerView) Update(text string)

Directories

Path Synopsis
Package bubbles owns the CLI's small reusable terminal-UI primitives.
Package bubbles owns the CLI's small reusable terminal-UI primitives.
Package teaprogram is the single constructor every TUI should use, so terminal conventions like ctrl+z backgrounding apply everywhere instead of being reimplemented (or forgotten) per model.
Package teaprogram is the single constructor every TUI should use, so terminal conventions like ctrl+z backgrounding apply everywhere instead of being reimplemented (or forgotten) per model.
v3
action/run/steps
This run.go file contains a stub used to render the step component in a standalone way.
This run.go file contains a stub used to render the step component in a standalone way.
common
Package common provides utilities for v3 UI components.
Package common provides utilities for v3 UI components.

Jump to

Keyboard shortcuts

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