List available integrations and installed status.
(
catalog: bool = typer.Option(False, "--catalog", help="Browse full catalog (built-in + community)"),
)
| 25 | |
| 26 | @integration_app.command("list") |
| 27 | def integration_list( |
| 28 | catalog: bool = typer.Option(False, "--catalog", help="Browse full catalog (built-in + community)"), |
| 29 | ): |
| 30 | """List available integrations and installed status.""" |
| 31 | from . import INTEGRATION_REGISTRY |
| 32 | from .. import _require_specify_project |
| 33 | |
| 34 | project_root = _require_specify_project() |
| 35 | current = _read_integration_json(project_root) |
| 36 | default_key = _default_integration_key(current) |
| 37 | installed_keys = set(_installed_integration_keys(current)) |
| 38 | |
| 39 | if catalog: |
| 40 | from .catalog import IntegrationCatalog, IntegrationCatalogError |
| 41 | |
| 42 | ic = IntegrationCatalog(project_root) |
| 43 | try: |
| 44 | entries = ic.search() |
| 45 | except IntegrationCatalogError as exc: |
| 46 | console.print(f"[red]Error:[/red] {exc}") |
| 47 | raise typer.Exit(1) |
| 48 | |
| 49 | if not entries: |
| 50 | console.print("[yellow]No integrations found in catalog.[/yellow]") |
| 51 | return |
| 52 | |
| 53 | table = Table(title="Integration Catalog") |
| 54 | table.add_column("ID", style="cyan") |
| 55 | table.add_column("Name") |
| 56 | table.add_column("Version") |
| 57 | table.add_column("Source") |
| 58 | table.add_column("Status") |
| 59 | table.add_column("Multi-install Safe") |
| 60 | |
| 61 | for entry in sorted(entries, key=lambda e: e["id"]): |
| 62 | eid = entry["id"] |
| 63 | cat_name = entry.get("_catalog_name", "") |
| 64 | install_allowed = entry.get("_install_allowed", True) |
| 65 | if eid == default_key: |
| 66 | status = "[green]installed (default)[/green]" |
| 67 | elif eid in installed_keys: |
| 68 | status = "[green]installed[/green]" |
| 69 | elif eid in INTEGRATION_REGISTRY: |
| 70 | status = "built-in" |
| 71 | elif install_allowed is False: |
| 72 | status = "discovery-only" |
| 73 | else: |
| 74 | status = "" |
| 75 | safe = "" |
| 76 | if eid in INTEGRATION_REGISTRY: |
| 77 | reg_integ = INTEGRATION_REGISTRY[eid] |
| 78 | safe = "yes" if getattr(reg_integ, "multi_install_safe", False) else "no" |
| 79 | table.add_row( |
| 80 | eid, |
| 81 | entry.get("name", eid), |
| 82 | entry.get("version", ""), |
| 83 | cat_name, |
| 84 | status, |
nothing calls this directly
no test coverage detected