forms

package
v0.138.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
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

func Choose(title, description string, options []string) (int, error)

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

func Confirm(title, description, affirmative, negative string, value bool) (bool, error)

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

func Run(cfg *config.Config, accessible bool, hints Hints) error

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

func UseDefaults(accessible bool) (bool, error)

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
}

Hints is what `agentlab configure` learned about this machine before the form runs, so the questions can say what the defaults are based on.

Jump to

Keyboard shortcuts

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