@lotics/cli 0.13.0 → 0.15.0

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.
package/dist/src/cli.js CHANGED
@@ -81,7 +81,7 @@ function printAuthHelp() {
81
81
  lotics auth signup <email> Create account, org, workspace, and API key
82
82
  lotics auth api-key [key] Save an existing API key (e.g. from the web app)
83
83
  lotics auth web Send a magic link email to access the web app
84
- lotics auth whoami Show the email of the current account
84
+ lotics auth whoami Show the current account's name, email, and organization
85
85
  lotics auth logout Remove saved credentials
86
86
 
87
87
  Signup flags:
@@ -352,29 +352,22 @@ async function main() {
352
352
  return;
353
353
  }
354
354
  if (subcommand === "whoami") {
355
- const config = loadConfig();
356
- if (config?.email) {
357
- console.log(config.email);
358
- return;
359
- }
360
- // No email cached — try fetching from API
361
355
  const auth = resolveAuth(flags);
362
356
  if (!auth) {
363
357
  console.error('Not authenticated. Run "lotics auth signup" or set LOTICS_API_KEY.');
364
358
  process.exit(1);
365
359
  }
366
360
  const client = new LoticsClient({ apiKey: auth.apiKey });
367
- try {
368
- const info = await client.whoami();
369
- // Cache for next time
370
- const existing = loadConfig() ?? {};
371
- saveConfig({ ...existing, email: info.email });
372
- console.log(info.email);
361
+ const info = await client.whoami();
362
+ const existing = loadConfig() ?? {};
363
+ saveConfig({ ...existing, email: info.email });
364
+ if (flags.json) {
365
+ console.log(JSON.stringify(info, null, 2));
373
366
  }
374
- catch (error) {
375
- const message = error instanceof Error ? error.message : String(error);
376
- console.error(`Failed to fetch account info: ${message}`);
377
- process.exit(1);
367
+ else {
368
+ console.log(`Name: ${info.name}`);
369
+ console.log(`Email: ${info.email}`);
370
+ console.log(`Org: ${info.organization_name} (${info.organization_id})`);
378
371
  }
379
372
  return;
380
373
  }
@@ -44,6 +44,7 @@ export declare class LoticsClient {
44
44
  email: string;
45
45
  name: string;
46
46
  organization_id: string;
47
+ organization_name: string;
47
48
  }>;
48
49
  setWorkspaceId(id: string): void;
49
50
  listWorkspaces(): Promise<WorkspaceInfo[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/cli",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Lotics SDK and CLI for AI agents",
5
5
  "type": "module",
6
6
  "bin": {