"""
VaahAI version command implementation.

This module contains the implementation of the version command,
which displays the current version of VaahAI.
"""

import typer
import importlib.metadata
from vaahai.cli.utils.console import print_panel, console

# Create the version command group
version_app = typer.Typer(
    name="version",
    help="Display VaahAI version information",
    add_completion=False,
)


@version_app.callback()
def callback():
    """
    Display VaahAI version information.
    """
    pass


@version_app.command("show")
def show():
    """
    Show the current version of VaahAI.
    """
    try:
        version = importlib.metadata.version("vaahai")
    except importlib.metadata.PackageNotFoundError:
        version = "unknown (development mode)"
    
    print_panel(
        f"VaahAI version: [bold green]{version}[/bold green]",
        title="Version Information",
        style="blue",
    )
