MCPcopy Create free account
hub / github.com/compozy/agh / updateProviderStep

Method updateProviderStep

internal/cli/install.go:423–446  ·  view source on GitHub ↗
(msg tea.KeyMsg)

Source from the content-addressed store, hash-verified

421}
422
423func (m *installWizardModel) updateProviderStep(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
424 switch msg.String() {
425 case "up", "k":
426 if m.selected > 0 {
427 m.selected--
428 }
429 case "down", "j":
430 if m.selected < len(m.input.Providers)-1 {
431 m.selected++
432 }
433 case installWizardEnterKey:
434 if len(m.input.Providers) == 0 {
435 m.errText = "no providers available"
436 return m, nil
437 }
438 m.provider = m.input.Providers[m.selected]
439 m.modelInput.SetValue(m.input.SuggestedModels[m.provider])
440 m.modelInput.Focus()
441 m.errText = ""
442 m.step = installWizardStepModel
443 return m, textinput.Blink
444 }
445 return m, nil
446}
447
448func (m *installWizardModel) updateModelStep(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
449 switch msg.String() {

Callers 1

UpdateMethod · 0.95

Calls 2

SetValueMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected