From 55faae3e1b1cae46d5a4c28e860798673248b313 Mon Sep 17 00:00:00 2001 From: Kai Chappell Date: Tue, 3 Feb 2026 18:16:07 +0000 Subject: [PATCH] feat(cli): add CLI entry point with version command Initialise Typer app with --version flag and help text. --- src/veritext/cli/__init__.py | 5 +++++ src/veritext/cli/main.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/veritext/cli/__init__.py create mode 100644 src/veritext/cli/main.py diff --git a/src/veritext/cli/__init__.py b/src/veritext/cli/__init__.py new file mode 100644 index 0000000..5876b0e --- /dev/null +++ b/src/veritext/cli/__init__.py @@ -0,0 +1,5 @@ +"""CLI module: Command-line interface for Veritext.""" + +from veritext.cli.main import app + +__all__ = ["app"] diff --git a/src/veritext/cli/main.py b/src/veritext/cli/main.py new file mode 100644 index 0000000..2e35a18 --- /dev/null +++ b/src/veritext/cli/main.py @@ -0,0 +1,31 @@ +"""Veritext CLI entry point.""" + +import typer + +import veritext + +app = typer.Typer( + name="veritext", + help="Semantic text validation framework.", + no_args_is_help=True, +) + + +@app.callback(invoke_without_command=True) +def main( + version: bool | None = typer.Option( + None, + "--version", + "-V", + help="Show version and exit.", + is_eager=True, + ), +) -> None: + """Veritext: Semantic text validation framework for Python.""" + if version: + typer.echo(f"veritext {veritext.__version__}") + raise typer.Exit() + + +if __name__ == "__main__": + app()