@viberaven/cli 0.1.0-beta.6 → 0.1.0-beta.7

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/AGENTS.md CHANGED
@@ -36,31 +36,17 @@ npx -y @viberaven/cli@beta scan
36
36
 
37
37
 
38
38
 
39
- If not signed in:
40
-
41
-
42
-
43
- ```bash
44
-
45
- npx -y @viberaven/cli@beta login
46
-
47
- ```
48
-
49
-
50
-
51
- Then scan again. Agents should use `scan` without `--open`; open the report only when the user wants the browser map.
52
-
53
- If scan output says `LOGIN_REQUIRED`, stop and ask the user to complete:
54
-
55
- ```bash
56
- npx -y @viberaven/cli@beta login
57
- ```
58
-
59
- Then rerun:
60
-
61
- ```bash
62
- npx -y @viberaven/cli@beta scan
63
- ```
39
+ If not signed in, `scan` starts VibeRaven sign-in, opens the browser approval page when possible, waits for the user to approve the editor/agent connection, then continues the scan.
40
+
41
+ If the local agent environment cannot open a browser, show the printed `Open:` URL to the user. After approval, rerun `npx -y @viberaven/cli@beta scan`.
42
+
43
+ Manual fallback if the scan flow cannot start login:
44
+
45
+ ```bash
46
+ npx -y @viberaven/cli@beta login
47
+ ```
48
+
49
+ Agents should use `scan` without `--open`; open the report only when the user wants the browser map.
64
50
 
65
51
 
66
52
 
package/README.md CHANGED
@@ -13,21 +13,29 @@ Sign in once, then scan with `--open` to view `.viberaven/report.html` in the br
13
13
 
14
14
  Uses the **same VibeRaven account and scan quota** as the VS Code extension. **Does not use your `OPENAI_API_KEY`** — scans go through the managed API after login. See [SECURITY.md](./SECURITY.md).
15
15
 
16
- ## For coding agents
17
-
18
- Use VibeRaven when the user asks whether an AI-built app is launch-ready, production-ready, or missing auth/database/payments/deployment/security work.
19
-
20
- ```bash
21
- npx -y @viberaven/cli@beta scan
22
- ```
23
-
24
- If output includes `LOGIN_REQUIRED`, ask the user to run:
16
+ ## For coding agents
17
+
18
+ Use VibeRaven when the user asks whether an AI-built app is launch-ready, production-ready, or missing auth/database/payments/deployment/security work.
25
19
 
26
20
  ```bash
27
- npx -y @viberaven/cli@beta login
28
- ```
29
-
30
- After login, run scan. Read `.viberaven/agent-summary.md` and `.viberaven/launch-playbook.md`. Loop:
21
+ npx -y @viberaven/cli@beta scan
22
+ ```
23
+
24
+ If login is missing, `scan` starts VibeRaven sign-in, opens the browser approval page when possible, waits for the user to approve the connection, then continues the scan.
25
+
26
+ If the local agent environment cannot open a browser, show the printed `Open:` URL to the user. After they approve it, rerun:
27
+
28
+ ```bash
29
+ npx -y @viberaven/cli@beta scan
30
+ ```
31
+
32
+ Manual fallback:
33
+
34
+ ```bash
35
+ npx -y @viberaven/cli@beta login
36
+ ```
37
+
38
+ Read `.viberaven/agent-summary.md` and `.viberaven/launch-playbook.md`. Loop:
31
39
 
32
40
  1. `viberaven next --json`
33
41
  2. Repo fix → `viberaven prompt --gap <id>` → implement → `viberaven report` (free) or `scan`
@@ -1,5 +1,5 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" aria-hidden="true">
2
- <path fill="#412991" d="M32 5 11 16.8v13.7c0 12.2 8.9 23.3 21 27 12.1-3.7 21-14.8 21-27V16.8L32 5Z"/>
3
- <path fill="#EB5424" d="M32 5v48.7c-3.1-1.1-6.1-2.7-8.7-4.7L32 5Z"/>
4
- <path fill="#FBC22C" d="m32 5 8.7 44c-2.6 2-5.6 3.6-8.7 4.7V5Z"/>
5
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" aria-hidden="true">
2
+ <path fill="#412991" d="M32 5 11 16.8v13.7c0 12.2 8.9 23.3 21 27 12.1-3.7 21-14.8 21-27V16.8L32 5Z"/>
3
+ <path fill="#EB5424" d="M32 5v48.7c-3.1-1.1-6.1-2.7-8.7-4.7L32 5Z"/>
4
+ <path fill="#FBC22C" d="m32 5 8.7 44c-2.6 2-5.6 3.6-8.7 4.7V5Z"/>
5
+ </svg>
@@ -1,5 +1,5 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 64" aria-hidden="true">
2
- <text x="48" y="31" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="21" font-weight="800" letter-spacing="-1.4" fill="#111827">AWS</text>
3
- <path fill="#FF9900" d="M23.6 42.4c13.9 7.5 31.5 7.5 45.1-.1 1.1-.6 2.2.8 1.3 1.7-12.3 12.5-34.3 12.6-47.2.8-.9-.8-.3-2.9.8-2.4Z"/>
4
- <path fill="#FF9900" d="M66.8 39.8c2.4-.3 7.8-.8 8.8 1 .9 1.6-1 5.8-2.5 8.2-.5.8-1.7.4-1.5-.6.5-2.1 1.3-4.8.5-5.8-.8-1-3.8-.8-5.4-.6-1 .1-1.2-2-.1-2.2h.2Z"/>
5
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 64" aria-hidden="true">
2
+ <text x="48" y="31" text-anchor="middle" font-family="Arial, Helvetica, sans-serif" font-size="21" font-weight="800" letter-spacing="-1.4" fill="#111827">AWS</text>
3
+ <path fill="#FF9900" d="M23.6 42.4c13.9 7.5 31.5 7.5 45.1-.1 1.1-.6 2.2.8 1.3 1.7-12.3 12.5-34.3 12.6-47.2.8-.9-.8-.3-2.9.8-2.4Z"/>
4
+ <path fill="#FF9900" d="M66.8 39.8c2.4-.3 7.8-.8 8.8 1 .9 1.6-1 5.8-2.5 8.2-.5.8-1.7.4-1.5-.6.5-2.1 1.3-4.8.5-5.8-.8-1-3.8-.8-5.4-.6-1 .1-1.2-2-.1-2.2h.2Z"/>
5
+ </svg>
@@ -1,4 +1,4 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" aria-hidden="true">
2
- <path fill="#764ABC" fill-rule="evenodd" clip-rule="evenodd" d="M26.8 12.9A20.8 20.8 0 0 1 32.3 7a20.5 20.5 0 0 1 5.5 5.8 29.3 29.3 0 0 1 5.1 17.1c1.1.9 2.3 1.8 3.4 2.7a6.2 6.2 0 0 1 2 5.7c-.5 2.6-1.1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 3.2-.6.6-1.2 1-1.9 1.4a2.2 2.2 0 0 1-2.9-1.4c-.6-2.5-1.2-5.1-1.8-7.6a6.3 6.3 0 0 1 2.1-6c1-.8 2-1.6 3-2.3.3-.2.1-.5.2-.7a29.3 29.3 0 0 1 5.2-16.5Zm2.2 8.2a4.3 4.3 0 0 0 .4 5.8 4.8 4.8 0 0 0 6.5.1 4.3 4.3 0 0 0 1.1-4.8 4.4 4.4 0 0 0-3.9-2.9 4.5 4.5 0 0 0-4.1 1.8Zm3.3 4.9a2.1 2.1 0 1 0 0-4.2 2.1 2.1 0 0 0 0 4.2Z"/>
3
+ <path fill="#764ABC" d="M26.4 48.1a1.1 1.1 0 0 1 1.6-.9 10.4 10.4 0 0 0 9 0 1.1 1.1 0 0 1 1.6.8v4.8a1.1 1.1 0 0 1-1.7.8c-.5-.4-.9-.9-1.4-1.3-.7 1.4-1.4 2.8-2.1 4.1a1.1 1.1 0 0 1-1.8 0c-.8-1.4-1.4-2.8-2.2-4.1-.4.4-.9.9-1.3 1.3a1.1 1.1 0 0 1-1.7-.8v-4.7Z"/>
4
+ </svg>
package/dist/cli.js CHANGED
@@ -31,9 +31,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
31
  ));
32
32
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
33
 
34
- // node_modules/picocolors/picocolors.js
34
+ // ../../node_modules/picocolors/picocolors.js
35
35
  var require_picocolors = __commonJS({
36
- "node_modules/picocolors/picocolors.js"(exports2, module2) {
36
+ "../../node_modules/picocolors/picocolors.js"(exports2, module2) {
37
37
  var p2 = process || {};
38
38
  var argv = p2.argv || [];
39
39
  var env = p2.env || {};
@@ -103,9 +103,9 @@ var require_picocolors = __commonJS({
103
103
  }
104
104
  });
105
105
 
106
- // node_modules/sisteransi/src/index.js
106
+ // ../../node_modules/sisteransi/src/index.js
107
107
  var require_src = __commonJS({
108
- "node_modules/sisteransi/src/index.js"(exports2, module2) {
108
+ "../../node_modules/sisteransi/src/index.js"(exports2, module2) {
109
109
  "use strict";
110
110
  var ESC = "\x1B";
111
111
  var CSI = `${ESC}[`;
@@ -163,7 +163,8 @@ var require_src = __commonJS({
163
163
  var cli_exports = {};
164
164
  __export(cli_exports, {
165
165
  formatScanJsonStdout: () => formatScanJsonStdout,
166
- parseArgs: () => parseArgs
166
+ parseArgs: () => parseArgs,
167
+ runScanCommand: () => runScanCommand
167
168
  });
168
169
  module.exports = __toCommonJS(cli_exports);
169
170
  var import_node_path12 = require("node:path");
@@ -506,6 +507,8 @@ var BackendHttpError = class extends Error {
506
507
  this.status = status;
507
508
  this.upgradeUrl = upgradeUrl;
508
509
  }
510
+ status;
511
+ upgradeUrl;
509
512
  };
510
513
  function isNonEmptyString(value) {
511
514
  return typeof value === "string" && value.trim().length > 0;
@@ -589,6 +592,44 @@ function formatScanLimitMessage(upgradeUrl) {
589
592
  ].join("\n");
590
593
  }
591
594
 
595
+ // src/openBrowser.ts
596
+ var import_node_child_process = require("node:child_process");
597
+ async function openWithSystemDefault(target) {
598
+ let command;
599
+ let args;
600
+ if (process.platform === "win32") {
601
+ command = "cmd";
602
+ args = ["/c", "start", "", target];
603
+ } else if (process.platform === "darwin") {
604
+ command = "open";
605
+ args = [target];
606
+ } else {
607
+ command = "xdg-open";
608
+ args = [target];
609
+ }
610
+ await new Promise((resolve4, reject) => {
611
+ const child = (0, import_node_child_process.spawn)(command, args, { stdio: "ignore", shell: process.platform === "win32" });
612
+ child.on("error", reject);
613
+ child.on("exit", (code) => {
614
+ if (code === 0) {
615
+ resolve4();
616
+ } else {
617
+ reject(new Error(`Could not open browser (exit ${code ?? "unknown"}). Open manually: ${target}`));
618
+ }
619
+ });
620
+ });
621
+ }
622
+ async function openPathInBrowser(filePath) {
623
+ await openWithSystemDefault(filePath);
624
+ }
625
+ async function openUrlInBrowser(url) {
626
+ const trimmed = url.trim();
627
+ if (!/^https?:\/\//i.test(trimmed)) {
628
+ throw new Error(`Not a valid http(s) URL: ${url}`);
629
+ }
630
+ await openWithSystemDefault(trimmed);
631
+ }
632
+
592
633
  // src/auth.ts
593
634
  function sleep(ms) {
594
635
  return new Promise((resolve4) => setTimeout(resolve4, ms));
@@ -600,6 +641,12 @@ async function runDeviceLogin(apiBaseUrl) {
600
641
  console.log(`Open: ${verificationUrl}`);
601
642
  console.log(`Code: ${signIn.deviceCode}
602
643
  `);
644
+ try {
645
+ await openUrlInBrowser(verificationUrl);
646
+ console.log("Opened the VibeRaven approval page in your browser.");
647
+ } catch (error) {
648
+ console.warn(error instanceof Error ? error.message : String(error));
649
+ }
603
650
  console.log("Waiting for approval in the browser\u2026\n");
604
651
  const expiresAt = Date.parse(signIn.expiresAt);
605
652
  const pollMs = Math.max(2, signIn.pollIntervalSeconds) * 1e3;
@@ -11319,44 +11366,6 @@ async function refreshReportFromDisk(startDir) {
11319
11366
  return writeScanArtifacts({ artifact, cwd: workspace });
11320
11367
  }
11321
11368
 
11322
- // src/openBrowser.ts
11323
- var import_node_child_process = require("node:child_process");
11324
- async function openWithSystemDefault(target) {
11325
- let command;
11326
- let args;
11327
- if (process.platform === "win32") {
11328
- command = "cmd";
11329
- args = ["/c", "start", "", target];
11330
- } else if (process.platform === "darwin") {
11331
- command = "open";
11332
- args = [target];
11333
- } else {
11334
- command = "xdg-open";
11335
- args = [target];
11336
- }
11337
- await new Promise((resolve4, reject) => {
11338
- const child = (0, import_node_child_process.spawn)(command, args, { stdio: "ignore", shell: process.platform === "win32" });
11339
- child.on("error", reject);
11340
- child.on("exit", (code) => {
11341
- if (code === 0) {
11342
- resolve4();
11343
- } else {
11344
- reject(new Error(`Could not open browser (exit ${code ?? "unknown"}). Open manually: ${target}`));
11345
- }
11346
- });
11347
- });
11348
- }
11349
- async function openPathInBrowser(filePath) {
11350
- await openWithSystemDefault(filePath);
11351
- }
11352
- async function openUrlInBrowser(url) {
11353
- const trimmed = url.trim();
11354
- if (!/^https?:\/\//i.test(trimmed)) {
11355
- throw new Error(`Not a valid http(s) URL: ${url}`);
11356
- }
11357
- await openWithSystemDefault(trimmed);
11358
- }
11359
-
11360
11369
  // src/clipboard.ts
11361
11370
  var import_node_child_process2 = require("node:child_process");
11362
11371
  async function copyToClipboard(text) {
@@ -12435,7 +12444,7 @@ function isRecord6(value) {
12435
12444
  // src/tui/runInteractive.ts
12436
12445
  var import_node_path10 = require("node:path");
12437
12446
 
12438
- // node_modules/@clack/core/dist/index.mjs
12447
+ // ../../node_modules/@clack/core/dist/index.mjs
12439
12448
  var import_sisteransi = __toESM(require_src(), 1);
12440
12449
  var import_node_process = require("node:process");
12441
12450
  var g = __toESM(require("node:readline"), 1);
@@ -12642,7 +12651,7 @@ function BD(e2, u2) {
12642
12651
  return s;
12643
12652
  }
12644
12653
  var AD = globalThis.process.platform.startsWith("win");
12645
- var S = Symbol("clack:cancel");
12654
+ var S = /* @__PURE__ */ Symbol("clack:cancel");
12646
12655
  function pD(e2) {
12647
12656
  return e2 === S;
12648
12657
  }
@@ -12793,7 +12802,7 @@ var LD = class extends x {
12793
12802
  }
12794
12803
  };
12795
12804
 
12796
- // node_modules/@clack/prompts/dist/index.mjs
12805
+ // ../../node_modules/@clack/prompts/dist/index.mjs
12797
12806
  var import_node_process2 = __toESM(require("node:process"), 1);
12798
12807
  var import_picocolors2 = __toESM(require_picocolors(), 1);
12799
12808
  var import_sisteransi2 = __toESM(require_src(), 1);
@@ -12969,7 +12978,7 @@ var Y2 = ({ indicator: t = "dots" } = {}) => {
12969
12978
  var import_picocolors4 = __toESM(require_picocolors());
12970
12979
 
12971
12980
  // src/version.ts
12972
- var VERSION = "0.1.0-beta.6";
12981
+ var VERSION = "0.1.0-beta.7";
12973
12982
 
12974
12983
  // src/commands/guide.ts
12975
12984
  var import_picocolors3 = __toESM(require_picocolors());
@@ -13457,6 +13466,8 @@ Agent workflow (Claude Code / Codex):
13457
13466
 
13458
13467
  npx -y @viberaven/cli@beta scan
13459
13468
 
13469
+ If login is missing, scan opens the VibeRaven approval page and continues after approval.
13470
+
13460
13471
  Read .viberaven/agent-summary.md and .viberaven/launch-playbook.md
13461
13472
 
13462
13473
  viberaven next --json \u2192 guide/open \u2192 scan again
@@ -13531,6 +13542,9 @@ async function cmdLogout() {
13531
13542
  await clearCredentials();
13532
13543
  console.log("Signed out.");
13533
13544
  }
13545
+ function isLoginRequiredError(error) {
13546
+ return error instanceof Error && error.message.includes(LOGIN_REQUIRED);
13547
+ }
13534
13548
  async function cmdStatus(flags, positional) {
13535
13549
  const creds = await loadCredentials();
13536
13550
  if (!creds?.accessToken) {
@@ -13690,15 +13704,27 @@ async function cmdWatch(flags) {
13690
13704
  return 1;
13691
13705
  }
13692
13706
  }
13693
- async function cmdScan(flags, positional) {
13707
+ async function runScanCommand(flags, positional) {
13694
13708
  const workspacePath = positional[0] ? (0, import_node_path12.join)(process.cwd(), positional[0]) : await resolveWorkspaceRoot(process.cwd());
13695
13709
  const apiBaseUrl = resolveApiBaseUrl(typeof flags["api-url"] === "string" ? flags["api-url"] : void 0);
13696
13710
  let accessToken;
13697
13711
  try {
13698
13712
  ({ accessToken } = await requireCredentials(apiBaseUrl));
13699
13713
  } catch (error) {
13700
- console.error(error instanceof Error ? error.message : String(error));
13701
- return 1;
13714
+ if (!flags.json && isLoginRequiredError(error)) {
13715
+ console.error(error instanceof Error ? error.message : String(error));
13716
+ console.log("\nStarting VibeRaven sign-in so this scan can continue...\n");
13717
+ try {
13718
+ await runDeviceLogin(apiBaseUrl);
13719
+ ({ accessToken } = await requireCredentials(apiBaseUrl));
13720
+ } catch (loginError) {
13721
+ console.error(loginError instanceof Error ? loginError.message : String(loginError));
13722
+ return 1;
13723
+ }
13724
+ } else {
13725
+ console.error(error instanceof Error ? error.message : String(error));
13726
+ return 1;
13727
+ }
13702
13728
  }
13703
13729
  console.log(`Scanning ${workspacePath}\u2026`);
13704
13730
  const result = await runProjectScan({ workspacePath, accessToken, apiBaseUrl });
@@ -13901,7 +13927,7 @@ async function main() {
13901
13927
  case "watch":
13902
13928
  return cmdWatch(flags);
13903
13929
  case "scan":
13904
- return cmdScan(flags, positional);
13930
+ return runScanCommand(flags, positional);
13905
13931
  case "report":
13906
13932
  return cmdReport(flags, positional);
13907
13933
  case "prompt":
@@ -13927,6 +13953,7 @@ if (require.main === module) {
13927
13953
  // Annotate the CommonJS export names for ESM import in node:
13928
13954
  0 && (module.exports = {
13929
13955
  formatScanJsonStdout,
13930
- parseArgs
13956
+ parseArgs,
13957
+ runScanCommand
13931
13958
  });
13932
13959
  //# sourceMappingURL=cli.js.map