dlt.common.configuration.plugins
TCliCommandCompose
How a CLI command merges with other plugins' commands of the same (parent, command).
manager
def manager() -> pluggy.PluginManager
Returns current plugin context
load_setuptools_entrypoints
def load_setuptools_entrypoints(m: pluggy.PluginManager) -> List[str]
Loads entry points in group dlt and instantiates them to initialize plugins.
Returns a list of names of top level modules/packages from detected entry points.
plug_run_context
@hookspec(firstresult=True)
def plug_run_context(
run_dir: Optional[str],
runtime_kwargs: Optional[Dict[str, Any]]) -> Optional[RunContextBase]
Spec for plugin hook that returns current run context.
Arguments:
run_dirstr - An initial run directory of the contextruntime_kwargs- Any additional arguments passed to the context via PluggableRunContext.reload
Returns:
SupportsRunContext- A run context implementing SupportsRunContext protocol
SupportsCliCommand Objects
class SupportsCliCommand(Protocol)
Protocol for defining one dlt cli command.
command
name of the command
help_string
the help string for argparse
description
the more detailed description for argparse, may inlcude markdown for the docs
docs_url
the default docs url to be printed in case of an exception
parent
When set, this command is registered as a subcommand under the top-level parent command
compose
How this command merges when multiple plugins register the same (parent, command).
replace(default): first registered wins; rest dropped.extend: first plugin'sconfigure_parserruns; ALL plugins'executefire in order.additive: additional subparsers may be added to top level command
configure_parser
def configure_parser(parser: argparse.ArgumentParser) -> None
Configures the parser for the given argument.
execute
def execute(args: argparse.Namespace) -> None
Executes the command with the given arguments
only_host
def only_host(
hosts: Union[str, Iterable[str]]
) -> Callable[[_TCommandDefFunc], _TCommandDefFunc]
Emits cli command only if one if hosts was requested via plugin hook.
plug_cli
@hookspec()
def plug_cli(host: str) -> Optional[Type[SupportsCliCommand]]
Spec for plugin hook that returns a CLI command class for a given CLI host.
Arguments:
host- Name of the CLI host requesting commands (e.g."dlt","dlthub"). Plugins return their command class only if they contribute to this host;
Returns:
Optional[Type[SupportsCliCommand]]- Command class to register, orNonewhen the plugin does not contribute to the requested host.
SupportsMcpFeatures Objects
class SupportsMcpFeatures(Protocol)
Protocol for contributing MCP tools, prompts, and providers via plug_mcp hook
name
unique name identifying this feature set
tools
tool functions or Tool objects to register
prompts
prompt functions or Prompt objects to register
providers
provider instances (e.g. SkillProvider) to register
plug_mcp
@hookspec()
def plug_mcp(features: Set[str]) -> Optional[SupportsMcpFeatures]
Spec for plugin hook that contributes MCP tools, prompts, and providers.
MCP server will broadcast features to all registered plugins that may
decide to return a MCP feature (combination of tools, skills and prompts)
or not. The server collects all non-None results and registers everything on the
FastMCP instance.
Arguments:
features- set of feature keywords the server requests