-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* 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>
- Loading branch information
1 parent
6928800
commit cde9726
Showing
7 changed files
with
241 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.