feat(cli): add CLI entry point with version command

Initialise Typer app with --version flag and help text.
This commit is contained in:
2026-02-03 18:16:07 +00:00
parent 07ac70e835
commit 55faae3e1b
2 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
"""CLI module: Command-line interface for Veritext."""
from veritext.cli.main import app
__all__ = ["app"]

31
src/veritext/cli/main.py Normal file
View File

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