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
- func DefaultApp() process.AppConfig
- func DeriveName(script string) string
- func Namespaces() []string
- func RunInstall(ctx WizardContext, app process.AppConfig, opts WriteOptions) error
- func RunInteractive(ctx WizardContext, opts WriteOptions) error
- func WriteEcosystemFile(ctx WizardContext, apps []process.AppConfig, opts WriteOptions) error
- type WizardContext
- type WriteOptions
Constants ¶
const ( FormatJS = "js" FormatJSON = "json" )
const (
// DefaultVersion is the placeholder assigned to generated AppConfigs.
DefaultVersion = "-"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultApp ¶
DefaultApp returns one AppConfig populated with interactive defaults.
func DeriveName ¶
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 ¶
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 ¶
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.