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 ¶
- func FormatCLIError(msg string, ctx *cobra.Command) string
- func Init(disableAnsiColors bool)
- func InnerStderrWidth() int
- func InnerWidth() int
- func PrintOnboardComplete(logo string, encrypt bool, configPath string)
- func PrintStatus(r StatusReport)
- func PrintVersion(logo, versionLine string, build, goVer string)
- func RenderCommandHelp(c *cobra.Command) string
- func RenderCommandQuickRef(c *cobra.Command, outerW int) string
- func StderrWidth() int
- func StdoutWidth() int
- func UseColumnLayout() bool
- func UseFancyLayout() bool
- func UseFancyStderr() bool
- type ProviderRow
- type StatusReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatCLIError ¶
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 ¶
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 ¶
PrintVersion prints version, optional build info, and Go toolchain line.
func RenderCommandHelp ¶
RenderCommandHelp builds Ruff-style sectioned, two-column help when UseFancyLayout(); otherwise plain Cobra-style text.
func RenderCommandQuickRef ¶
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 ¶
ProviderRow holds one provider's display name and status value.
type StatusReport ¶
type StatusReport struct {
Logo string
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.