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.
36 lines (30 loc) • 899 B
text/typescript
import { createSSHKey } from "@/modules/ssh-keys/use-cases/create-ssh-key";
import { input } from "@inquirer/prompts";
import type { Command } from "commander";
export function createSSHKeyCreateCommand(sshKeyCommand: Command) {
sshKeyCommand
.command("create")
.description("Create a new SSH key")
.action(async () => {
const name = await input({
message: "Name of the SSH key",
default: "my-ssh-key",
});
const publicKey = await input({
message: "Public key (paste it here)",
});
console.log("Creating SSH key...");
const result = await createSSHKey.execute({
name,
publicKey,
});
if (result.isLeft()) {
console.error(result.value.message);
return;
}
console.log(
"SSH key created successfully! SSH key ID: ",
result.value._id
);
});
}