UNPKG

sesterce-cli

Version:

A powerful command-line interface tool for managing Sesterce Cloud services. Sesterce CLI provides easy access to GPU cloud instances, AI inference services, container registries, and SSH key management directly from your terminal.

39 lines 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createSSHKeyMakeDefaultCommand = createSSHKeyMakeDefaultCommand; const list_ssh_keys_1 = require("@/modules/ssh-keys/use-cases/list-ssh-keys"); const make_ssh_key_default_1 = require("@/modules/ssh-keys/use-cases/make-ssh-key-default"); const prompts_1 = require("@inquirer/prompts"); function createSSHKeyMakeDefaultCommand(sshKeyCommand) { sshKeyCommand .command("make-default") .description("Make a SSH key the default one") .option("-i, --ssh-key-id <sshKeyId>", "The ID of the SSH key to make the default one") .action(async (args) => { let sshKeyId = args.sshKeyId; if (!sshKeyId) { console.log("Loading SSH keys..."); const result = await list_ssh_keys_1.listSSHKeys.execute(); if (result.isLeft()) { console.error(result.value.message); return; } const sshKeys = result.value; sshKeyId = await (0, prompts_1.select)({ message: "Select the SSH key to make the default one", choices: sshKeys.map((sshKey) => ({ name: sshKey.name, value: sshKey._id, })), }); } console.log("Making SSH key the default one..."); const result = await make_ssh_key_default_1.makeSSHKeyDefault.execute(sshKeyId); if (result.isLeft()) { console.error(result.value.message); return; } console.log("SSH key made the default one successfully!"); }); } //# sourceMappingURL=make-default.js.map