cliui

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package cliui renders human-oriented CLI output: bordered panels and columns on wide interactive terminals. Layout (boxes/columns) is independent of ANSI color: use --no-color or NO_COLOR to disable colors only; narrow or non-TTY stdout falls back to plain line-oriented output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCLIError

func FormatCLIError(msg string, ctx *cobra.Command) string

FormatCLIError formats errors with the same boxed sections as help. When ctx is the command that was running when the error occurred, Usage / Flags panels are appended so styling matches picoclaw -h.

func Init

func Init(disableAnsiColors bool)

Init configures lipgloss for this process. When disableAnsiColors is true (e.g. --no-color, NO_COLOR, or TERM=dumb), only color is turned off; Unicode borders still render when UseFancyLayout() is true.

func InnerStderrWidth

func InnerStderrWidth() int

InnerStderrWidth mirrors InnerWidth but for stderr.

func InnerWidth

func InnerWidth() int

InnerWidth is the target content width inside borders/margins.

func PrintOnboardComplete

func PrintOnboardComplete(logo string, encrypt bool, configPath string)

PrintOnboardComplete prints the post-onboard “ready” message and next steps.

func PrintStatus

func PrintStatus(r StatusReport)

PrintStatus renders picoclaw status (plain or fancy).

func PrintVersion

func PrintVersion(logo, versionLine string, build, goVer string)

PrintVersion prints version, optional build info, and Go toolchain line.

func RenderCommandHelp

func RenderCommandHelp(c *cobra.Command) string

RenderCommandHelp builds Ruff-style sectioned, two-column help when UseFancyLayout(); otherwise plain Cobra-style text.

func RenderCommandQuickRef

func RenderCommandQuickRef(c *cobra.Command, outerW int) string

RenderCommandQuickRef prints the same Usage / Flags / Global sections as help, for embedding after errors (stderr). outerW is typically InnerStderrWidth().

func StderrWidth

func StderrWidth() int

StderrWidth returns stderr terminal width or a sane default.

func StdoutWidth

func StdoutWidth() int

StdoutWidth returns the terminal width or a sane default if unknown.

func UseColumnLayout

func UseColumnLayout() bool

UseColumnLayout is true when a second content column is viable.

func UseFancyLayout

func UseFancyLayout() bool

UseFancyLayout is true when styled boxes/columns should be used.

func UseFancyStderr

func UseFancyStderr() bool

UseFancyStderr is true when stderr can show boxed errors without ugly wraps.

Types

type ProviderRow

type ProviderRow struct {
	Name string
	Val  string
}

ProviderRow holds one provider's display name and status value.

type StatusReport

type StatusReport struct {
	Version       string
	Build         string
	ConfigPath    string
	ConfigOK      bool
	WorkspacePath string
	WorkspaceOK   bool
	Model         string
	Providers     []ProviderRow
	OAuthLines    []string // each full line "provider (method): state"
}

StatusReport is a structured status view for PrintStatus.

Jump to

Keyboard shortcuts

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