Objective
Replace the manual prompt/scanln pattern in remove_command.go with the proper console.ConfirmAction() helper for consistency and better UX.
Context
From discussion #11611: The remove_command.go file uses a bare prompt (fmt.Print + fmt.Scanln) instead of the Huh-based console.ConfirmAction() wrapper.
Current Issue: remove_command.go:118 uses manual prompt handling instead of the standardized console helper.
Approach
-
Locate the prompt code around line 118 in pkg/cli/remove_command.go
-
Replace with console.ConfirmAction():
- Use existing console package function
- Provide clear question text
- Handle error case properly
-
Test the change:
- Verify interactive prompt works
- Test with and without TTY
- Ensure accessibility mode is respected
Files to Modify
- Update:
pkg/cli/remove_command.go (line ~118)
Implementation Example
// Before (remove_command.go:118):
fmt.Print("Are you sure you want to remove the workflow? (yes/no): ")
var response string
fmt.Scanln(&response)
if response != "yes" {
return fmt.Errorf("workflow removal cancelled")
}
// After:
confirmed, err := console.ConfirmAction(
"Remove workflow?",
"Yes, remove",
"No, cancel",
)
if err != nil {
return fmt.Errorf("failed to get confirmation: %w", err)
}
if !confirmed {
return fmt.Errorf("workflow removal cancelled")
}
Acceptance Criteria
Priority
Phase 1: Critical Fix (1-2 hours estimated)
AI generated by Plan Command for discussion #11611
Objective
Replace the manual prompt/scanln pattern in
remove_command.gowith the properconsole.ConfirmAction()helper for consistency and better UX.Context
From discussion #11611: The
remove_command.gofile uses a bare prompt (fmt.Print+fmt.Scanln) instead of the Huh-basedconsole.ConfirmAction()wrapper.Current Issue:
remove_command.go:118uses manual prompt handling instead of the standardized console helper.Approach
Locate the prompt code around line 118 in
pkg/cli/remove_command.goReplace with
console.ConfirmAction():Test the change:
Files to Modify
pkg/cli/remove_command.go(line ~118)Implementation Example
Acceptance Criteria
console.ConfirmAction()make fmtandmake lintmake agent-finishcompletes successfullyPriority
Phase 1: Critical Fix (1-2 hours estimated)