flightdesk 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/main.js +38 -1
  2. package/main.js.map +4 -4
  3. package/package.json +1 -1
package/main.js CHANGED
@@ -3053,6 +3053,9 @@ function readFolderCredential() {
3053
3053
  return null;
3054
3054
  }
3055
3055
  var folderCredential;
3056
+ function credentialSource() {
3057
+ return folder()?.source ?? `home (${CONFIG_FILE})`;
3058
+ }
3056
3059
  function folder() {
3057
3060
  if (folderCredential === void 0) folderCredential = readFolderCredential();
3058
3061
  return folderCredential;
@@ -3670,6 +3673,39 @@ function registerPlanCommands(program3) {
3670
3673
  );
3671
3674
  }
3672
3675
 
3676
+ // apps/cli/src/commands/whoami.ts
3677
+ function registerWhoamiCommand(program3) {
3678
+ program3.command("whoami").description("Show who the resolved API key authenticates as, and where the key came from").option("--json", "Machine-readable output").action(async (options) => {
3679
+ const config = loadConfig();
3680
+ if (!config.apiKey) {
3681
+ console.error("No API key configured. Run: flightdesk init");
3682
+ process.exit(1);
3683
+ }
3684
+ const apiUrl = getApiUrl();
3685
+ const source = credentialSource();
3686
+ try {
3687
+ const me = await fetchUserInfo(config.apiKey, apiUrl);
3688
+ const email = me.emails?.find((e) => e.primary)?.email ?? me.emails?.[0]?.email ?? null;
3689
+ const organizations = (me.organizations ?? []).map((o) => o.organization);
3690
+ if (options.json) {
3691
+ console.log(JSON.stringify({ id: me.id, email, organizations, apiUrl, source }, null, 2));
3692
+ return;
3693
+ }
3694
+ console.log(`${email ?? me.id}${email ? ` (${me.id})` : ""}`);
3695
+ console.log(`API: ${apiUrl}`);
3696
+ console.log(`Key: ${source}`);
3697
+ console.log(
3698
+ `Orgs: ${organizations.length ? organizations.map((o) => `${o.name} (${o.id})`).join(", ") : "none"}`
3699
+ );
3700
+ } catch (error) {
3701
+ console.error(
3702
+ `Not authenticated against ${apiUrl} (key from ${source}): ${error.message}`
3703
+ );
3704
+ process.exit(1);
3705
+ }
3706
+ });
3707
+ }
3708
+
3673
3709
  // apps/cli/src/commands/dispatch.ts
3674
3710
  var os2 = __toESM(require("node:os"));
3675
3711
  async function execute3(query, variables) {
@@ -5012,7 +5048,8 @@ var program2 = new Command();
5012
5048
  registerDispatchCommands(program2);
5013
5049
  registerQuestionCommands(program2);
5014
5050
  registerPlanCommands(program2);
5015
- program2.name("flightdesk").description("FlightDesk CLI - AI task management for Claude Code sessions").version("0.6.0").option("--dev", "Use local development API (localhost:3000)").option("--api <url>", "Use custom API URL");
5051
+ registerWhoamiCommand(program2);
5052
+ program2.name("flightdesk").description("FlightDesk CLI - AI task management for Claude Code sessions").version("0.6.1").option("--dev", "Use local development API (localhost:3000)").option("--api <url>", "Use custom API URL");
5016
5053
  program2.hook("preAction", () => {
5017
5054
  const opts = program2.opts();
5018
5055
  if (opts.api) {