MCPcopy
hub / github.com/github/spec-kit / version

Function version

src/specify_cli/__init__.py:436–493  ·  view source on GitHub ↗

Display version and system information.

(
    features: bool = typer.Option(
        False,
        "--features",
        help="Show local CLI feature capabilities.",
    ),
    json_output: bool = typer.Option(
        False,
        "--json",
        help="Emit feature capabilities as JSON. Requires --features.",
    ),
)

Source from the content-addressed store, hash-verified

434
435@app.command()
436def version(
437 features: bool = typer.Option(
438 False,
439 "--features",
440 help="Show local CLI feature capabilities.",
441 ),
442 json_output: bool = typer.Option(
443 False,
444 "--json",
445 help="Emit feature capabilities as JSON. Requires --features.",
446 ),
447):
448 """Display version and system information."""
449 import platform
450
451 cli_version = get_speckit_version()
452
453 if json_output and not features:
454 console.print("[red]Error:[/red] --json requires --features.")
455 raise typer.Exit(1)
456
457 if features:
458 capabilities = _feature_capabilities()
459 if json_output:
460 payload = {"version": cli_version, "features": capabilities}
461 console.print(json.dumps(payload, indent=2))
462 return
463
464 console.print(f"Spec Kit CLI: {cli_version}")
465 console.print()
466 console.print("Features:")
467 for key, enabled in capabilities.items():
468 label = key.replace("_", " ")
469 console.print(f"- {label}: {'yes' if enabled else 'no'}")
470 return
471
472 show_banner()
473
474 info_table = Table(show_header=False, box=None, padding=(0, 2))
475 info_table.add_column("Key", style="cyan", justify="right")
476 info_table.add_column("Value", style="white")
477
478 info_table.add_row("CLI Version", cli_version)
479 info_table.add_row("", "")
480 info_table.add_row("Python", platform.python_version())
481 info_table.add_row("Platform", platform.system())
482 info_table.add_row("Architecture", platform.machine())
483 info_table.add_row("OS Version", platform.version())
484
485 panel = Panel(
486 info_table,
487 title="[bold cyan]Specify CLI Information[/bold cyan]",
488 border_style="cyan",
489 padding=(1, 2)
490 )
491
492 console.print(panel)
493 console.print()

Callers

nothing calls this directly

Calls 5

get_speckit_versionFunction · 0.85
_feature_capabilitiesFunction · 0.85
show_bannerFunction · 0.85
printMethod · 0.80
versionMethod · 0.45

Tested by

no test coverage detected