Shared function to run provider commands.
(args, log_prefix="Provider command")
| 885 | |
| 886 | # Shared provider command function |
| 887 | def _run_provider_command(args, log_prefix="Provider command"): |
| 888 | """Shared function to run provider commands.""" |
| 889 | from mcp_cli.adapters.cli import cli_execute |
| 890 | |
| 891 | # Initialize context for the provider command |
| 892 | initialize_context() |
| 893 | |
| 894 | try: |
| 895 | asyncio.run(cli_execute("providers", args=args)) |
| 896 | except Exception as e: |
| 897 | output.error(f"Error: {e}") |
| 898 | raise typer.Exit(1) |
| 899 | |
| 900 | |
| 901 | # Function to configure logging for individual commands |