ui

package
v0.1.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ui centralizes CLI output: lipgloss styles, success/error lines in the Vercel-style format, tables, and a --json mode that suppresses all decoration. Every command routes its output through this package so `--json` is uniform (spec §5 polish requirements).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Printer

type Printer struct {
	Out  io.Writer
	Err  io.Writer
	JSON bool
}

Printer renders command output. JSON=true switches every helper to machine-readable output and silences decorations.

func (*Printer) EmitJSON

func (p *Printer) EmitJSON(v any) error

EmitJSON marshals v to stdout (the single stdout artifact in JSON mode).

func (*Printer) Errorf

func (p *Printer) Errorf(format string, args ...any)

Errorf prints a "✗" line to stderr (also in JSON mode, still on stderr).

func (*Printer) Infof

func (p *Printer) Infof(format string, args ...any)

Infof prints a dim informational line (stderr; never pollutes stdout).

func (*Printer) Successf

func (p *Printer) Successf(format string, args ...any)

Successf prints a "✓" line (no-op in JSON mode — emit a JSON object instead).

func (*Printer) Table

func (p *Printer) Table(headers []string, rows [][]string)

Table renders a simple aligned table with a bold header.

func (*Printer) URL

func (p *Printer) URL(u string)

URL prints the final deploy URL line ("● https://...").

Jump to

Keyboard shortcuts

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