Documentation
¶
Overview ¶
Package wizard is otag's setup wizard (`otag init`, bare `otag` on a fresh machine, and the confirm step of `otag project add`): a short sequence of form pages built with the TUI's dialog kit (internal/tui/form) and theme. The model is pure: the detection results and the current choices come in through Options, and the only side effects (preview and apply) are functions there, so it is tested without a terminal or any file writes. Nothing is written before the Review page's Write.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the wizard's Bubble Tea model.
type Options ¶
type Options struct {
Mode Mode
Base setup.Base
Choices setup.Choices // the proposals (setup.Base.Defaults)
// Preview computes the Review page for the current choices (no writes).
Preview func(c setup.Choices) Preview
// Apply writes the files and runs sync, daemon and skill install as chosen.
Apply func(ctx context.Context, c setup.Choices) (Report, error)
// Offer the TUI at the end (Init mode).
OfferTUI bool
}
Options configure the wizard.
type Preview ¶
Preview is what the Review page shows: the files that would be written and the warnings the result would load with (Err: it would not load, Write is refused).