@aiready/cli 0.14.10 → 0.14.11

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.
@@ -1,28 +1,29 @@
1
-
2
- > @aiready/cli@0.14.10 build /Users/pengcao/projects/aiready/packages/cli
3
- > tsup src/index.ts src/cli.ts --format cjs,esm
4
-
5
- CLI Building entry: src/cli.ts, src/index.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.5.1
8
- CLI Target: es2020
9
- CJS Build start
10
- ESM Build start
11
-
12
- WARN ▲ [WARNING] "import.meta" is not available with the "cjs" output format and will be empty [empty-import-meta]
13
-
14
- src/cli.ts:29:31:
15
-  29 │ return dirname(fileURLToPath(import.meta.url));
16
- ~~~~~~~~~~~
17
-
18
- You need to set the output format to "esm" for "import.meta" to work correctly.
19
-
20
-
21
-
22
- CJS dist/cli.js 84.95 KB
23
- CJS dist/index.js 10.87 KB
24
- CJS ⚡️ Build success in 42ms
25
- ESM dist/index.mjs 170.00 B
26
- ESM dist/chunk-JRRBBFYB.mjs 9.77 KB
27
- ESM dist/cli.mjs 70.91 KB
28
- ESM ⚡️ Build success in 42ms
1
+
2
+ 
3
+ > @aiready/cli@0.14.11 build /Users/pengcao/projects/aiready/packages/cli
4
+ > tsup src/index.ts src/cli.ts --format cjs,esm
5
+
6
+ CLI Building entry: src/cli.ts, src/index.ts
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.5.1
9
+ CLI Target: es2020
10
+ CJS Build start
11
+ ESM Build start
12
+
13
+  WARN  ▲ [WARNING] "import.meta" is not available with the "cjs" output format and will be empty [empty-import-meta] 11:51:54 pm
14
+
15
+ src/cli.ts:29:31:
16
+  29 │ return dirname(fileURLToPath(import.meta.url));
17
+ ╵ ~~~~~~~~~~~
18
+
19
+ You need to set the output format to "esm" for "import.meta" to work correctly.
20
+
21
+
22
+
23
+ CJS dist/index.js 10.87 KB
24
+ CJS dist/cli.js 88.48 KB
25
+ CJS ⚡️ Build success in 39ms
26
+ ESM dist/index.mjs 170.00 B
27
+ ESM dist/cli.mjs 74.23 KB
28
+ ESM dist/chunk-JRRBBFYB.mjs 9.77 KB
29
+ ESM ⚡️ Build success in 39ms
@@ -1,74 +1,76 @@
1
-
2
- > @aiready/cli@0.14.9 test /Users/pengcao/projects/aiready/packages/cli
3
- > vitest run
4
-
5
-
6
-  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/cli
7
-
8
- stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should generate HTML from specified report
9
- Building graph from report...
10
-
11
- ✓ src/commands/__tests__/agent-grounding.test.ts (1 test) 11ms
12
- ✓ src/commands/__tests__/testability.test.ts (2 tests) 12ms
13
- stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should generate HTML from specified report
14
- Generating HTML...
15
- Visualization written to: /Users/pengcao/projects/aiready/packages/cli/visualization.html
16
-
17
- stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should find latest report if none specified
18
- Found latest report: latest.json
19
- Building graph from report...
20
-
21
- stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should find latest report if none specified
22
- Generating HTML...
23
- Visualization written to: /Users/pengcao/projects/aiready/packages/cli/visualization.html
24
-
25
- stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should handle missing reports
26
- 
27
- Generate a report with:
28
- aiready scan --output json
29
-
30
- Or specify a custom report:
31
- aiready visualise --report <path-to-report.json>
32
-
33
- stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should attempt to open visualization if requested
34
- Building graph from report...
35
-
36
- stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should attempt to open visualization if requested
37
- Generating HTML...
38
- Visualization written to: /Users/pengcao/projects/aiready/packages/cli/visualization.html
39
-
40
- ✓ src/commands/__tests__/doc-drift.test.ts (1 test) 7ms
41
- ✓ src/commands/__tests__/ai-signal-clarity.test.ts (1 test) 8ms
42
- ✓ src/commands/__tests__/visualize.test.ts (4 tests) 27ms
43
- ✓ src/commands/__tests__/deps-health.test.ts (1 test) 9ms
44
- stdout | src/commands/__tests__/upload.test.ts > Upload CLI Action > should fail if API key is missing
45
-  Set AIREADY_API_KEY environment variable or use --api-key flag.
46
- Get an API key from https://platform.getaiready.dev/dashboard
47
- 🚀 Uploading report to https://dev.platform.getaiready.dev...
48
- Reading report from /Users/pengcao/projects/aiready/packages/cli/report.json...
49
- Successfully parsed report JSON.
50
-
51
- stdout | src/commands/__tests__/upload.test.ts > Upload CLI Action > should fail if API key is missing
52
- 
53
- ✅ Upload successful! (0.00s)
54
- View results: https://dev.platform.getaiready.dev/dashboard
55
- Analysis ID: 123
56
- Score: 80/100
57
-
58
- ✓ src/commands/__tests__/upload.test.ts (2 tests) 4ms
59
- ✓ src/utils/__tests__/helpers.test.ts (3 tests) 2ms
60
- ✓ src/commands/__tests__/init.test.ts (3 tests) 5ms
61
- ✓ src/commands/__tests__/consistency.test.ts (4 tests) 4ms
62
- ✓ src/commands/__tests__/scan.test.ts (6 tests) 94ms
63
- ✓ src/commands/__tests__/extra-commands.test.ts (8 tests) 122ms
64
- ✓ src/__tests__/unified.test.ts (4 tests) 3ms
65
- ✓ src/__tests__/cli.test.ts (3 tests) 4113ms
66
- ✓ should run unified analysis with both tools  4112ms
67
- ✓ src/__tests__/config-shape.test.ts (3 tests) 4113ms
68
- ✓ should generate a strictly portable AIReadyConfig in summary  4112ms
69
-
70
-  Test Files  15 passed (15)
71
-  Tests  46 passed (46)
72
-  Start at  15:39:46
73
-  Duration  5.18s (transform 2.58s, setup 0ms, import 5.99s, tests 8.53s, environment 2ms)
74
-
1
+
2
+ 
3
+ > @aiready/cli@0.14.10 test /Users/pengcao/projects/aiready/packages/cli
4
+ > vitest run
5
+
6
+ [?25l
7
+  RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/cli
8
+
9
+ ✓ src/commands/__tests__/testability.test.ts (2 tests) 15ms
10
+ stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should generate HTML from specified report
11
+ Building graph from report...
12
+
13
+ ✓ src/commands/__tests__/agent-grounding.test.ts (1 test) 18ms
14
+ stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should generate HTML from specified report
15
+ Generating HTML...
16
+ ✅ Visualization written to: /Users/pengcao/projects/aiready/packages/cli/visualization.html
17
+
18
+ stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should find latest report if none specified
19
+ Found latest report: latest.json
20
+ Building graph from report...
21
+
22
+ stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should find latest report if none specified
23
+ Generating HTML...
24
+ ✅ Visualization written to: /Users/pengcao/projects/aiready/packages/cli/visualization.html
25
+
26
+ stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should handle missing reports
27
+ 
28
+ Generate a report with:
29
+ aiready scan --output json
30
+
31
+ Or specify a custom report:
32
+ aiready visualise --report <path-to-report.json>
33
+
34
+ stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should attempt to open visualization if requested
35
+ Building graph from report...
36
+
37
+ stdout | src/commands/__tests__/visualize.test.ts > Visualize CLI Action > should attempt to open visualization if requested
38
+ Generating HTML...
39
+ ✅ Visualization written to: /Users/pengcao/projects/aiready/packages/cli/visualization.html
40
+
41
+ ✓ src/commands/__tests__/visualize.test.ts (4 tests) 28ms
42
+ ✓ src/commands/__tests__/doc-drift.test.ts (1 test) 7ms
43
+ ✓ src/commands/__tests__/ai-signal-clarity.test.ts (1 test) 9ms
44
+ ✓ src/commands/__tests__/deps-health.test.ts (1 test) 8ms
45
+ stdout | src/commands/__tests__/upload.test.ts > Upload CLI Action > should fail if API key is missing
46
+  Set AIREADY_API_KEY environment variable or use --api-key flag.
47
+ Get an API key from https://platform.getaiready.dev/dashboard
48
+ 🚀 Uploading report to https://dev.platform.getaiready.dev...
49
+ Reading report from /Users/pengcao/projects/aiready/packages/cli/report.json...
50
+ Successfully parsed report JSON.
51
+
52
+ stdout | src/commands/__tests__/upload.test.ts > Upload CLI Action > should fail if API key is missing
53
+ 
54
+ Upload successful! (0.00s)
55
+ View results: https://dev.platform.getaiready.dev/dashboard
56
+ Analysis ID: 123
57
+ Score: 80/100
58
+
59
+ ✓ src/commands/__tests__/upload.test.ts (2 tests) 4ms
60
+ ✓ src/utils/__tests__/helpers.test.ts (3 tests) 2ms
61
+ ✓ src/commands/__tests__/init.test.ts (2 tests) 4ms
62
+ ✓ src/commands/__tests__/consistency.test.ts (4 tests) 4ms
63
+ ✓ src/commands/__tests__/scan.test.ts (6 tests) 79ms
64
+ ✓ src/commands/__tests__/extra-commands.test.ts (8 tests) 125ms
65
+ ✓ src/__tests__/unified.test.ts (4 tests) 3ms
66
+ ✓ src/__tests__/cli.test.ts (3 tests) 2817ms
67
+ ✓ should run unified analysis with both tools  2816ms
68
+ ✓ src/__tests__/config-shape.test.ts (3 tests) 2818ms
69
+ ✓ should generate a strictly portable AIReadyConfig in summary  2816ms
70
+
71
+  Test Files  15 passed (15)
72
+  Tests  45 passed (45)
73
+  Start at  23:50:23
74
+  Duration  3.75s (transform 2.06s, setup 0ms, import 4.86s, tests 5.94s, environment 1ms)
75
+
76
+ [?25h
package/dist/cli.js CHANGED
@@ -394,13 +394,91 @@ function generateMarkdownReport(report, elapsedTime) {
394
394
  // src/commands/report-formatter.ts
395
395
  var import_chalk2 = __toESM(require("chalk"));
396
396
  var import_core4 = require("@aiready/core");
397
+ function generateProgressBar(score, width = 20) {
398
+ const filled = Math.round(score / 100 * width);
399
+ const empty = width - filled;
400
+ let color = import_chalk2.default.red;
401
+ if (score >= 90) color = import_chalk2.default.green;
402
+ else if (score >= 75) color = import_chalk2.default.cyan;
403
+ else if (score >= 60) color = import_chalk2.default.yellow;
404
+ const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
405
+ return color(bar);
406
+ }
407
+ function countIssuesBySeverity(results) {
408
+ let critical = 0;
409
+ let major = 0;
410
+ let minor = 0;
411
+ if (results.summary?.toolsRun) {
412
+ for (const toolId of results.summary.toolsRun) {
413
+ const toolRes = results[toolId];
414
+ if (toolRes?.results) {
415
+ for (const fileRes of toolRes.results) {
416
+ if (fileRes.issues) {
417
+ for (const issue of fileRes.issues) {
418
+ const sev = issue.severity?.toLowerCase();
419
+ if (sev === "critical") critical++;
420
+ else if (sev === "major") major++;
421
+ else minor++;
422
+ }
423
+ }
424
+ }
425
+ }
426
+ }
427
+ }
428
+ return { critical, major, minor };
429
+ }
430
+ function getTopFilesWithIssues(results, limit = 5) {
431
+ const fileCounts = /* @__PURE__ */ new Map();
432
+ if (results.summary?.toolsRun) {
433
+ for (const toolId of results.summary.toolsRun) {
434
+ const toolRes = results[toolId];
435
+ if (toolRes?.results) {
436
+ for (const fileRes of toolRes.results) {
437
+ if (fileRes.issues?.length > 0) {
438
+ const current = fileCounts.get(fileRes.fileName) || 0;
439
+ fileCounts.set(fileRes.fileName, current + fileRes.issues.length);
440
+ }
441
+ }
442
+ }
443
+ }
444
+ }
445
+ return Array.from(fileCounts.entries()).map(([file, count]) => ({ file, count })).sort((a, b) => b.count - a.count).slice(0, limit);
446
+ }
397
447
  function printScanSummary(results, startTime) {
448
+ const severity = countIssuesBySeverity(results);
449
+ const totalIssues = severity.critical + severity.major + severity.minor;
450
+ const topFiles = getTopFilesWithIssues(results);
398
451
  console.log(import_chalk2.default.cyan("\n=== AIReady Run Summary ==="));
452
+ console.log(` Total issues: ${import_chalk2.default.bold(String(totalIssues))}`);
453
+ if (totalIssues > 0) {
454
+ console.log(import_chalk2.default.dim(" Severity breakdown:"));
455
+ if (severity.critical > 0) {
456
+ console.log(
457
+ ` ${import_chalk2.default.red("\u25CF")} Critical: ${import_chalk2.default.bold(severity.critical)}`
458
+ );
459
+ }
460
+ if (severity.major > 0) {
461
+ console.log(
462
+ ` ${import_chalk2.default.yellow("\u25CF")} Major: ${import_chalk2.default.bold(severity.major)}`
463
+ );
464
+ }
465
+ if (severity.minor > 0) {
466
+ console.log(
467
+ ` ${import_chalk2.default.blue("\u25CF")} Minor: ${import_chalk2.default.bold(severity.minor)}`
468
+ );
469
+ }
470
+ }
471
+ if (topFiles.length > 0) {
472
+ console.log(import_chalk2.default.dim("\n Top files with issues:"));
473
+ topFiles.forEach((item) => {
474
+ console.log(
475
+ ` ${import_chalk2.default.yellow("\u2192")} ${item.file}: ${import_chalk2.default.bold(item.count)} issues`
476
+ );
477
+ });
478
+ }
399
479
  console.log(
400
- ` Total issues (all tools): ${import_chalk2.default.bold(String(results.summary.totalIssues ?? 0))}`
401
- );
402
- console.log(
403
- ` Execution time: ${import_chalk2.default.bold(((Date.now() - startTime) / 1e3).toFixed(2) + "s")}`
480
+ `
481
+ Execution time: ${import_chalk2.default.bold(((Date.now() - startTime) / 1e3).toFixed(2) + "s")}`
404
482
  );
405
483
  }
406
484
  function printBusinessImpact(roi, unifiedBudget) {
@@ -427,13 +505,14 @@ function printScoring(scoringResult, scoringProfile) {
427
505
  scoringResult.breakdown.forEach((tool) => {
428
506
  const rating = (0, import_core4.getRating)(tool.score);
429
507
  const emoji = (0, import_core4.getRatingDisplay)(rating).emoji;
508
+ const progressBar = generateProgressBar(tool.score, 15);
430
509
  console.log(
431
- ` - ${tool.toolName}: ${tool.score}/100 (${rating}) ${emoji}`
510
+ ` ${progressBar} ${tool.score}/100 (${rating}) ${emoji} ${tool.toolName}`
432
511
  );
433
512
  });
434
513
  const allRecs = scoringResult.breakdown.flatMap(
435
514
  (t) => (t.recommendations ?? []).map((r) => ({ ...r, tool: t.toolName }))
436
- ).sort((a, b) => b.estimatedImpact - a.estimatedImpact).slice(0, 3);
515
+ ).sort((a, b) => b.estimatedImpact - a.estimatedImpact).slice(0, 5);
437
516
  if (allRecs.length > 0) {
438
517
  console.log(import_chalk2.default.bold("\n\u{1F3AF} Top Actionable Recommendations:"));
439
518
  allRecs.forEach((rec, i) => {
@@ -917,6 +996,9 @@ async function initAction(options) {
917
996
  process.exit(1);
918
997
  }
919
998
  const baseConfig = {
999
+ // Target quality score threshold (0-100)
1000
+ threshold: 75,
1001
+ // Global scan settings
920
1002
  scan: {
921
1003
  include: [
922
1004
  "src/**/*.ts",
@@ -943,6 +1025,17 @@ async function initAction(options) {
943
1025
  import_core7.ToolName.ChangeAmplification
944
1026
  ]
945
1027
  },
1028
+ // Output preferences
1029
+ output: {
1030
+ format: "console",
1031
+ showBreakdown: true,
1032
+ saveTo: "aiready-report.json"
1033
+ },
1034
+ // Scoring profile and weights
1035
+ scoring: {
1036
+ profile: "balanced"
1037
+ },
1038
+ // Tool-specific configurations
946
1039
  tools: {
947
1040
  [import_core7.ToolName.PatternDetect]: {
948
1041
  minSimilarity: 0.8,
@@ -966,7 +1059,33 @@ async function initAction(options) {
966
1059
  },
967
1060
  [import_core7.ToolName.NamingConsistency]: {
968
1061
  shortWords: ["id", "db", "ui", "ai"],
969
- ...options.full ? { acceptedAbbreviations: [], disableChecks: [] } : {}
1062
+ acceptedAbbreviations: [
1063
+ "API",
1064
+ "JSON",
1065
+ "CSV",
1066
+ "HTML",
1067
+ "CSS",
1068
+ "HTTP",
1069
+ "URL",
1070
+ "SDK",
1071
+ "CLI",
1072
+ "AI",
1073
+ "ML",
1074
+ "ID",
1075
+ "DB",
1076
+ "UI",
1077
+ "UX",
1078
+ "DOM",
1079
+ "UUID",
1080
+ "GUID",
1081
+ "DEFAULT",
1082
+ "MAX",
1083
+ "MIN",
1084
+ "config",
1085
+ "INIT",
1086
+ "SKILL"
1087
+ ],
1088
+ ...options.full ? { disableChecks: [] } : {}
970
1089
  },
971
1090
  [import_core7.ToolName.AiSignalClarity]: {
972
1091
  checkMagicLiterals: true,
@@ -975,48 +1094,42 @@ async function initAction(options) {
975
1094
  checkUndocumentedExports: true,
976
1095
  ...options.full ? { checkImplicitSideEffects: false, checkDeepCallbacks: false } : {}
977
1096
  },
978
- ...options.full ? {
979
- [import_core7.ToolName.AgentGrounding]: {
980
- maxRecommendedDepth: 5,
981
- readmeStaleDays: 30
982
- },
983
- [import_core7.ToolName.TestabilityIndex]: {
984
- minCoverageRatio: 0.7,
985
- testPatterns: ["**/*.test.ts", "**/__tests__/**"]
986
- },
987
- [import_core7.ToolName.DocDrift]: {
988
- maxCommits: 50,
989
- staleMonths: 3
990
- },
991
- [import_core7.ToolName.DependencyHealth]: {
992
- trainingCutoffYear: 2023
993
- }
994
- } : {}
995
- },
996
- scoring: {
997
- threshold: 70,
998
- showBreakdown: true,
999
- ...options.full ? { profile: "default" } : {}
1097
+ [import_core7.ToolName.AgentGrounding]: {
1098
+ maxRecommendedDepth: 5,
1099
+ readmeStaleDays: 30
1100
+ },
1101
+ [import_core7.ToolName.TestabilityIndex]: {
1102
+ minCoverageRatio: 0.7,
1103
+ testPatterns: ["**/*.test.ts", "**/__tests__/**"]
1104
+ },
1105
+ [import_core7.ToolName.DocDrift]: {
1106
+ maxCommits: 50,
1107
+ staleMonths: 3
1108
+ },
1109
+ [import_core7.ToolName.DependencyHealth]: {
1110
+ trainingCutoffYear: 2023
1111
+ },
1112
+ [import_core7.ToolName.ChangeAmplification]: {
1113
+ // No specific options yet, uses global scan settings
1114
+ }
1000
1115
  },
1001
- ...options.full ? {
1002
- visualizer: {
1003
- groupingDirs: ["packages", "src", "lib"],
1004
- graph: {
1005
- maxNodes: 5e3,
1006
- maxEdges: 1e4
1007
- }
1116
+ // Visualizer settings (interactive graph)
1117
+ visualizer: {
1118
+ groupingDirs: ["packages", "src", "lib"],
1119
+ graph: {
1120
+ maxNodes: 5e3,
1121
+ maxEdges: 1e4
1008
1122
  }
1009
- } : {}
1123
+ }
1010
1124
  };
1011
1125
  const defaultConfig = baseConfig;
1012
1126
  let content;
1013
1127
  if (fileExt === "js") {
1014
- content = `/** @type {import('@aiready/core').AIReadyConfig} */
1015
- module.exports = ${JSON.stringify(
1016
- defaultConfig,
1017
- null,
1018
- 2
1019
- )};
1128
+ content = `/**
1129
+ * AIReady Configuration
1130
+ * @type {import('@aiready/core').AIReadyConfig}
1131
+ */
1132
+ module.exports = ${JSON.stringify(defaultConfig, null, 2)};
1020
1133
  `;
1021
1134
  } else {
1022
1135
  content = JSON.stringify(defaultConfig, null, 2);