"""Tests for CLI MCP commands."""

from __future__ import annotations

from typer.testing import CliRunner

from ai4gh.cli.main import app

runner = CliRunner()


class TestCLI:
    def test_version(self) -> None:
        result = runner.invoke(app, ["version"])
        assert result.exit_code == 0
        assert "ai4gh" in result.output

    def test_mcp_help(self) -> None:
        result = runner.invoke(app, ["mcp", "--help"])
        assert result.exit_code == 0
        assert "serve" in result.output

    def test_no_args_shows_help(self) -> None:
        result = runner.invoke(app, [])
        # no_args_is_help=True returns exit code 0 on typer >= 0.23
        assert result.exit_code in (0, 2)
        assert "mcp" in result.output or "version" in result.output
