wizard

package
v0.0.0-...-96c50a0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package wizard owns ecosystem configuration authoring: prompts, generated app configuration, merge policy, and JS/JSON rendering.

Cobra and terminal detection stay in package cmd (cmd/wizard.go). This package accepts all input and output through WizardContext.

Index

Constants

View Source
const (
	FormatJS   = "js"
	FormatJSON = "json"
)
View Source
const (

	// DefaultVersion is the placeholder assigned to generated AppConfigs.
	DefaultVersion = "-"
)

Variables

This section is empty.

Functions

func DefaultApp

func DefaultApp() process.AppConfig

DefaultApp returns one AppConfig populated with interactive defaults.

func DeriveName

func DeriveName(script string) string

DeriveName produces a process name from a script path.

func Namespaces

func Namespaces() []string

Namespaces returns the wizard's supported namespace choices in prompt order.

func RunInstall

func RunInstall(ctx WizardContext, app process.AppConfig, opts WriteOptions) error

RunInstall writes one pre-built app without interactive confirmation.

func RunInteractive

func RunInteractive(ctx WizardContext, opts WriteOptions) error

RunInteractive collects apps or accepts defaults, then writes the ecosystem file using the selected merge and format behavior.

func WriteEcosystemFile

func WriteEcosystemFile(ctx WizardContext, apps []process.AppConfig, opts WriteOptions) error

WriteEcosystemFile merges or replaces an ecosystem file, previews the result, confirms interactive writes, and persists the selected format.

Types

type WizardContext

type WizardContext struct {
	In     io.Reader
	Out    io.Writer
	ErrOut io.Writer
	YesAll bool
}

WizardContext carries the I/O streams the wizard reads from and writes to. Every exported entry point in this package takes one as the first argument so the caller controls where prompts and previews go — the package never touches os.Stdin / os.Stdout directly.

YesAll is exposed here rather than inside Options because it is a property of the input medium (e.g. piped non-interactive shell), not of any single command's flags.

type WriteOptions

type WriteOptions struct {
	Output  string
	Format  string
	Force   bool
	NoMerge bool
}

WriteOptions is the shared output contract for interactive, install, and direct ecosystem writes.

func DefaultWriteOptions

func DefaultWriteOptions() WriteOptions

DefaultWriteOptions returns the default JS write behavior.

Jump to

Keyboard shortcuts

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