Internal

internal/adapters/cli/output

Package output formats human-readable command output for the CLI adapter.

import "github.com/nilstate/scafld/v2/internal/adapters/cli/output"

Package output formats human-readable command output for the CLI adapter.

Functions

func Build(out appbuild.Output) string

Source: internal/adapters/cli/output/output.go:153

Build formats build evidence and repair details when acceptance blocks.

func CodeName(exit int) string

Source: internal/adapters/cli/output/output.go:33

CodeName maps process exit codes to stable JSON error codes.

func ConfigGateError(err error) error

Source: internal/adapters/cli/output/output.go:79

ConfigGateError wraps config loading failures in the shared repair contract.

func EncodeEnvelope[T any](w io.Writer, env envelope.Envelope[T], exit int) int

Source: internal/adapters/cli/output/output.go:22

EncodeEnvelope writes env as one JSON line, surfacing an encode failure on the stream and refusing to report success (exit 0) over corrupt output.

func Gate(failure *gate.Failure) string

Source: internal/adapters/cli/output/output.go:114

Gate formats a deterministic gate failure for human CLI output.

func GateFailure(err error) *gate.Failure

Source: internal/adapters/cli/output/output.go:60

GateFailure extracts a deterministic gate payload from err when present.

func GateFailureFromResult(result any) *gate.Failure

Source: internal/adapters/cli/output/output.go:70

GateFailureFromResult extracts repair payloads from non-zero successful use-case outputs.

func Report(out appreport.Output) string

Source: internal/adapters/cli/output/output.go:323

Report formats workspace reporting metrics.

func Review(out appreview.Output) string

Source: internal/adapters/cli/output/output.go:168

Review formats the review gate result so findings are visible in the normal path.

func ReviewProviderGateError(err error) error

Source: internal/adapters/cli/output/output.go:97

ReviewProviderGateError wraps provider-selection failures in the shared review gate repair contract.

func Status(out appstatus.Output) string

Source: internal/adapters/cli/output/output.go:228

Status formats status output with the latest review findings when present.

func StatusCommandExit(command string, err error, generic int, validation int) int

Source: internal/adapters/cli/output/output.go:52

StatusCommandExit maps complete/fail/cancel wrapper errors onto the public exit-code table without making the top-level CLI adapter interpret gate data.