def retrieve_commands_meta_content()

in modular_cli/service/help_client.py [0:0]


def retrieve_commands_meta_content():
    from pathlib import Path
    admin_home_path = os.path.join(str(Path.home()), MODULAR_CLI_META_DIR)
    root_commands = extract_root_commands(
        Path(__file__).parent.parent.resolve())
    meta_path = os.path.join(admin_home_path, META_JSON)

    if not os.path.exists(meta_path):
        return root_commands
    try:
        with open(meta_path) as file:
            content = json.load(file)
            content.update(root_commands)
        return content
    except Exception:
        raise ModularCliBadRequestException(
            'Error while CLI meta loading. Please perform login again')