"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const chalk_1 = __importDefault(require("chalk"));
const profile_manager_1 = require("../../lib/profile-manager");
class ContextList extends core_1.Command {
    async run() {
        const profiles = profile_manager_1.ProfileManager.listProfiles();
        const active = profile_manager_1.ProfileManager.getActiveProfile();
        if (profiles.length === 0) {
            console.log(chalk_1.default.dim('No profiles found. Run flui context create <name> to create one.'));
            return;
        }
        for (const profile of profiles) {
            if (profile === active) {
                console.log(chalk_1.default.green(`* ${profile}`));
            }
            else {
                console.log(`  ${profile}`);
            }
        }
    }
}
ContextList.description = 'List all profiles';
ContextList.examples = ['<%= config.bin %> <%= command.id %>'];
exports.default = ContextList;
