Skip to content

Commit 6ee1f91

Browse files
author
DevForge Engineer
committed
fix(cli): replace undefined 'typer' references with 'click' in MCP error handler
The mcp() command referenced typer.echo and typer.Exit but never imported typer. This caused a NameError when click-to-mcp was not installed, masking the helpful install instruction. Since the project uses Click (not Typer), switched to click.echo and click.Exit. Fixes: - F821: Undefined name 'typer' → use click.echo / click.Exit - B904: raise from None to suppress exception chain - I001: auto-fixed import sort in _render_costs
1 parent 5164fc7 commit 6ee1f91

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/deploydiff/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def mcp():
112112
try:
113113
from click_to_mcp import serve_stdio
114114
except ImportError:
115-
typer.echo("Error: click-to-mcp is required for MCP support. Install with: pip install click-to-mcp", err=True)
116-
raise typer.Exit(code=1)
115+
click.echo("Error: click-to-mcp is required for MCP support. Install with: pip install click-to-mcp", err=True)
116+
raise click.Exit(code=1) from None
117117
serve_stdio(main, name="deploydiff")
118118

119119

@@ -144,8 +144,8 @@ def _load_plan(
144144

145145
def _render_costs(estimates: list[CostEstimate], plan: DeployPlan, console: Console) -> None:
146146
"""Render cost estimates to the console."""
147-
from rich.table import Table
148147
from rich import box
148+
from rich.table import Table
149149

150150
table = Table(title="Cost Impact Estimate", box=box.ROUNDED, show_header=True)
151151
table.add_column("Resource", style="bold")

0 commit comments

Comments
 (0)