present

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Overview

Package present contains terminal rendering helpers and shared styles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInputTTY

func IsInputTTY() bool

IsInputTTY reports whether stdin is a TTY.

func IsOutputTTY

func IsOutputTTY() bool

IsOutputTTY reports whether stdout is a TTY.

func MakeGradientRamp

func MakeGradientRamp(length int) []lipgloss.Color

MakeGradientRamp returns a color ramp of the given length.

func MakeGradientText

func MakeGradientText(baseStyle lipgloss.Style, str string) string

MakeGradientText renders str with a gradient applied rune-by-rune.

func PrintConfirmation

func PrintConfirmation(action, content string)

PrintConfirmation prints a short action header plus content.

func RenderMarkdownForTTY

func RenderMarkdownForTTY(input string, wordWrap int) (string, error)

RenderMarkdownForTTY renders markdown for terminal output.

It mirrors the TUI's markdown rendering behavior closely enough for headless commands (e.g. --show / history show) without requiring Bubble Tea.

func Reverse

func Reverse[T any](in []T) []T

Reverse returns a copy of in in reverse order.

func StderrRenderer

func StderrRenderer() *lipgloss.Renderer

StderrRenderer returns a lipgloss renderer bound to stderr.

func StdoutRenderer

func StdoutRenderer() *lipgloss.Renderer

StdoutRenderer returns a lipgloss renderer bound to stdout.

Types

type Styles

type Styles struct {
	AppName,
	CliArgs,
	Comment,
	CyclingChars,
	ErrorHeader,
	ErrorDetails,
	ErrPadding,
	Flag,
	FlagComma,
	FlagDesc,
	InlineCode,
	Link,
	Pipe,
	Quote,
	ConversationList,
	SHA1,
	Timeago lipgloss.Style
}

Styles groups reusable terminal styles for consistent CLI output.

func MakeStyles

func MakeStyles(r *lipgloss.Renderer) (s Styles)

MakeStyles builds styles bound to the given renderer.

func StderrStyles

func StderrStyles() Styles

StderrStyles returns shared styles bound to stderr.

func StdoutStyles

func StdoutStyles() Styles

StdoutStyles returns shared styles bound to stdout.

Jump to

Keyboard shortcuts

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