core.cli
Classes
Base CLI with automatic component logging support. |
Module Contents
- class core.cli.CLI(component_name: str | None = None)[source]
Base CLI with automatic component logging support.
- main(argstr: str | None = None) Any[source]
Parse args and configure component logging before execution.
- configure_component_logging() None[source]
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)
- parse_args(argstr: str | None = None) argparse.Namespace[source]
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.