@2501-ai/cli
Version:
[](https://www.npmjs.com/package/@2501-ai/cli) [](https://www.2501.ai/research/full-humaneval-benchmark) [); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.configCommand = void 0;
const axios_1 = __importDefault(require("axios"));
const terminal_kit_1 = require("terminal-kit");
const constants_1 = require("../constants");
const conf_1 = require("../utils/conf");
const logger_1 = __importDefault(require("../utils/logger"));
function configCommand() {
return __awaiter(this, void 0, void 0, function* () {
const logger = new logger_1.default();
try {
logger.start('Fetching configurations...');
const config = (0, conf_1.readConfig)();
const response = yield axios_1.default.get(`${constants_1.API_HOST}${constants_1.API_VERSION}/configurations`, {
headers: { Authorization: `Bearer ${config === null || config === void 0 ? void 0 : config.api_key}` },
});
logger.stop('Configurations fetched successfully.');
logger.outro('Configurations :');
terminal_kit_1.terminal.table([
['Key', 'Description'],
...response.data.map((c) => [
c.key,
c.description,
]),
], {
contentHasMarkup: true,
borderChars: 'lightRounded',
borderAttr: { color: 'blue' },
textAttr: { bgColor: 'default' },
firstRowTextAttr: { bgColor: 'blue' },
width: 80,
fit: true,
});
}
catch (error) {
logger_1.default.error('Failed to fetch configurations:');
}
});
}
exports.configCommand = configCommand;