ui

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ui provides terminal UI components for the Skills CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStdinTTY

func IsStdinTTY() bool

IsStdinTTY returns true if stdin is a terminal.

func IsStdoutTTY

func IsStdoutTTY() bool

IsStdoutTTY returns true if stdout is a terminal.

func IsTTY

func IsTTY(w io.Writer) bool

IsTTY returns true if the given writer is a terminal.

func NoColor

func NoColor() bool

NoColor returns true if color output should be disabled. Respects the NO_COLOR environment variable standard.

Types

type Output

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

Output provides styled terminal output.

func NewOutput

func NewOutput(out, err io.Writer) *Output

NewOutput creates a new styled output instance.

func (*Output) Bold

func (o *Output) Bold(msg string)

Bold prints bold text.

func (*Output) BoldText

func (o *Output) BoldText(text string) string

BoldText returns bold-styled text.

func (*Output) Emphasis

func (o *Output) Emphasis(msg string)

Emphasis prints emphasized text (primary color).

func (*Output) EmphasisText

func (o *Output) EmphasisText(text string) string

EmphasisText returns emphasis-styled text.

func (*Output) Error

func (o *Output) Error(msg string)

Error prints an error message with X mark to stderr.

func (*Output) ErrorItem

func (o *Output) ErrorItem(item string)

ErrorItem prints an error list item to stderr.

func (*Output) ErrorText

func (o *Output) ErrorText(text string) string

ErrorText returns error-styled text.

func (*Output) Header

func (o *Output) Header(text string)

Header prints a bold header.

func (*Output) Info

func (o *Output) Info(msg string)

Info prints an info message with arrow.

func (*Output) IsSilent

func (o *Output) IsSilent() bool

IsSilent returns whether silent mode is enabled.

func (*Output) KeyValue

func (o *Output) KeyValue(key, value string)

KeyValue prints a key-value pair.

func (*Output) List

func (o *Output) List(items []string)

List prints a bulleted list.

func (*Output) ListItem

func (o *Output) ListItem(prefix, item string)

ListItem prints a single list item with custom prefix.

func (*Output) Muted

func (o *Output) Muted(msg string)

Muted prints muted/dim text.

func (*Output) MutedText

func (o *Output) MutedText(text string) string

MutedText returns muted-styled text.

func (*Output) Newline

func (o *Output) Newline()

Newline prints an empty line.

func (*Output) Printf

func (o *Output) Printf(format string, args ...any)

Printf prints formatted output to stdout.

func (*Output) Println

func (o *Output) Println(args ...any)

Println prints a line to stdout.

func (*Output) PrintlnAlways

func (o *Output) PrintlnAlways(args ...any)

PrintlnAlways prints even in silent mode.

func (*Output) Section

func (o *Output) Section(title string)

Section prints a section header with underline.

func (*Output) SetSilent

func (o *Output) SetSilent(silent bool)

SetSilent enables or disables silent mode (suppresses stdout).

func (*Output) StyledText

func (o *Output) StyledText(style func(theme.Styles) fmt.Stringer, text string) string

StyledText returns styled text without printing.

func (*Output) SubHeader

func (o *Output) SubHeader(text string)

SubHeader prints a styled sub-header.

func (*Output) Success

func (o *Output) Success(msg string)

Success prints a success message with checkmark.

func (*Output) SuccessItem

func (o *Output) SuccessItem(item string)

SuccessItem prints a success list item.

func (*Output) SuccessText

func (o *Output) SuccessText(text string) string

SuccessText returns success-styled text.

func (*Output) Theme

func (o *Output) Theme() theme.Theme

Theme returns the current theme.

func (*Output) Warning

func (o *Output) Warning(msg string)

Warning prints a warning message to stderr.

func (*Output) Width added in v0.12.0

func (o *Output) Width() int

Width returns the terminal width.

func (*Output) Wrap added in v0.12.0

func (o *Output) Wrap(text string) string

Wrap wraps text to fit the terminal width.

Directories

Path Synopsis
Package components provides interactive UI components for the Skills CLI.
Package components provides interactive UI components for the Skills CLI.
Package theme provides theming support for the Skills CLI UI.
Package theme provides theming support for the Skills CLI UI.

Jump to

Keyboard shortcuts

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