-
-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bookmark list output is not a valid JSON #150
Reworked the cli to switch over to json output
- Loading branch information
1 parent
474a178
commit 9cf601a
Showing
7 changed files
with
246 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
import { printError, printObject } from "@/lib/output"; | ||
import { getAPIClient } from "@/lib/trpc"; | ||
import { Command } from "@commander-js/extra-typings"; | ||
|
||
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`, | ||
), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.