import configparser def list_profiles(cfg_file): """List all available profiles from config file""" config = configparser.ConfigParser() config.read(cfg_file) profiles = [section.split(':', 1)[1] for section in config.sections() if section.startswith('profile:')] return profiles