UNPKG

@cto.ai/ops

Version:

💻 CTO.ai - The CLI built for Teams 🚀

30 lines (29 loc) • 1.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const base_1 = tslib_1.__importStar(require("../base")); class Whoami extends base_1.default { async run() { this.parse(Whoami); const config = await this.isLoggedIn(); this.log('\n'); this.log(`${this.ux.colors.green(this.ux.colors.bold(' Email: '))}${config.user.email}`); this.log(`${this.ux.colors.green(this.ux.colors.bold(' Username: '))}${config.user.username}`); this.log(`${this.ux.colors.green(this.ux.colors.bold(' Team Name: '))}${config.team.name}`); if (config.user.registryHost) { this.debug(`${this.ux.colors.green(this.ux.colors.bold('\n OPS_REGISTRY_HOST: '))}${config.user.registryHost}`); } if (config.user.nodeEnv) { this.debug(`${this.ux.colors.green(this.ux.colors.bold(' NODE_ENV: '))}${config.user.nodeEnv}`); } this.log('\n'); this.services.analytics.track('Ops CLI Whoami', { username: config.user.username, }, config); } } exports.default = Whoami; Whoami.description = 'Display your user information'; Whoami.flags = { help: base_1.flags.help({ char: 'h' }), };