Phase 3: Migrate Input and Password prompts to huh
Overview
Migrate text input and password prompts.
Files to Migrate
-
internal/commands/auth/login/login.go:272- Input: Hostname -
internal/commands/auth/login/login.go:278- Input: API Host -
internal/commands/auth/login/login.go:345- Input: Hostname -
internal/commands/auth/login/login.go:529- Password: Token (with validation)
Implementation
// Input
huh.NewInput().
Title("GitLab hostname:").
Value(&hostname).
Placeholder("gitlab.com").
Run()
// Password with validation
huh.NewInput().
Title("Paste your authentication token:").
Value(&token).
EchoMode(huh.EchoModePassword).
Validate(func(s string) error {
if s == "" { return fmt.Errorf("required") }
return nil
}).
Run()
Success Criteria
- Text inputs work with defaults/placeholders
- Password masking works
- Required validation works
Effort: 2 days