diff options
| author | kamtschatka <sschatka@gmail.com> | 2024-06-09 23:30:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-09 22:30:24 +0100 |
| commit | cde97267a90802c6a367aa61ff157983506deead (patch) | |
| tree | 7fc6dbca60ab537ce3e3be657f4d510dcdeb5fdb /apps/cli/src/commands/whoami.ts | |
| parent | 6928800a604f05ef62234cb5c3ee1e60fb27ea1a (diff) | |
| download | karakeep-cde97267a90802c6a367aa61ff157983506deead.tar.zst | |
fix(cli): Bookmark list output is not a valid JSON. Fixes #150 (#181)
* bookmark list output is not a valid JSON #150
Reworked the cli to switch over to json output
* changed the logging to log created bookmarks as an array
switch all log output that is just a status to stderr
---------
Co-authored-by: kamtschatka <simon.schatka@gmx.at>
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`, + ), + ); }); |
