Skip to content

introspect_cyclopts

Class info

🛈 DocStrings

Introspection module for cyclopts CLI applications.

get_info

get_info(instance: App, command: str | None = None) -> CommandInfo

Return a CommandInfo object for command of given cyclopts App.

Parameters:

Name Type Description Default
instance App

A cyclopts App instance

required
command str | None

The command to get info for (supports dot notation for subcommands)

None

Returns:

Type Description
CommandInfo

CommandInfo object with extracted information

Source code in src/clinspector/introspect/introspect_cyclopts.py
def get_info(instance: App, command: str | None = None) -> commandinfo.CommandInfo:
    """Return a CommandInfo object for command of given cyclopts App.

    Args:
        instance: A cyclopts App instance
        command: The command to get info for (supports dot notation for subcommands)

    Returns:
        CommandInfo object with extracted information
    """
    return resolve_command(_parse_app(instance), command)