core.cli ======== .. py:module:: core.cli Classes ------- .. autoapisummary:: core.cli.CLI Module Contents --------------- .. py:class:: CLI(component_name: Optional[str] = None) Base CLI with automatic component logging support. Initialize the CLI with optional component logging. :param component_name: Component name for automatic logging configuration ('distributor', 'worker', 'server', or None to disable) .. py:attribute:: parser .. py:attribute:: component_name :value: None .. py:method:: main(argstr: Optional[str] = None) -> Any Parse args and configure component logging before execution. .. py:method:: configure_component_logging() -> None Configure logging for this component using existing infrastructure. This method can be called directly when needed (e.g., by plugins that bypass the normal main() flow). Configures both: 1. Standard logging (handlers, formatters, etc.) 2. Structlog (processors, context merging, OTLP integration) .. py:method:: parse_args(argstr: Optional[str] = None) -> argparse.Namespace Construct a parser, parse either sys.argv (default) or the provided argstr. Returns a Namespace. The Namespace should have a 'func' attribute which can be used to dispatch to the appropriate downstream function.