@aiready/cli 0.13.0 → 0.13.2

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/src/cli.ts CHANGED
@@ -95,7 +95,7 @@ program
95
95
  )
96
96
  .option(
97
97
  '--profile <type>',
98
- 'Scan profile to use (agentic, cost, security, onboarding)'
98
+ 'Scan profile to use (agentic, cost, logic, ui, security, onboarding)'
99
99
  )
100
100
  .option(
101
101
  '--compare-to <path>',
@@ -105,6 +105,7 @@ program
105
105
  .option('--exclude <patterns>', 'File patterns to exclude (comma-separated)')
106
106
  .option('-o, --output <format>', 'Output format: console, json', 'console')
107
107
  .option('--output-file <path>', 'Output file path (for json)')
108
+ .option('--score', 'Calculate and display AI Readiness Score (0-100)')
108
109
  .option(
109
110
  '--no-score',
110
111
  'Disable calculating AI Readiness Score (enabled by default)'
@@ -98,6 +98,24 @@ export async function scanAction(directory: string, options: ScanOptions) {
98
98
  case 'cost':
99
99
  profileTools = [ToolName.PatternDetect, ToolName.ContextAnalyzer];
100
100
  break;
101
+ case 'logic':
102
+ profileTools = [
103
+ ToolName.TestabilityIndex,
104
+ ToolName.NamingConsistency,
105
+ ToolName.ContextAnalyzer,
106
+ ToolName.PatternDetect,
107
+ ToolName.ChangeAmplification,
108
+ ];
109
+ break;
110
+ case 'ui':
111
+ profileTools = [
112
+ ToolName.NamingConsistency,
113
+ ToolName.ContextAnalyzer,
114
+ ToolName.PatternDetect,
115
+ ToolName.DocDrift,
116
+ ToolName.AiSignalClarity,
117
+ ];
118
+ break;
101
119
  case 'security':
102
120
  profileTools = [
103
121
  ToolName.NamingConsistency,
@@ -182,6 +200,10 @@ export async function scanAction(directory: string, options: ScanOptions) {
182
200
  }
183
201
  };
184
202
 
203
+ // Determine scoring profile for project-type-aware weighting
204
+ const scoringProfile =
205
+ options.profile || baseOptions.scoring?.profile || 'default';
206
+
185
207
  const results = await analyzeUnified({
186
208
  ...finalOptions,
187
209
  progressCallback,
@@ -199,10 +221,18 @@ export async function scanAction(directory: string, options: ScanOptions) {
199
221
 
200
222
  let scoringResult: ScoringResult | undefined;
201
223
  if (options.score || finalOptions.scoring?.showBreakdown) {
202
- scoringResult = await scoreUnified(results, finalOptions);
224
+ // Pass the profile to scoreUnified
225
+ scoringResult = await scoreUnified(results, {
226
+ ...finalOptions,
227
+ scoring: {
228
+ ...finalOptions.scoring,
229
+ profile: scoringProfile,
230
+ },
231
+ });
203
232
 
204
233
  console.log(chalk.bold('\nšŸ“Š AI Readiness Overall Score'));
205
234
  console.log(` ${formatScore(scoringResult)}`);
235
+ console.log(chalk.dim(` (Scoring Profile: ${scoringProfile})`));
206
236
 
207
237
  // Trend comparison logic
208
238
  if (options.compareTo) {
@@ -313,8 +343,37 @@ export async function scanAction(directory: string, options: ScanOptions) {
313
343
  console.log(chalk.bold('\nTool breakdown:'));
314
344
  scoringResult.breakdown.forEach((tool) => {
315
345
  const rating = getRating(tool.score);
316
- console.log(` - ${tool.toolName}: ${tool.score}/100 (${rating})`);
346
+ const emoji = getRatingDisplay(rating).emoji;
347
+ console.log(
348
+ ` - ${tool.toolName}: ${tool.score}/100 (${rating}) ${emoji}`
349
+ );
317
350
  });
351
+
352
+ // Top Actionable Recommendations
353
+ const allRecs = scoringResult.breakdown
354
+ .flatMap((t) =>
355
+ (t.recommendations || []).map((r) => ({ ...r, tool: t.toolName }))
356
+ )
357
+ .sort((a, b) => b.estimatedImpact - a.estimatedImpact)
358
+ .slice(0, 3);
359
+
360
+ if (allRecs.length > 0) {
361
+ console.log(chalk.bold('\nšŸŽÆ Top Actionable Recommendations:'));
362
+ allRecs.forEach((rec, i) => {
363
+ const priorityIcon =
364
+ rec.priority === 'high'
365
+ ? 'šŸ”“'
366
+ : rec.priority === 'medium'
367
+ ? '🟔'
368
+ : 'šŸ”µ';
369
+ console.log(
370
+ ` ${i + 1}. ${priorityIcon} ${chalk.bold(rec.action)}`
371
+ );
372
+ console.log(
373
+ ` Impact: ${chalk.green(`+${rec.estimatedImpact} points`)} to ${rec.tool}`
374
+ );
375
+ });
376
+ }
318
377
  }
319
378
  }
320
379