import {command, help, namespace} from 'oo-cli'; import {die} from '../../lib/die'; import {formatError} from '../../lib/formatError'; import {Rivendell} from '../../lib/Rivendell'; import * as chalk from 'chalk'; @namespace('accounts') export class WhoamiCommand { @command @help('Show your account information') public async whoami() { try { const me = await Rivendell.whoami(); console.log(chalk.gray(require('js-yaml').dump(me))); } catch (e: any) { die(formatError(e)); } } }