def generate_output(advisory_id: str, details: dict) -> str:
    """
    Generates the output for the given advisory_id and list of CPEs

    :param advisory_id: Advisory ID from the OVAL XML file
    :param details: Dictionary containing a list of CPEs and repositories for the advisory_id
    :return: Output to display on the CLI for the advisory
    """
    cpe_count = details.get('num_of_cpes', 0)
    repo_count = details.get('num_of_repos', 0)
    cpe_string = '\n'.join([f"    - {cpe}" for cpe in details.get('list_of_cpes', [])])
    repo_string = '\n'.join([f"    - {cpe}" for cpe in details.get('list_of_repos', [])])
    output = f'Advisory {advisory_id}:\n'
    output += f'  Contains {cpe_count} {"CPEs" if cpe_count > 1 else "CPE"}...\n{cpe_string}\n'
    output += (f'  Applies to {repo_count} '
               f'{"repositories" if repo_count > 1 else "repository"}...\n{repo_string}\n')
    return output