def get_signature(cmd):
    """Generate a command signature from its arguments.

    Args:
        cmd: Command object to generate signature for

    Returns:
        Formatted signature string
    """
    signature = cmd.name
    if "arguments" in cmd.__dict__ and cmd.arguments is not None:
        if cmd.end_name is None:
            for argument in cmd.arguments:
                param = argument.name
                if argument.required:
                    signature += f" <{param}>"
                else:
                    signature += f" [<{param}>]"
        else:
            for argument in cmd.arguments[:-1]:
                param = argument.name
                if argument.required:
                    signature += f" <{param}>"
                else:
                    signature += f" [<{param}>]"
            signature += f"\n{list(cmd.arguments[-1].keys())[0]}\n{cmd.end_name}"
    return signature
Generate a command signature from its arguments.

    Args:
        cmd: Command object to generate signature for

    Returns:
        Formatted signature string
    
sweagent/tools/utils.py