1- """Slash commands for /list, / integrations, and /mcp."""
1+ """Slash commands for /integrations and /mcp."""
22
33from __future__ import annotations
44
88from app .cli .interactive_shell .command_registry import repl_data
99from app .cli .interactive_shell .command_registry .cli_parity import run_cli_command
1010from app .cli .interactive_shell .command_registry .types import ExecutionTier , SlashCommand
11- from app .cli .interactive_shell .config .tool_catalog import build_tool_catalog
1211from app .cli .interactive_shell .runtime import ReplSession
1312from app .cli .interactive_shell .ui import (
1413 BOLD_BRAND ,
1918 WARNING ,
2019 render_integrations_table ,
2120 render_mcp_table ,
22- render_models_table ,
23- render_tools_table ,
2421 repl_table ,
2522)
2623from app .cli .interactive_shell .ui .choice_menu import (
3633 repl_print ,
3734)
3835
39- _ROOT_LIST = "/list"
4036_ROOT_INTEGRATIONS = "/integrations"
4137_ROOT_MCP = "/mcp"
4238
@@ -89,40 +85,6 @@ def _render_integration_show(console: Console, service: str) -> bool:
8985 return True
9086
9187
92- def _interactive_list_menu (_session : ReplSession , console : Console ) -> bool :
93- while True :
94- sub = repl_choose_one (
95- title = "list" ,
96- breadcrumb = _ROOT_LIST ,
97- choices = [
98- ("integrations" , "/list integrations" ),
99- ("models" , "/list models" ),
100- ("mcp" , "/list mcp" ),
101- ("tools" , "/list tools" ),
102- ("all" , "all" ),
103- ("done" , "done" ),
104- ],
105- )
106- if sub is None or sub == "done" :
107- return True
108- if sub == "integrations" :
109- results = repl_data .load_verified_integrations ()
110- render_integrations_table (console , results )
111- elif sub == "mcp" :
112- results = repl_data .load_verified_integrations ()
113- render_mcp_table (console , results )
114- elif sub == "models" :
115- render_models_table (console , repl_data .load_llm_settings ())
116- elif sub == "all" :
117- results = repl_data .load_verified_integrations ()
118- render_integrations_table (console , results )
119- render_mcp_table (console , results )
120- render_models_table (console , repl_data .load_llm_settings ())
121- elif sub == "tools" :
122- render_tools_table (console , build_tool_catalog ())
123- repl_section_break (console )
124-
125-
12688def _cmd_integrations (session : ReplSession , console : Console , args : list [str ]) -> bool :
12789 if not args and repl_tty_interactive ():
12890 return _interactive_integrations_menu (session , console )
@@ -294,50 +256,6 @@ def _interactive_mcp_menu(session: ReplSession, console: Console) -> bool:
294256 repl_section_break (console )
295257
296258
297- def _cmd_list (session : ReplSession , console : Console , args : list [str ]) -> bool :
298- if not args and repl_tty_interactive ():
299- return _interactive_list_menu (session , console )
300-
301- sub = (args [0 ].lower () if args else "" ).strip ()
302-
303- if sub in ("integrations" , "integration" , "int" ):
304- render_integrations_table (console , repl_data .load_verified_integrations ())
305- return True
306-
307- if sub in ("mcp" , "mcps" ):
308- render_mcp_table (console , repl_data .load_verified_integrations ())
309- return True
310-
311- if sub in ("models" , "model" , "llm" , "llms" ):
312- render_models_table (console , repl_data .load_llm_settings ())
313- return True
314-
315- if sub in ("tools" , "tool" ):
316- render_tools_table (console , build_tool_catalog ())
317- return True
318-
319- if sub and sub not in ("" , "all" ):
320- console .print (
321- f"[{ ERROR } ]unknown list target:[/] { escape (sub )} "
322- "(try [bold]/list integrations[/bold], [bold]/list models[/bold], "
323- "[bold]/list mcp[/bold], or [bold]/list tools[/bold])"
324- )
325- return True
326-
327- results = repl_data .load_verified_integrations ()
328- render_integrations_table (console , results )
329- render_mcp_table (console , results )
330- render_models_table (console , repl_data .load_llm_settings ())
331- return True
332-
333-
334- _LIST_FIRST_ARGS : tuple [tuple [str , str ], ...] = (
335- ("integrations" , "alert-source integrations" ),
336- ("models" , "active LLM models" ),
337- ("mcp" , "connected MCP servers" ),
338- ("tools" , "registered tools (investigation + chat surfaces)" ),
339- )
340-
341259_INTEGRATIONS_FIRST_ARGS : tuple [tuple [str , str ], ...] = (
342260 ("list" , "list all configured integrations" ),
343261 ("verify" , "run health checks on all integrations" ),
@@ -351,15 +269,6 @@ def _cmd_list(session: ReplSession, console: Console, args: list[str]) -> bool:
351269)
352270
353271COMMANDS : list [SlashCommand ] = [
354- SlashCommand (
355- "/list" ,
356- "Browse integrations, MCP servers, models, and tools." ,
357- _cmd_list ,
358- usage = ("/list" , "/list integrations" , "/list models" , "/list mcp" , "/list tools" ),
359- notes = ("In a TTY, bare /list opens an interactive menu." ,),
360- first_arg_completions = _LIST_FIRST_ARGS ,
361- execution_tier = ExecutionTier .SAFE ,
362- ),
363272 SlashCommand (
364273 "/integrations" ,
365274 "Manage integrations." ,
0 commit comments