@cto.ai/ops
Version:
💻 CTO.ai Ops - The CLI built for Teams 🚀
34 lines (33 loc) • 1.38 kB
JavaScript
"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({
userId: this.user.email,
teamId: this.team.id,
cliEvent: 'Ops CLI Whoami',
event: 'Ops CLI Whoami',
properties: {},
}, this.accessToken);
}
}
exports.default = Whoami;
Whoami.description = 'Display your user information';
Whoami.flags = {
help: base_1.flags.help({ char: 'h' }),
};