diff options
Diffstat (limited to 'apps/cli/src/commands/whoami.ts')
| -rw-r--r-- | apps/cli/src/commands/whoami.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/cli/src/commands/whoami.ts b/apps/cli/src/commands/whoami.ts index b55bfa67..06a94e8f 100644 --- a/apps/cli/src/commands/whoami.ts +++ b/apps/cli/src/commands/whoami.ts @@ -1,3 +1,4 @@ +import { printError, printObject } from "@/lib/output"; import { getAPIClient } from "@/lib/trpc"; import { Command } from "@commander-js/extra-typings"; @@ -5,6 +6,12 @@ export const whoamiCmd = new Command() .name("whoami") .description("returns info about the owner of this API key") .action(async () => { - const resp = await getAPIClient().users.whoami.query(); - console.log(resp); + await getAPIClient() + .users.whoami.query() + .then(printObject) + .catch( + printError( + `Unable to fetch information about the owner of this API key`, + ), + ); }); |
