| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "github.com/charmbracelet/huh" |
| 5 | ) |
| 6 | |
| 7 | func main() { |
| 8 | var file string |
| 9 | |
| 10 | huh.NewForm( |
| 11 | huh.NewGroup( |
| 12 | huh.NewInput(). |
| 13 | Title("Name"). |
| 14 | Description("What's your name?"), |
| 15 | |
| 16 | huh.NewInput(). |
| 17 | Title("Username"). |
| 18 | Description("Select your username."), |
| 19 | |
| 20 | huh.NewFilePicker(). |
| 21 | Title("Profile"). |
| 22 | Description("Select your profile picture."). |
| 23 | AllowedTypes([]string{".png", ".jpeg", ".webp", ".gif"}). |
| 24 | Value(&file), |
| 25 | |
| 26 | huh.NewInput(). |
| 27 | Title("Password"). |
| 28 | EchoMode(huh.EchoModePassword). |
| 29 | Description("Set your Password."), |
| 30 | ), |
| 31 | ).WithShowHelp(true).Run() |
| 32 | } |