88
99import typer
1010
11- from aai_cli import output
11+ from aai_cli import choices , output
1212from aai_cli .context import AppState , run_command
13- from aai_cli .errors import UsageError
1413from aai_cli .help_text import examples_epilog
1514from aai_cli .steps import Step , render_steps
1615
2726MCP_NAME = "assemblyai-docs"
2827MCP_URL = "https://mcp.assemblyai.com/docs"
2928SKILL_REPO = "AssemblyAI/assemblyai-skill"
30- _VALID_SCOPES = ("user" , "project" , "local" )
3129_STEPS_HEADING = "AssemblyAI coding-agent setup:"
3230
3331
@@ -300,24 +298,17 @@ def _render(data: dict[str, list[Step]]) -> str:
300298)
301299def install (
302300 ctx : typer .Context ,
303- scope : str = typer .Option (
304- " user" ,
301+ scope : choices . Scope = typer .Option (
302+ choices . Scope . user ,
305303 "--scope" ,
306- help = (
307- "Config scope to register the MCP under: user, project, or local. "
308- "Presence is detected across all scopes."
309- ),
304+ help = "Config scope to register the MCP under. Presence is detected across all scopes." ,
310305 ),
311306 force : bool = typer .Option (False , "--force" , help = "Reinstall even if already present." ),
312307 json_out : bool = typer .Option (False , "--json" , help = "Output raw JSON." ),
313308) -> None :
314309 """Install the AssemblyAI docs MCP server and skills into your coding agent."""
315310
316311 def body (_state : AppState , json_mode : bool ) -> None :
317- if scope not in _VALID_SCOPES :
318- raise UsageError (
319- f"Invalid --scope '{ scope } '. Choose one of: { ', ' .join (_VALID_SCOPES )} ."
320- )
321312 steps = [_install_mcp (scope , force ), _install_skill (force ), _install_cli_skill (force )]
322313 output .emit ({"steps" : steps }, _render , json_mode = json_mode )
323314 if any (s ["status" ] == "failed" for s in steps ):
@@ -355,11 +346,11 @@ def body(_state: AppState, json_mode: bool) -> None:
355346)
356347def remove (
357348 ctx : typer .Context ,
358- scope : str | None = typer .Option (
349+ scope : choices . Scope | None = typer .Option (
359350 None ,
360351 "--scope" ,
361352 help = (
362- "Only remove the MCP from this scope (user, project, or local) . "
353+ "Only remove the MCP from this scope. "
363354 "Default: remove from whichever scope it exists in."
364355 ),
365356 ),
@@ -368,10 +359,6 @@ def remove(
368359 """Remove the AssemblyAI MCP server and skills from your coding agent."""
369360
370361 def body (_state : AppState , json_mode : bool ) -> None :
371- if scope is not None and scope not in _VALID_SCOPES :
372- raise UsageError (
373- f"Invalid --scope '{ scope } '. Choose one of: { ', ' .join (_VALID_SCOPES )} ."
374- )
375362 steps = [_remove_mcp (scope ), _remove_skill (), _remove_cli_skill ()]
376363 output .emit ({"steps" : steps }, _render , json_mode = json_mode )
377364 if any (s ["status" ] == "failed" for s in steps ):
0 commit comments