@@ -23,6 +23,7 @@ import (
2323 "github.com/charmbracelet/crush/internal/tui/exp/list"
2424 "github.com/charmbracelet/crush/internal/tui/styles"
2525 "github.com/charmbracelet/crush/internal/tui/util"
26+ "github.com/charmbracelet/crush/internal/uicmd"
2627)
2728
2829const (
@@ -44,13 +45,11 @@ const (
4445type listModel = list.FilterableList[list.CompletionItem[Command]]
4546
4647// Command represents a command that can be executed
47−type Command struct {
48− ID string
49− Title string
50− Description string
51− Shortcut string // Optional shortcut for the command
52− Handler func(cmd Command) tea.Cmd
53−}
48+type (
49+ Command = uicmd.Command
50+ CommandRunCustomMsg = uicmd.CommandRunCustomMsg
51+ ShowMCPPromptArgumentsDialogMsg = uicmd.ShowMCPPromptArgumentsDialogMsg
52+)
5453
5554// CommandsDialog represents the commands dialog.
5655type CommandsDialog interface {
@@ -121,12 +120,12 @@ func NewCommandDialog(sessionID string) CommandsDialog {
121120}
122121
123122func (c *commandDialogCmp) Init() tea.Cmd {
124− commands, err := LoadCustomCommands()
123+ commands, err := uicmd.LoadCustomCommands()
125124 if err != nil {
126125 return util.ReportError(err)
127126 }
128127 c.userCommands = commands
129− c.mcpPrompts.SetSlice(loadMCPPrompts())
128+ c.mcpPrompts.SetSlice(uicmd.LoadMCPPrompts())
130129 return c.setCommandType(c.selected)
131130}
132131
@@ -142,7 +141,7 @@ func (c *commandDialogCmp) Update(msg tea.Msg) (util.Model, tea.Cmd) {
142141 case pubsub.Event[mcp.Event]:
143142 // Reload MCP prompts when MCP state changes
144143 if msg.Type == pubsub.UpdatedEvent {
145− c.mcpPrompts.SetSlice(loadMCPPrompts())
144+ c.mcpPrompts.SetSlice(uicmd.LoadMCPPrompts())
146145 // If we're currently viewing MCP prompts, refresh the list
147146 if c.selected == MCPPrompts {
148147 return c, c.setCommandType(MCPPrompts)