import * as chalk from 'chalk'; import {command, help, namespace} from 'oo-cli'; import {getEnv, runtimeConfig} from '../../lib/Config'; import {die} from '../../lib/die'; import {formatError} from '../../lib/formatError'; @namespace('env') export class GetEnvironmentCommand { @command @help('Get the current environment of the CLI') public get() { try { console.log(`Using ${chalk.yellow(getEnv())} environment\n`); console.log('Configuration:'); console.log(chalk.gray(require('js-yaml').dump(runtimeConfig()))); } catch (e: any) { die(formatError(e)); } } }