From 0d69b4d0a1a41c4df57698daf2b7912af207325a Mon Sep 17 00:00:00 2001 From: Ari Angelo Date: Thu, 28 May 2026 13:30:49 +0200 Subject: [PATCH] feat(cli): add aignostics-sdk slim CLI entry point Creates packages/aignostics-sdk/src/aignostics_sdk/cli.py with a trimmed Typer app exposing only the platform CLI commands (user, sdk). Deliberately avoids calling prepare_cli() to prevent auto-discovery of heavy domain modules (application, wsi, dataset, bucket, qupath, system) via locate_implementations(typer.Typer). Instead, applies epilog and no-args-is-help behaviour directly by calling the private helpers _add_epilog_recursively and _no_args_is_help_recursively. --- .../aignostics-sdk/src/aignostics_sdk/cli.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 packages/aignostics-sdk/src/aignostics_sdk/cli.py diff --git a/packages/aignostics-sdk/src/aignostics_sdk/cli.py b/packages/aignostics-sdk/src/aignostics_sdk/cli.py new file mode 100644 index 00000000..ea9b3dd8 --- /dev/null +++ b/packages/aignostics-sdk/src/aignostics_sdk/cli.py @@ -0,0 +1,33 @@ +"""CLI entry point for aignostics-sdk slim distribution. + +This module wires only the platform sub-commands (user, sdk) into a trimmed +Typer application. It deliberately does *not* call ``prepare_cli`` because +that function uses ``locate_implementations`` to deep-scan the ``aignostics`` +package and would pull in the heavy domain modules (application, wsi, dataset, +bucket, qupath, …) that are absent from this slim distribution. +""" + +from __future__ import annotations + +import typer + +from aignostics_sdk.platform import cli_sdk, cli_user +from aignostics_sdk.utils import __python_version__, __version__ +from aignostics_sdk.utils._cli import _add_epilog_recursively, _no_args_is_help_recursively + +_EPILOG = f"🔬 Aignostics SDK v{__version__} - built with love in Berlin 🐻 // Python v{__python_version__}" + +cli = typer.Typer( + help="Command Line Interface (CLI) of Aignostics SDK providing access to Aignostics Platform.", +) + +cli.add_typer(cli_user) +cli.add_typer(cli_sdk) + +# Apply epilog and no-args-is-help without the auto-discovery step that +# prepare_cli performs via locate_implementations(typer.Typer). +_add_epilog_recursively(cli, _EPILOG) +_no_args_is_help_recursively(cli) + +if __name__ == "__main__": # pragma: no cover + cli()