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

Method View

internal/cli/install.go:380–421  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

378}
379
380func (m *installWizardModel) View() string {
381 var builder strings.Builder
382
383 builder.WriteString("AGH Install\n")
384 builder.WriteString("===========\n\n")
385
386 switch m.step {
387 case installWizardStepProvider:
388 builder.WriteString("Select the default provider for the bootstrap `general` agent.\n\n")
389 for i, provider := range m.input.Providers {
390 cursor := " "
391 if i == m.selected {
392 cursor = "> "
393 }
394 builder.WriteString(cursor + provider + "\n")
395 }
396 builder.WriteString("\nUse up/down or j/k, press Enter to continue, Ctrl+C to cancel.\n")
397 case installWizardStepModel:
398 builder.WriteString("Selected provider: " + m.provider + "\n")
399 if m.modelRequired() {
400 builder.WriteString("Enter the default model for this provider.\n\n")
401 } else {
402 builder.WriteString("Enter a default model, or leave blank for the provider-managed default.\n\n")
403 }
404 builder.WriteString(m.modelInput.View() + "\n")
405 builder.WriteString("\nPress Enter to continue, Esc to go back, Ctrl+C to cancel.\n")
406 case installWizardStepConfirm:
407 builder.WriteString("Review the bootstrap configuration.\n\n")
408 builder.WriteString("Agent: " + aghconfig.DefaultAgentName + "\n")
409 builder.WriteString("Provider: " + m.provider + "\n")
410 builder.WriteString("Model: " + stringOrDash(strings.TrimSpace(m.modelInput.Value())) + "\n")
411 builder.WriteString("Permissions: " + string(aghconfig.PermissionModeApproveAll) + "\n")
412 builder.WriteString("\nPress Enter to write ~/.agh/config.toml and ensure ~/.agh/agents/general/AGENT.md.\n")
413 builder.WriteString("Press Esc to edit the model, or Ctrl+C to cancel.\n")
414 }
415
416 if strings.TrimSpace(m.errText) != "" {
417 builder.WriteString("\nError: " + m.errText + "\n")
418 }
419
420 return builder.String()
421}
422
423func (m *installWizardModel) updateProviderStep(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
424 switch msg.String() {

Callers 1

Calls 3

modelRequiredMethod · 0.95
stringOrDashFunction · 0.85
StringMethod · 0.45

Tested by 1