UNPKG

alwaysai

Version:

The alwaysAI command-line interface (CLI)

20 lines (17 loc) 573 B
import { CliLeaf } from '@alwaysai/alwayscli'; import * as chalk from 'chalk'; import { CliAuthenticationClient } from '../../infrastructure'; import { echo } from '../../util'; export const userShow = CliLeaf({ name: 'show', description: 'Show the currently logged in user', async action() { const authenticationClient = CliAuthenticationClient(); if (authenticationClient.isSignedIn()) { const { email } = await authenticationClient.getInfo(); echo(`Logged in as ${chalk.bold(email)}`); } else { echo('Not logged in'); } } });