output

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package output formats and prints CLI output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionEvent

type ActionEvent struct {
	Action  string `json:"action"`
	Skill   string `json:"skill,omitempty"`
	Repo    string `json:"repo,omitempty"`
	From    string `json:"from,omitempty"`
	To      string `json:"to,omitempty"`
	DryRun  bool   `json:"dry_run,omitempty"`
	Message string `json:"message,omitempty"`
}

ActionEvent is a single structured event emitted by write commands when --json is set.

type DiagnosticEntry

type DiagnosticEntry struct {
	Severity string `json:"severity"`
	Code     string `json:"code,omitempty"`
	Message  string `json:"message"`
	Hint     string `json:"hint,omitempty"`
}

DiagnosticEntry is the generic representation of a doctor issue for output purposes.

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

Printer renders CLI output. When jsonMode is true all methods emit JSON instead.

func NewPrinter

func NewPrinter(jsonMode bool) *Printer

NewPrinter creates a Printer writing to stdout.

func NewPrinterTo

func NewPrinterTo(w io.Writer, jsonMode bool) *Printer

NewPrinterTo creates a Printer writing to the given writer (useful for tests).

func (*Printer) Error

func (p *Printer) Error(msg, hint string)

Error prints an error line with an optional hint.

func (*Printer) PrintAction

func (p *Printer) PrintAction(event ActionEvent)

PrintAction emits a single action event (plain text or JSON depending on mode).

func (*Printer) PrintDiagnostics

func (p *Printer) PrintDiagnostics(issues []DiagnosticEntry)

PrintDiagnostics renders the output for `skell doctor`.

func (*Printer) PrintInfoResult

func (p *Printer) PrintInfoResult(name string, r *model.InfoResult)

PrintInfoResult renders the output for `skell info`.

func (*Printer) PrintRegistrySkillList

func (p *Printer) PrintRegistrySkillList(skills []model.RegistrySkill)

PrintRegistrySkillList renders the output for `skell list --source registry` and `skell search`.

func (*Printer) PrintSkillList

func (p *Printer) PrintSkillList(skills []model.InstalledSkill)

PrintSkillList renders the output for `skell list` (installed skills).

func (*Printer) PrintStatusTable

func (p *Printer) PrintStatusTable(entries []model.StatusEntry)

PrintStatusTable renders the tabular output for `skell status`.

func (*Printer) Success

func (p *Printer) Success(msg string)

Success prints a success line.

Jump to

Keyboard shortcuts

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