Documentation
¶
Overview ¶
Package forms is the interactive face of agentlab: charm.land/huh forms that ask for every configuration option and fill in a config.Config.
Index ¶
- Variables
- func Accessible() bool
- func Choose(title, description string, options []string) (int, error)
- func Confirm(title, description, affirmative, negative string, value bool) (bool, error)
- func Run(cfg *config.Config, accessible bool, hints Hints) error
- func UseDefaults(accessible bool) (bool, error)
- type Hints
Constants ¶
This section is empty.
Variables ¶
var ErrAborted = huh.ErrUserAborted
ErrAborted is huh's user abort (Ctrl-C, Esc), re-exported so callers need no huh import of their own.
Functions ¶
func Accessible ¶ added in v0.32.0
func Accessible() bool
Accessible reports huh's prompt-per-question mode (also what screen readers want): the ACCESSIBLE environment variable. `configure`'s --accessible flag ORs with it.
func Choose ¶ added in v0.61.0
Choose asks the person to pick one of options on the terminal and returns its index — the lab picker, when a command runs outside a lab directory and several labs are registered. Built through newForm, so this package's test hook drives it like every other form here.
func Confirm ¶ added in v0.32.0
Confirm asks one yes/no question on the terminal — the lab's questions outside `configure`: the trust offer before a browser opens, the two questions at the end of `up`. Built through newForm, so this package's test hook drives it like every other form here.
func Run ¶
Run walks the user through the lab configuration and mutates cfg in place. The passed cfg provides the defaults shown in the form (so re-configuring starts from the current answers, not from scratch); hints carry what the discovery on this machine found.
func UseDefaults ¶ added in v0.63.0
UseDefaults is the one question a first run asks — no agentlab.yaml yet, on a terminal: take the canonical lab the discovery just fitted to this machine (what `configure --defaults` writes), or customize every option in the form. The question names what "defaults" means, so the answer needs no docs. True is the defaults.
Types ¶
type Hints ¶ added in v0.15.0
type Hints struct {
// ModelServers names the host model servers found (versions and ports),
// or says that none answers — shown under the managed-models confirm.
ModelServers string
// TelemetryOptOut names the environment variable that turns usage data
// off for every lab, "" when none does — said on the Telemetry page.
TelemetryOptOut string
}
Hints is what `agentlab configure` learned about this machine before the form runs, so the questions can say what the defaults are based on.