| 1 |
package main |
| 2 |
|
| 3 |
import ( |
| 4 |
"github.com/charmbracelet/huh" |
| 5 |
) |
| 6 |
|
| 7 |
|
| 8 |
var types = []string{"fix", "feat", "docs", "style", "refactor", "test", "chore", "revert"} |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
func main() { |
| 15 |
var commit, scope string |
| 16 |
var summary, description string |
| 17 |
var confirm bool |
| 18 |
|
| 19 |
huh.NewForm( |
| 20 |
huh.NewGroup( |
| 21 |
huh.NewInput().Title("Type").Value(&commit).Placeholder("feat").Suggestions(types), |
| 22 |
huh.NewInput().Title("Scope").Value(&scope).Placeholder("scope"), |
| 23 |
), |
| 24 |
huh.NewGroup( |
| 25 |
huh.NewInput().Title("Summary").Value(&summary).Placeholder("Summary of changes"), |
| 26 |
huh.NewText().Title("Description").Value(&description).Placeholder("Detailed description of changes"), |
| 27 |
), |
| 28 |
huh.NewGroup(huh.NewConfirm().Title("Commit changes?").Value(&confirm)), |
| 29 |
).Run() |
| 30 |
} |