Documentation
¶
Overview ¶
Package output centralizes harness-owned terminal writes: human-rich vs sparse (--ai-output), and whether stderr supports carriage-return progress (TTY).
Index ¶
- type Printer
- func (p *Printer) AIOutput() bool
- func (p *Printer) ClearInline()
- func (p *Printer) HumanStderr(a ...any)
- func (p *Printer) HumanStderrWriter() io.Writer
- func (p *Printer) LiveInlineProgress() bool
- func (p *Printer) SparseStdoutln(a ...any)
- func (p *Printer) Stderrf(format string, a ...any)
- func (p *Printer) Stdoutln(a ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer writes CLI messages for tools/test. Child processes (go test) still attach os.Stdout/os.Stderr directly where passthrough is intended.
func New ¶
New builds a production Printer. liveInline is enabled when stderrFD points at a real terminal and ai-output is off. Tests should use NewForTest.
func NewForTest ¶
NewForTest returns a Printer with explicit live-inline behavior. liveInline is ignored when aiOutput is true.
func NewFromApp ¶
NewFromApp uses os.Stdout/os.Stderr and stderr's TTY bit from conf.AIOutput.
func (*Printer) ClearInline ¶
func (p *Printer) ClearInline()
ClearInline clears the current stderr line when live inline progress is active.
func (*Printer) HumanStderr ¶
HumanStderr writes a line to stderr when in human mode.
func (*Printer) HumanStderrWriter ¶
HumanStderrWriter returns stderr in human mode, io.Discard in AI mode. Use this for helpers that need an io.Writer (e.g. lipgloss tables, hint lines).
func (*Printer) LiveInlineProgress ¶
LiveInlineProgress is true when human mode may use carriage-return redraws on stderr.
func (*Printer) SparseStdoutln ¶
SparseStdoutln prints one line to stdout in AI mode (machine-oriented).