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.
29 lines • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createSSHKeyListCommand = createSSHKeyListCommand;
const list_ssh_keys_1 = require("@/modules/ssh-keys/use-cases/list-ssh-keys");
const luxon_1 = require("luxon");
function createSSHKeyListCommand(sshKeyCommand) {
sshKeyCommand
.command("list")
.description("List all SSH keys")
.action(async () => {
console.log("Listing SSH keys...");
const result = await list_ssh_keys_1.listSSHKeys.execute();
if (result.isLeft()) {
console.error(result.value.message);
return;
}
const sshKeys = result.value;
const tableData = sshKeys.reduce((dict, { _id: id, ...sshKey }) => {
dict[id] = {
name: sshKey.name,
default: sshKey.isDefault ? "Yes" : "No",
"created at": luxon_1.DateTime.fromISO(sshKey.createdAt).toLocaleString(luxon_1.DateTime.DATE_MED),
};
return dict;
}, {});
console.table(tableData);
});
}
//# sourceMappingURL=list.js.map