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()