@lizard-build/cli 0.3.58 → 0.3.59

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.
@@ -19,9 +19,11 @@ export declare function createSession(): Promise<SessionResponse>;
19
19
  /** Check once if the user has completed authentication (no polling loop) */
20
20
  export declare function checkSession(sessionId: string, sessionSecret: string): Promise<CheckResponse>;
21
21
  /**
22
- * Start the login flow: creates a session, saves it to disk, opens the
23
- * browser, prints the URL, then exits. The user authenticates in the browser
24
- * and re-runs their original command requireAuth will pick up the session.
22
+ * Start the login flow: creates a session, saves it to disk, surfaces the
23
+ * auth URL, then exits. In human mode it opens the browser and prints the
24
+ * URL; in JSON mode it emits the URL as JSON and never opens a browser. The
25
+ * user authenticates and re-runs their original command — requireAuth will
26
+ * pick up the pending session.
25
27
  */
26
28
  export declare function performLogin(): Promise<never>;
27
29
  export declare function registerLogin(program: Command): void;
@@ -24,9 +24,11 @@ export async function checkSession(sessionId, sessionSecret) {
24
24
  return res.json();
25
25
  }
26
26
  /**
27
- * Start the login flow: creates a session, saves it to disk, opens the
28
- * browser, prints the URL, then exits. The user authenticates in the browser
29
- * and re-runs their original command requireAuth will pick up the session.
27
+ * Start the login flow: creates a session, saves it to disk, surfaces the
28
+ * auth URL, then exits. In human mode it opens the browser and prints the
29
+ * URL; in JSON mode it emits the URL as JSON and never opens a browser. The
30
+ * user authenticates and re-runs their original command — requireAuth will
31
+ * pick up the pending session.
30
32
  */
31
33
  export async function performLogin() {
32
34
  const session = await createSession();
@@ -37,8 +39,16 @@ export async function performLogin() {
37
39
  authUrl,
38
40
  createdAt: Date.now(),
39
41
  });
40
- await openURL(authUrl);
41
- process.stderr.write(`\nAuthenticate with Lizard:\n ${chalk.cyan(authUrl)}\n\nOnce authenticated, run your command again.\n\n`);
42
+ // In JSON mode emit the URL as machine-readable output and never spawn a
43
+ // browser agents drive this flow and popping open a browser on a
44
+ // headless/agent host is wrong. In human mode, open it and print the URL.
45
+ if (isJSONMode()) {
46
+ printJSON({ status: "pending", authUrl });
47
+ }
48
+ else {
49
+ await openURL(authUrl);
50
+ process.stderr.write(`\nAuthenticate with Lizard:\n ${chalk.cyan(authUrl)}\n\nOnce authenticated, run your command again.\n\n`);
51
+ }
42
52
  process.exit(0);
43
53
  }
44
54
  export function registerLogin(program) {
@@ -66,7 +76,7 @@ export function registerLogin(program) {
66
76
  avatarUrl: user.avatarUrl,
67
77
  });
68
78
  if (isJSONMode()) {
69
- printJSON({ username: user.username });
79
+ printJSON({ status: "complete", username: user.username });
70
80
  }
71
81
  else {
72
82
  success(`Logged in as ${chalk.bold(user.username)}`);
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,eAAe,EACf,OAAO,EACP,WAAW,GAEZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAmBlE,+CAA+C;AAC/C,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,UAAU,EAAE,uBAAuB,EAAE;QAC9D,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;KAChD,CAAC,CAAC;IACH,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;IAClF,OAAO,GAAG,CAAC,IAAI,EAA8B,CAAC;AAChD,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,SAAiB,EACjB,aAAqB;IAErB,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,UA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AC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;gBAC5D,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,SAAS,EAAE,IAAI,CAAC,SAAS;aAC1B,CAAC,CAAC;YACH,IAAI,UAAU,EAAE,EAAE,CAAC;gBACjB,SAAS,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC7D,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,gBAAgB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YACvD,CAAC;YACD,OAAO;QACT,CAAC;QAED,MAAM,YAAY,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const CURRENT_VERSION = "0.3.58";
1
+ export declare const CURRENT_VERSION = "0.3.59";
2
2
  /**
3
3
  * True only when running as the Bun-compiled standalone binary. Under
4
4
  * npm/node, `process.execPath` is the *node* executable — self-update would
@@ -4,7 +4,7 @@ import { Readable } from "node:stream";
4
4
  import { join, dirname } from "node:path";
5
5
  import os from "node:os";
6
6
  import { spawn } from "node:child_process";
7
- export const CURRENT_VERSION = "0.3.58";
7
+ export const CURRENT_VERSION = "0.3.59";
8
8
  const RELEASES_API = "https://api.github.com/repos/lizard-build/lizard-cli/releases/latest";
9
9
  const RELEASE_BASE = "https://github.com/lizard-build/lizard-cli/releases/latest/download";
10
10
  /** Minimum gap between background update checks. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lizard-build/cli",
3
- "version": "0.3.58",
3
+ "version": "0.3.59",
4
4
  "description": "Lizard CLI — deploy and manage apps on Lizard",
5
5
  "type": "module",
6
6
  "bin": {
@@ -52,9 +52,11 @@ export async function checkSession(
52
52
  }
53
53
 
54
54
  /**
55
- * Start the login flow: creates a session, saves it to disk, opens the
56
- * browser, prints the URL, then exits. The user authenticates in the browser
57
- * and re-runs their original command requireAuth will pick up the session.
55
+ * Start the login flow: creates a session, saves it to disk, surfaces the
56
+ * auth URL, then exits. In human mode it opens the browser and prints the
57
+ * URL; in JSON mode it emits the URL as JSON and never opens a browser. The
58
+ * user authenticates and re-runs their original command — requireAuth will
59
+ * pick up the pending session.
58
60
  */
59
61
  export async function performLogin(): Promise<never> {
60
62
  const session = await createSession();
@@ -67,10 +69,17 @@ export async function performLogin(): Promise<never> {
67
69
  createdAt: Date.now(),
68
70
  });
69
71
 
70
- await openURL(authUrl);
71
- process.stderr.write(
72
- `\nAuthenticate with Lizard:\n ${chalk.cyan(authUrl)}\n\nOnce authenticated, run your command again.\n\n`,
73
- );
72
+ // In JSON mode emit the URL as machine-readable output and never spawn a
73
+ // browser — agents drive this flow and popping open a browser on a
74
+ // headless/agent host is wrong. In human mode, open it and print the URL.
75
+ if (isJSONMode()) {
76
+ printJSON({ status: "pending", authUrl });
77
+ } else {
78
+ await openURL(authUrl);
79
+ process.stderr.write(
80
+ `\nAuthenticate with Lizard:\n ${chalk.cyan(authUrl)}\n\nOnce authenticated, run your command again.\n\n`,
81
+ );
82
+ }
74
83
  process.exit(0);
75
84
  }
76
85
 
@@ -98,7 +107,7 @@ export function registerLogin(program: Command) {
98
107
  avatarUrl: user.avatarUrl,
99
108
  });
100
109
  if (isJSONMode()) {
101
- printJSON({ username: user.username });
110
+ printJSON({ status: "complete", username: user.username });
102
111
  } else {
103
112
  success(`Logged in as ${chalk.bold(user.username)}`);
104
113
  }
@@ -5,7 +5,7 @@ import { join, dirname } from "node:path";
5
5
  import os from "node:os";
6
6
  import { spawn } from "node:child_process";
7
7
 
8
- export const CURRENT_VERSION = "0.3.58";
8
+ export const CURRENT_VERSION = "0.3.59";
9
9
  const RELEASES_API = "https://api.github.com/repos/lizard-build/lizard-cli/releases/latest";
10
10
  const RELEASE_BASE = "https://github.com/lizard-build/lizard-cli/releases/latest/download";
11
11