feat: add bulkgen models command listing available models with capabilities
This commit is contained in:
parent
47b53db760
commit
b536ff9d79
2 changed files with 160 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import typer
|
|||
from bulkgen.builder import BuildEvent, BuildResult, run_build
|
||||
from bulkgen.config import ProjectConfig, load_config
|
||||
from bulkgen.graph import build_graph, get_build_order
|
||||
from bulkgen.models import ALL_MODELS
|
||||
|
||||
app = typer.Typer(name="bulkgen", help="AI artifact build tool.")
|
||||
|
||||
|
|
@ -176,3 +177,53 @@ def graph() -> None:
|
|||
if preds:
|
||||
arrow = click.style(" <- ", dim=True)
|
||||
click.echo(f" {node}{arrow}{', '.join(preds)}")
|
||||
|
||||
|
||||
@app.command()
|
||||
def models() -> None:
|
||||
"""List available models and their capabilities."""
|
||||
name_width = max(len(m.name) for m in ALL_MODELS)
|
||||
provider_width = max(len(m.provider) for m in ALL_MODELS)
|
||||
type_width = max(len(m.type) for m in ALL_MODELS)
|
||||
|
||||
header_name = "Model".ljust(name_width)
|
||||
header_provider = "Provider".ljust(provider_width)
|
||||
header_type = "Type".ljust(type_width)
|
||||
header_caps = "Capabilities"
|
||||
|
||||
click.echo(
|
||||
click.style(header_name, bold=True)
|
||||
+ " "
|
||||
+ click.style(header_provider, bold=True)
|
||||
+ " "
|
||||
+ click.style(header_type, bold=True)
|
||||
+ " "
|
||||
+ click.style(header_caps, bold=True)
|
||||
)
|
||||
click.echo(
|
||||
"─" * name_width
|
||||
+ " "
|
||||
+ "─" * provider_width
|
||||
+ " "
|
||||
+ "─" * type_width
|
||||
+ " "
|
||||
+ "─" * len(header_caps)
|
||||
)
|
||||
|
||||
for model in ALL_MODELS:
|
||||
name_col = model.name.ljust(name_width)
|
||||
provider_col = model.provider.ljust(provider_width)
|
||||
type_col = model.type.ljust(type_width)
|
||||
caps_col = ", ".join(model.capabilities)
|
||||
|
||||
type_color = "green" if model.type == "image" else "cyan"
|
||||
|
||||
click.echo(
|
||||
click.style(name_col, fg="white", bold=True)
|
||||
+ " "
|
||||
+ provider_col
|
||||
+ " "
|
||||
+ click.style(type_col, fg=type_color)
|
||||
+ " "
|
||||
+ click.style(caps_col, dim=True)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue