Skip to content

Commit 30aeb88

Browse files
committed
list all templates
1 parent 658d786 commit 30aeb88

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pkg/create/prompts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ func handleTemplatePrompt(templateKVs TemplateKeyValues) (string, error) {
100100
template, err := pterm.DefaultInteractiveSelect.
101101
WithOptions(templateKVs.GetTemplateDisplayValues()).
102102
WithDefaultText(TemplatePrompt).
103+
WithMaxHeight(len(templateKVs)).
103104
Show()
104105
if err != nil {
105106
return "", err

pkg/create/templates.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type TemplateKeyValues []TemplateKeyValue
3434
var Templates = map[string]TemplateInfo{
3535
TemplateSampleApp: {
3636
Name: "Sample App",
37-
Description: "Implements basic Kernel apps",
37+
Description: "Implements a basic Kernel app",
3838
Languages: []string{LanguageTypeScript, LanguagePython},
3939
},
4040
TemplateCaptchaSolver: {
@@ -87,6 +87,13 @@ func GetSupportedTemplatesForLanguage(language string) TemplateKeyValues {
8787
}
8888

8989
sort.Slice(templates, func(i, j int) bool {
90+
// Put computer-use first, then sort alphabetically
91+
if templates[i].Key == TemplateComputerUse {
92+
return true
93+
}
94+
if templates[j].Key == TemplateComputerUse {
95+
return false
96+
}
9097
return templates[i].Key < templates[j].Key
9198
})
9299

0 commit comments

Comments
 (0)