MCPcopy Create free account
hub / github.com/github/gh-aw / promptForWorkflowName

Method promptForWorkflowName

pkg/cli/interactive.go:107–124  ·  view source on GitHub ↗

promptForWorkflowName asks the user for a workflow name

()

Source from the content-addressed store, hash-verified

105
106// promptForWorkflowName asks the user for a workflow name
107func (b *InteractiveWorkflowBuilder) promptForWorkflowName() error {
108 if !tty.IsStderrTerminal() {
109 return b.promptForWorkflowNameFrom(os.Stdin)
110 }
111
112 form := huh.NewForm(
113 huh.NewGroup(
114 huh.NewInput().
115 Title("What should we call this workflow?").
116 Description("Enter a descriptive name for your workflow (e.g., 'issue-triage', 'code-review-helper')").
117 Suggestions(commonWorkflowNames).
118 Value(&b.WorkflowName).
119 Validate(ValidateWorkflowName),
120 ),
121 ).WithTheme(styles.HuhTheme).WithAccessible(console.IsAccessibleMode())
122
123 return form.RunWithContext(b.ctx)
124}
125
126// promptForWorkflowNameFrom is the non-TTY fallback for promptForWorkflowName.
127// It reads the workflow name from r as plain text. Separated from promptForWorkflowName

Callers 1

Calls 4

IsStderrTerminalFunction · 0.92
IsAccessibleModeFunction · 0.92
ValidateMethod · 0.45

Tested by

no test coverage detected