Show details for a step type.
(
step_id: str = typer.Argument(..., help="Step type ID"),
)
| 1571 | |
| 1572 | @workflow_step_app.command("info") |
| 1573 | def workflow_step_info( |
| 1574 | step_id: str = typer.Argument(..., help="Step type ID"), |
| 1575 | ): |
| 1576 | """Show details for a step type.""" |
| 1577 | from . import STEP_REGISTRY |
| 1578 | from .catalog import StepCatalog, StepCatalogError, StepRegistry |
| 1579 | |
| 1580 | project_root = _require_specify_project() |
| 1581 | |
| 1582 | registry = StepRegistry(project_root) |
| 1583 | installed_meta = registry.get(step_id) |
| 1584 | |
| 1585 | # Check if it's a built-in |
| 1586 | builtin_step = STEP_REGISTRY.get(step_id) |
| 1587 | is_builtin = builtin_step is not None and not installed_meta |
| 1588 | |
| 1589 | if is_builtin: |
| 1590 | console.print(f"\n[bold cyan]{step_id}[/bold cyan] [dim](built-in)[/dim]") |
| 1591 | console.print(f" Type key: {step_id}") |
| 1592 | console.print(" [green]Built-in step type[/green]") |
| 1593 | return |
| 1594 | |
| 1595 | if installed_meta: |
| 1596 | console.print( |
| 1597 | f"\n[bold cyan]{installed_meta.get('name', step_id)}[/bold cyan] ({step_id})" |
| 1598 | ) |
| 1599 | console.print(f" Version: {installed_meta.get('version', '?')}") |
| 1600 | if installed_meta.get("author"): |
| 1601 | console.print(f" Author: {installed_meta['author']}") |
| 1602 | if installed_meta.get("description"): |
| 1603 | console.print(f" Description: {installed_meta['description']}") |
| 1604 | console.print(" [green]Installed[/green]") |
| 1605 | return |
| 1606 | |
| 1607 | # Try catalog |
| 1608 | catalog = StepCatalog(project_root) |
| 1609 | try: |
| 1610 | info = catalog.get_step_info(step_id) |
| 1611 | except StepCatalogError: |
| 1612 | info = None |
| 1613 | |
| 1614 | if info: |
| 1615 | console.print( |
| 1616 | f"\n[bold cyan]{info.get('name', step_id)}[/bold cyan] ({step_id})" |
| 1617 | ) |
| 1618 | console.print(f" Version: {info.get('version', '?')}") |
| 1619 | if info.get("author"): |
| 1620 | console.print(f" Author: {info['author']}") |
| 1621 | if info.get("description"): |
| 1622 | console.print(f" Description: {info['description']}") |
| 1623 | console.print(" [yellow]Not installed[/yellow]") |
| 1624 | console.print( |
| 1625 | f"\n Install with: [cyan]specify workflow step add {step_id}[/cyan]" |
| 1626 | ) |
| 1627 | else: |
| 1628 | console.print(f"[red]Error:[/red] Step type '{step_id}' not found") |
| 1629 | raise typer.Exit(1) |
| 1630 |
nothing calls this directly
no test coverage detected