INNER CODE UNIT · Python
_register_plugin_command
CaddyGlow/ccproxy-api · ccproxy/cli/main.py:104
def _register_plugin_command(
app: typer.Typer, plugin_name: str, cmd_spec: CliCommandSpec
) -> None:
"""Register a single plugin command."""
try:
if cmd_spec.parent_command is None:
# Top-level command
app.command(
name=cmd_spec.command_name,
help=cmd_spec.help_text or f"Command from {plugin_name} plugin",
)(cmd_spec.command_function)
logger.debug(
"plugin_command_registered",
plugin=plugin_name,
command=cmd_spec.command_name,
type="top_level",
)
else: