Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Probe ¶
Probe makes a cheap, token-free connectivity check against the endpoint by listing models. It returns nil if the endpoint responds, or a descriptive error otherwise. A short timeout keeps the wizard responsive. The model argument is accepted for signature stability but not needed by ListModels.
func Run ¶
Run launches the interactive wizard. It returns the resulting config, whether it was saved, and any fatal error. Cancellation (Esc/Ctrl+C) returns saved=false with a nil error and the unchanged existing config.
func Save ¶
Save writes the LLM connection fields (model, api_key, base_url) into <configDir>/config.yaml, preserving any keys that already exist in the file. It returns the path written. The file uses mode 0600 because it holds a key.
cfg.BaseDir, when set, redirects the write into that root: onboarding inside an embedded nib must not put the embedder's model and api_key into the user's real ~/.config/nib.
Types ¶
type Preset ¶
type Preset struct {
Name string // display name shown in the picker
BaseURL string // prefilled, editable; "" means the OpenAI SDK default
DefaultModel string // prefilled model field
DefaultKey string // prefilled api_key
KeyRequired bool // informational hint only; never blocks saving
}
Preset is a provider template that prefills connection fields in the wizard.