display

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accent

func Accent(s string) string

Accent renders text in the accent color (prompts, headings).

func Danger

func Danger(s string) string

Danger renders text in the danger/error color.

func ErrorMsg

func ErrorMsg(message string)

ErrorMsg prints a formatted error message.

func Info

func Info(s string) string

Info renders text in the info/highlight color.

func InitMarkdown

func InitMarkdown()

InitMarkdown sets up the terminal markdown renderer.

func InitTheme

func InitTheme(mode string)

InitTheme initializes the global theme. Mode can be "auto", "dark", or "light".

func KeyValue

func KeyValue(key, value string) string

KeyValue renders a key in accent and value in default text.

func Muted

func Muted(s string) string

Muted renders text in the muted/secondary color.

func Prompt

func Prompt(symbol string) string

Prompt renders a prompt symbol in accent color.

func RenderApprovalCard

func RenderApprovalCard(toolName, detail string, preview []string, risk string) string

RenderApprovalCard builds a bordered approval card for a tool call.

func RenderHeader

func RenderHeader(keyName, baseURL, cwd string) string

RenderHeader renders a metadata header bar with key, server, and cwd.

func RenderHints

func RenderHints(mode string) string

RenderHints renders a hint bar for the given mode.

func RenderMarkdown

func RenderMarkdown(md string) string

RenderMarkdown renders a markdown string to styled terminal output. Falls back to the raw string if rendering fails.

func ShowBanner

func ShowBanner(setting string, noMotion bool)

ShowBanner displays the animated startup banner. setting: "always", "once", "never" (empty defaults to "once").

func StreamDelta

func StreamDelta(delta api.Delta)

StreamDelta prints a streaming delta to the terminal (legacy convenience function).

func Success

func Success(s string) string

Success renders text in the success color.

func ToolRisk

func ToolRisk(toolName string) string

ToolRisk returns the risk level for a given tool name.

func UsePlainTheme

func UsePlainTheme()

UsePlainTheme swaps the active theme for the unstyled one regardless of terminal capabilities. Used when output goes to a log file instead of a terminal (host service mode).

func Warn

func Warn(s string) string

Warn renders text in the warning color.

Types

type StreamRenderer

type StreamRenderer struct {
	ShowReasoning bool
	// contains filtered or unexported fields
}

StreamRenderer accumulates streaming content and provides markdown rendering on finish.

func NewStreamRenderer

func NewStreamRenderer() *StreamRenderer

NewStreamRenderer creates a new StreamRenderer.

func (*StreamRenderer) Content

func (r *StreamRenderer) Content() string

Content returns the raw accumulated content.

func (*StreamRenderer) Delta

func (r *StreamRenderer) Delta(delta api.Delta)

Delta processes a streaming delta, printing content immediately. Reasoning is printed only if ShowReasoning is true.

func (*StreamRenderer) Finish

func (r *StreamRenderer) Finish() string

Finish returns the accumulated content rendered as markdown. Returns empty string if there was no content.

type Theme

type Theme struct {
	Text      lipgloss.Style
	Muted     lipgloss.Style
	Accent    lipgloss.Style
	Success   lipgloss.Style
	Warn      lipgloss.Style
	Danger    lipgloss.Style
	Info      lipgloss.Style
	Border    lipgloss.Style
	Selection lipgloss.Style
	Reasoning lipgloss.Style
}

Theme holds semantic styles for all UI elements.

var T *Theme

T is the active theme instance. Call InitTheme before using.

Jump to

Keyboard shortcuts

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