UNPKG

balena-cli

Version:

The official balena Command Line Interface

33 lines (32 loc) 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@oclif/core"); const lazy_1 = require("../../utils/lazy"); const validation_1 = require("../../utils/validation"); class SSHKeyCmd extends core_1.Command { async run() { const { args: params } = await this.parse(SSHKeyCmd); const key = await (0, lazy_1.getBalenaSdk)().models.key.get(params.id); const displayKey = { id: key.id, name: key.title, }; console.log((0, lazy_1.getVisuals)().table.vertical(displayKey, ['id', 'name'])); console.log('\n' + key.public_key); } } SSHKeyCmd.description = (0, lazy_1.stripIndent) ` Display an SSH key. Display a single SSH key registered in balenaCloud for the logged in user. `; SSHKeyCmd.examples = ['$ balena ssh-key 17']; SSHKeyCmd.args = { id: core_1.Args.integer({ description: 'balenaCloud ID for the SSH key', parse: (x) => (0, validation_1.parseAsInteger)(x, 'id'), required: true, }), }; SSHKeyCmd.authenticated = true; exports.default = SSHKeyCmd; //# sourceMappingURL=index.js.map