@aiready/cli 0.14.7 → 0.14.9

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
@@ -49,15 +49,17 @@ AI READINESS SCORING:
49
49
  EXAMPLES:
50
50
  $ aiready scan # Comprehensive analysis with AI Readiness Score
51
51
  $ aiready scan --no-score # Run scan without score calculation
52
- $ aiready scan --tools patterns # Run only pattern detection
52
+ $ aiready init # Create a default aiready.json configuration
53
+ $ aiready init --full # Create configuration with ALL available options
53
54
  $ npx @aiready/cli scan # Industry standard way to run standard scan
54
55
  $ aiready scan --output json # Output raw JSON for piping
55
56
 
56
57
  GETTING STARTED:
57
- 1. Run 'aiready scan' to analyze your codebase and get an AI Readiness Score
58
- 2. Use '--profile agentic' for agent-focused analysis
59
- 3. Create aiready.json for persistent configuration
60
- 4. Set up CI/CD with '--threshold' for quality gates
58
+ 1. Run 'aiready init' to create a persistent 'aiready.json' config file
59
+ 2. Run 'aiready scan' to analyze your codebase and get an AI Readiness Score
60
+ 3. Use 'aiready init --full' to see every fine-tuning parameter available
61
+ 4. Use '--profile agentic' for agent-focused analysis
62
+ 5. Set up CI/CD with '--threshold' for quality gates
61
63
 
62
64
  CONFIGURATION:
63
65
  Config files (searched upward): aiready.json, .aiready.json, aiready.config.*
@@ -8,7 +8,10 @@ import {
8
8
  } from '@aiready/core';
9
9
 
10
10
  /**
11
- * Handle console output for the scan results
11
+ * Handle console output for the scan results.
12
+ *
13
+ * @param results - The combined results from all tools.
14
+ * @param startTime - The timestamp when the scan started.
12
15
  */
13
16
  export function printScanSummary(results: any, startTime: number) {
14
17
  console.log(chalk.cyan('\n=== AIReady Run Summary ==='));
@@ -21,7 +24,10 @@ export function printScanSummary(results: any, startTime: number) {
21
24
  }
22
25
 
23
26
  /**
24
- * Print business impact analysis
27
+ * Print business impact analysis based on ROI and budget metrics.
28
+ *
29
+ * @param roi - Calculated Return on Investment metrics.
30
+ * @param unifiedBudget - Consolidated context budget metrics.
25
31
  */
26
32
  export function printBusinessImpact(roi: any, unifiedBudget: any) {
27
33
  console.log(chalk.bold('\nšŸ’° Business Impact Analysis (Monthly)'));
@@ -40,7 +46,10 @@ export function printBusinessImpact(roi: any, unifiedBudget: any) {
40
46
  }
41
47
 
42
48
  /**
43
- * Print detailed scoring breakdown
49
+ * Print detailed scoring breakdown by tool.
50
+ *
51
+ * @param scoringResult - The overall scoring result.
52
+ * @param scoringProfile - The name of the scoring profile used.
44
53
  */
45
54
  export function printScoring(
46
55
  scoringResult: ScoringResult,
@@ -87,7 +96,11 @@ export function printScoring(
87
96
  }
88
97
 
89
98
  /**
90
- * Normalize report mapping (CLI logic)
99
+ * Normalize and map tool-specific results to a unified report structure.
100
+ *
101
+ * @param res - Raw unified results object.
102
+ * @param scoring - Optional scoring result to include.
103
+ * @returns Enhanced report with totals and scoring.
91
104
  */
92
105
  export function mapToUnifiedReport(
93
106
  res: any,
package/src/index.ts CHANGED
@@ -147,8 +147,12 @@ function sanitizeToolConfig(config: any): any {
147
147
  }
148
148
 
149
149
  /**
150
- * AIReady Unified Analysis
150
+ * AIReady Unified Analysis.
151
151
  * Orchestrates all registered tools via the ToolRegistry.
152
+ *
153
+ * @param options - Unified analysis configuration including tools and rootDir.
154
+ * @returns Promise resolving to the consolidated analysis result.
155
+ * @lastUpdated 2026-03-18
152
156
  */
153
157
  export async function analyzeUnified(
154
158
  options: UnifiedAnalysisOptions
@@ -347,8 +351,12 @@ export async function analyzeUnified(
347
351
  }
348
352
 
349
353
  /**
350
- * AIReady Unified Scoring
354
+ * AIReady Unified Scoring.
351
355
  * Calculates scores for all analyzed tools.
356
+ *
357
+ * @param results - The consolidated results from a unified analysis.
358
+ * @param options - Analysis options for weighting and budget calculation.
359
+ * @returns Promise resolving to the final scoring result.
352
360
  */
353
361
  export async function scoreUnified(
354
362
  results: UnifiedAnalysisResult,
@@ -419,7 +427,10 @@ export async function scoreUnified(
419
427
  }
420
428
 
421
429
  /**
422
- * Generate human-readable summary of unified results
430
+ * Generate human-readable summary of unified results.
431
+ *
432
+ * @param result - The consolidated analysis result object.
433
+ * @returns Formatted summary string.
423
434
  */
424
435
  export function generateUnifiedSummary(result: UnifiedAnalysisResult): string {
425
436
  const { summary } = result;
@@ -22,7 +22,10 @@ export function getReportTimestamp(): string {
22
22
  }
23
23
 
24
24
  /**
25
- * Warn if graph caps may be exceeded
25
+ * Warn if graph caps may be exceeded for visualization.
26
+ *
27
+ * @param report - The combined analysis report.
28
+ * @param dirPath - Root directory to look for configuration.
26
29
  */
27
30
  export async function warnIfGraphCapExceeded(report: any, dirPath: string) {
28
31
  try {
@@ -90,7 +93,11 @@ export async function warnIfGraphCapExceeded(report: any, dirPath: string) {
90
93
  }
91
94
 
92
95
  /**
93
- * Generate markdown report for consistency command
96
+ * Generate markdown report for consistency command.
97
+ *
98
+ * @param report - The consistency report object.
99
+ * @param elapsedTime - Time taken for analysis in seconds.
100
+ * @returns Formatted markdown string.
94
101
  */
95
102
  export function generateMarkdownReport(
96
103
  report: any,
@@ -117,7 +124,11 @@ export function generateMarkdownReport(
117
124
  }
118
125
 
119
126
  /**
120
- * Truncate array for display (show first N items with "... +N more")
127
+ * Truncate array for display (show first N items with "... +N more").
128
+ *
129
+ * @param arr - The array to truncate.
130
+ * @param cap - Maximum number of items to show before truncating.
131
+ * @returns Formatted string for display.
121
132
  */
122
133
  export function truncateArray(arr: any[] | undefined, cap = 8): string {
123
134
  if (!Array.isArray(arr)) return '';
@@ -128,6 +139,10 @@ export function truncateArray(arr: any[] | undefined, cap = 8): string {
128
139
 
129
140
  /**
130
141
  * Build a common ToolScoringOutput payload from a tool report.
142
+ *
143
+ * @param toolName - Identifier for the tool.
144
+ * @param report - Minimal report structure containing score and recommendations.
145
+ * @returns Standardized scoring output.
131
146
  */
132
147
  export function buildToolScoringOutput(
133
148
  toolName: string,
@@ -152,6 +167,10 @@ export function buildToolScoringOutput(
152
167
 
153
168
  /**
154
169
  * Load config and apply tool-level defaults.
170
+ *
171
+ * @param directory - Directory to search for config.
172
+ * @param defaults - Tool-specific default values.
173
+ * @returns Merged configuration with tool defaults.
155
174
  */
156
175
  export async function loadMergedToolConfig<T extends Record<string, unknown>>(
157
176
  directory: string,
@@ -164,6 +183,11 @@ export async function loadMergedToolConfig<T extends Record<string, unknown>>(
164
183
 
165
184
  /**
166
185
  * Shared base scan options used by CLI tool commands.
186
+ *
187
+ * @param directory - Root directory for scanning.
188
+ * @param options - CLI commander options object.
189
+ * @param extras - Additional tool-specific options.
190
+ * @returns Combined scan options for the analyzer.
167
191
  */
168
192
  export function buildCommonScanOptions(
169
193
  directory: string,
@@ -180,6 +204,9 @@ export function buildCommonScanOptions(
180
204
 
181
205
  /**
182
206
  * Execute a config-driven tool command with shared CLI plumbing.
207
+ *
208
+ * @param params - Execution parameters including analyze and score callbacks.
209
+ * @returns Promise resolving to the tool report and its scoring output.
183
210
  */
184
211
  export async function runConfiguredToolCommand<TReport, TScoring>(params: {
185
212
  directory: string;