@@ -21,7 +21,6 @@ import (
2121 "time"
2222
2323 "github.com/slackapi/slack-cli/internal/api"
24- "github.com/slackapi/slack-cli/internal/experiment"
2524 "github.com/slackapi/slack-cli/internal/iostreams"
2625 "github.com/slackapi/slack-cli/internal/pkg/create"
2726 "github.com/slackapi/slack-cli/internal/shared"
@@ -32,53 +31,9 @@ import (
3231)
3332
3433// getSelectionOptions returns the app template options for a given category.
35- func getSelectionOptions (clients * shared.ClientFactory , categoryID string ) []promptObject {
36- if clients .Config .WithExperimentOn (experiment .Templates ) {
37- templatePromptObjects := map [string ]([]promptObject ){
38- "slack-cli#getting-started" : {
39- {
40- Title : fmt .Sprintf ("Bolt for JavaScript %s" , style .Secondary ("Node.js" )),
41- Repository : "slack-samples/bolt-js-starter-template" ,
42- },
43- {
44- Title : fmt .Sprintf ("Bolt for Python %s" , style .Secondary ("Python" )),
45- Repository : "slack-samples/bolt-python-starter-template" ,
46- },
47- },
48- "slack-cli#ai-apps" : {
49- {
50- Title : fmt .Sprintf ("Support Agent %s" , style .Secondary ("Resolve IT support cases" )),
51- Repository : "slack-cli#ai-apps/support-agent" ,
52- },
53- {
54- Title : fmt .Sprintf ("Custom Agent %s" , style .Secondary ("Start from scratch" )),
55- Repository : "slack-cli#ai-apps/custom-agent" ,
56- },
57- },
58- "slack-cli#automation-apps" : {
59- {
60- Title : fmt .Sprintf ("Bolt for JavaScript %s" , style .Secondary ("Node.js" )),
61- Repository : "slack-samples/bolt-js-custom-function-template" ,
62- },
63- {
64- Title : fmt .Sprintf ("Bolt for Python %s" , style .Secondary ("Python" )),
65- Repository : "slack-samples/bolt-python-custom-function-template" ,
66- },
67- {
68- Title : fmt .Sprintf ("Deno Slack SDK %s" , style .Secondary ("Deno" )),
69- Repository : "slack-samples/deno-starter-template" ,
70- },
71- },
72- }
73- return templatePromptObjects [categoryID ]
74- }
75-
76- if strings .TrimSpace (categoryID ) == "" {
77- categoryID = "slack-cli#getting-started"
78- }
79-
34+ func getSelectionOptions (categoryID string ) []promptObject {
8035 templatePromptObjects := map [string ]([]promptObject ){
81- "slack-cli#getting-started" : [] promptObject {
36+ "slack-cli#getting-started" : {
8237 {
8338 Title : fmt .Sprintf ("Bolt for JavaScript %s" , style .Secondary ("Node.js" )),
8439 Repository : "slack-samples/bolt-js-starter-template" ,
@@ -88,6 +43,16 @@ func getSelectionOptions(clients *shared.ClientFactory, categoryID string) []pro
8843 Repository : "slack-samples/bolt-python-starter-template" ,
8944 },
9045 },
46+ "slack-cli#ai-apps" : {
47+ {
48+ Title : fmt .Sprintf ("Support Agent %s" , style .Secondary ("Resolve IT support cases" )),
49+ Repository : "slack-cli#ai-apps/support-agent" ,
50+ },
51+ {
52+ Title : fmt .Sprintf ("Custom Agent %s" , style .Secondary ("Start from scratch" )),
53+ Repository : "slack-cli#ai-apps/custom-agent" ,
54+ },
55+ },
9156 "slack-cli#automation-apps" : {
9257 {
9358 Title : fmt .Sprintf ("Bolt for JavaScript %s" , style .Secondary ("Node.js" )),
@@ -102,18 +67,7 @@ func getSelectionOptions(clients *shared.ClientFactory, categoryID string) []pro
10267 Repository : "slack-samples/deno-starter-template" ,
10368 },
10469 },
105- "slack-cli#ai-apps" : {
106- {
107- Title : fmt .Sprintf ("Bolt for JavaScript %s" , style .Secondary ("Node.js" )),
108- Repository : "slack-samples/bolt-js-assistant-template" ,
109- },
110- {
111- Title : fmt .Sprintf ("Bolt for Python %s" , style .Secondary ("Python" )),
112- Repository : "slack-samples/bolt-python-assistant-template" ,
113- },
114- },
11570 }
116-
11771 return templatePromptObjects [categoryID ]
11872}
11973
@@ -243,14 +197,10 @@ func promptTemplateSelection(cmd *cobra.Command, clients *shared.ClientFactory,
243197
244198 // Prompt for the example template
245199 prompt := "Select a language:"
246- if clients .Config .WithExperimentOn (experiment .Templates ) {
247- if categoryID == "slack-cli#ai-apps" {
248- prompt = "Select a template:"
249- } else {
250- prompt = "Select a language:"
251- }
200+ if categoryID == "slack-cli#ai-apps" {
201+ prompt = "Select a template:"
252202 }
253- options := getSelectionOptions (clients , categoryID )
203+ options := getSelectionOptions (categoryID )
254204 titles := make ([]string , len (options ))
255205 for i , m := range options {
256206 titles [i ] = m .Title
@@ -348,28 +298,18 @@ func listTemplates(ctx context.Context, clients *shared.ClientFactory, categoryS
348298 }
349299
350300 var categories []categoryInfo
351- if categoryShortcut == "agent" && clients . Config . WithExperimentOn ( experiment . Templates ) {
301+ if categoryShortcut == "agent" {
352302 categories = []categoryInfo {
353303 {id : "slack-cli#ai-apps/support-agent" , name : "Support agent" },
354304 {id : "slack-cli#ai-apps/custom-agent" , name : "Custom agent" },
355305 }
356- } else if categoryShortcut == "agent" {
357- categories = []categoryInfo {
358- {id : "slack-cli#ai-apps" , name : "AI Agent apps" },
359- }
360- } else if clients .Config .WithExperimentOn (experiment .Templates ) {
306+ } else {
361307 categories = []categoryInfo {
362308 {id : "slack-cli#getting-started" , name : "Getting started" },
363309 {id : "slack-cli#ai-apps/support-agent" , name : "Support agent" },
364310 {id : "slack-cli#ai-apps/custom-agent" , name : "Custom agent" },
365311 {id : "slack-cli#automation-apps" , name : "Automation apps" },
366312 }
367- } else {
368- categories = []categoryInfo {
369- {id : "slack-cli#getting-started" , name : "Getting started" },
370- {id : "slack-cli#ai-apps" , name : "AI Agent apps" },
371- {id : "slack-cli#automation-apps" , name : "Automation apps" },
372- }
373313 }
374314
375315 for _ , category := range categories {
@@ -383,7 +323,7 @@ func listTemplates(ctx context.Context, clients *shared.ClientFactory, categoryS
383323 secondary = append (secondary , repo )
384324 }
385325 } else {
386- for _ , tmpl := range getSelectionOptions (clients , category .id ) {
326+ for _ , tmpl := range getSelectionOptions (category .id ) {
387327 secondary = append (secondary , tmpl .Repository )
388328 }
389329 }
0 commit comments