nat.cli.plugin_loader#

CLI plugin discovery system for loading plugin-specific commands.

Attributes#

Functions#

discover_and_load_cli_plugins(→ None)

Discover and load CLI command plugins from installed packages.

Module Contents#

logger#
discover_and_load_cli_plugins(cli_group: click.Group) None#

Discover and load CLI command plugins from installed packages.

This function uses Python entry points to discover CLI commands provided by plugin packages. Plugins register their commands under the ‘nat.cli’ entry point group in their pyproject.toml.

The function handles import errors gracefully - if a plugin cannot be loaded (e.g., due to missing dependencies), it logs a debug message but continues loading other plugins.

Args:

cli_group: The Click group to add discovered commands to

Example plugin registration in pyproject.toml:

[project.entry-points.’nat.cli’] mcp = “nat.plugins.mcp.cli.commands:mcp_command”