@@ -321,7 +321,7 @@ func toFullscreenView(content string) tea.View {
321321
322322// buildCommandCategories builds the list of command categories for the command palette
323323func (a * appModel ) buildCommandCategories () []dialog.CommandCategory {
324- return []dialog.CommandCategory {
324+ categories := []dialog.CommandCategory {
325325 {
326326 Name : "Session" ,
327327 Commands : []dialog.Command {
@@ -370,4 +370,38 @@ func (a *appModel) buildCommandCategories() []dialog.CommandCategory {
370370 },
371371 },
372372 }
373+
374+ // Add agent commands if available
375+ agentCommands := a .application .CurrentAgentCommands ()
376+ if len (agentCommands ) > 0 {
377+ commands := make ([]dialog.Command , 0 , len (agentCommands ))
378+ for name , prompt := range agentCommands {
379+ cmdText := "/" + name
380+
381+ // Truncate long descriptions to fit on one line
382+ description := prompt
383+ if len (description ) > 60 {
384+ description = description [:57 ] + "..."
385+ }
386+
387+ // Capture cmdText in closure properly
388+ commandText := cmdText
389+ commands = append (commands , dialog.Command {
390+ ID : "agent.command." + name ,
391+ Label : commandText ,
392+ Description : description ,
393+ Category : "Agent Commands" ,
394+ Execute : func () tea.Cmd {
395+ return a .chatPage .ExecuteCommand (commandText )
396+ },
397+ })
398+ }
399+
400+ categories = append (categories , dialog.CommandCategory {
401+ Name : "Agent Commands" ,
402+ Commands : commands ,
403+ })
404+ }
405+
406+ return categories
373407}
0 commit comments