Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

510 B
Raw Blame
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 () => {
    await getAPIClient()
      .users.whoami.query()
      .then(printObject)
      .catch(
        printError(
          `Unable to fetch information about the owner of this API key`,
        ),
      );
  });