@@ -32,6 +32,7 @@ type Item struct {
3232 Category string
3333 SlashCommand string
3434 Execute ExecuteFunc
35+ Hidden bool // Hidden commands work as slash commands but don't appear in the palette
3536}
3637
3738func builtInSessionCommands () []Item {
@@ -118,8 +119,9 @@ func builtInSessionCommands() []Item {
118119 },
119120 {
120121 ID : "session.q" ,
121- Label : "Quit (short) " ,
122+ Label : "Quit" ,
122123 SlashCommand : "/q" ,
124+ Hidden : true ,
123125 Description : "Quit the application (alias for /exit)" ,
124126 Category : "Session" ,
125127 Execute : func (string ) tea.Cmd {
@@ -281,6 +283,17 @@ func builtInFeedbackCommands() []Item {
281283 }
282284}
283285
286+ // visibleOnly returns items that are not hidden.
287+ func visibleOnly (items []Item ) []Item {
288+ visible := make ([]Item , 0 , len (items ))
289+ for _ , item := range items {
290+ if ! item .Hidden {
291+ visible = append (visible , item )
292+ }
293+ }
294+ return visible
295+ }
296+
284297// sortByLabel returns items sorted alphabetically by label.
285298func sortByLabel (items []Item ) []Item {
286299 slices .SortFunc (items , func (a , b Item ) int {
@@ -330,7 +343,7 @@ func BuildCommandCategories(ctx context.Context, application *app.App) []Categor
330343
331344 categories = append (categories , Category {
332345 Name : "Agent Commands" ,
333- Commands : sortByLabel ( commands ) ,
346+ Commands : commands ,
334347 })
335348 }
336349
@@ -402,7 +415,7 @@ func BuildCommandCategories(ctx context.Context, application *app.App) []Categor
402415
403416 categories = append (categories , Category {
404417 Name : "MCP Prompts" ,
405- Commands : sortByLabel ( mcpCommands ) ,
418+ Commands : mcpCommands ,
406419 })
407420 }
408421
@@ -432,7 +445,7 @@ func BuildCommandCategories(ctx context.Context, application *app.App) []Categor
432445
433446 categories = append (categories , Category {
434447 Name : "Skills" ,
435- Commands : sortByLabel ( skillCommands ) ,
448+ Commands : skillCommands ,
436449 })
437450 }
438451
@@ -448,6 +461,11 @@ func BuildCommandCategories(ctx context.Context, application *app.App) []Categor
448461 },
449462 )
450463
464+ // Filter out hidden commands and sort by label in all categories.
465+ for i := range categories {
466+ categories [i ].Commands = sortByLabel (visibleOnly (categories [i ].Commands ))
467+ }
468+
451469 return categories
452470}
453471
0 commit comments