@aiready/cli 0.7.20 → 0.7.21

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,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/cli@0.7.20 build /Users/pengcao/projects/aiready/packages/cli
3
+ > @aiready/cli@0.7.21 build /Users/pengcao/projects/aiready/packages/cli
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/cli.ts, src/index.ts
@@ -9,15 +9,15 @@
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
- ESM dist/chunk-3SG2GLFJ.mjs 3.80 KB
13
- ESM dist/index.mjs 138.00 B
14
- ESM dist/cli.mjs 35.13 KB
15
- ESM ⚡️ Build success in 16ms
12
+ CJS dist/cli.js 43.96 KB
16
13
  CJS dist/index.js 4.93 KB
17
- CJS dist/cli.js 42.18 KB
18
- CJS ⚡️ Build success in 17ms
14
+ CJS ⚡️ Build success in 51ms
15
+ ESM dist/index.mjs 138.00 B
16
+ ESM dist/cli.mjs 36.91 KB
17
+ ESM dist/chunk-3SG2GLFJ.mjs 3.80 KB
18
+ ESM ⚡️ Build success in 52ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 508ms
20
+ DTS ⚡️ Build success in 611ms
21
21
  DTS dist/cli.d.ts 20.00 B
22
22
  DTS dist/index.d.ts 1.22 KB
23
23
  DTS dist/cli.d.mts 20.00 B
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/cli@0.7.20 test /Users/pengcao/projects/aiready/packages/cli
3
+ > @aiready/cli@0.7.21 test /Users/pengcao/projects/aiready/packages/cli
4
4
  > vitest run
5
5
 
6
6
  [?25l
@@ -11,15 +11,15 @@
11
11
 
12
12
   Test Files 0 passed (1)
13
13
   Tests 0 passed (0)
14
-  Start at 17:31:23
14
+  Start at 10:41:17
15
15
   Duration 0ms
16
16
  [?2026l[?2026h
17
17
   ❯ src/__tests__/cli.test.ts 0/3
18
18
 
19
19
   Test Files 0 passed (1)
20
20
   Tests 0 passed (3)
21
-  Start at 17:31:23
22
-  Duration 201ms
21
+  Start at 10:41:17
22
+  Duration 301ms
23
23
  [?2026l ✓ src/__tests__/cli.test.ts (3 tests) 2ms
24
24
  ✓ CLI Unified Analysis (3)
25
25
  ✓ should run unified analysis with both tools 1ms
@@ -28,7 +28,7 @@
28
28
 
29
29
   Test Files  1 passed (1)
30
30
   Tests  3 passed (3)
31
-  Start at  17:31:23
32
-  Duration  275ms (transform 51ms, setup 0ms, import 203ms, tests 2ms, environment 0ms)
31
+  Start at  10:41:17
32
+  Duration  314ms (transform 57ms, setup 0ms, import 237ms, tests 2ms, environment 0ms)
33
33
 
34
34
  [?25h
package/dist/cli.js CHANGED
@@ -120,8 +120,49 @@ var import_core = require("@aiready/core");
120
120
  var import_fs2 = require("fs");
121
121
  var packageJson = JSON.parse((0, import_fs2.readFileSync)((0, import_path.join)(__dirname, "../package.json"), "utf8"));
122
122
  var program = new import_commander.Command();
123
- program.name("aiready").description("AIReady - Unified AI-readiness analysis tools").version(packageJson.version).addHelpText("after", "\nCONFIGURATION:\n Supports config files: aiready.json, aiready.config.json, .aiready.json, .aireadyrc.json, aiready.config.js, .aireadyrc.js\n CLI options override config file settings");
124
- program.command("scan").description("Run unified analysis on a codebase").argument("[directory]", "Directory to analyze", ".").option("-t, --tools <tools>", "Tools to run (comma-separated: patterns,context,consistency)", "patterns,context,consistency").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score (0-100)").option("--weights <weights>", 'Override tool weights for scoring (e.g., "patterns:50,context:30,consistency:20")').option("--threshold <score>", "Minimum passing score for CI/CD (exits with code 1 if below)").action(async (directory, options) => {
123
+ program.name("aiready").description("AIReady - Assess and improve AI-readiness of codebases").version(packageJson.version).addHelpText("after", `
124
+ AI READINESS SCORING:
125
+ Get a 0-100 score indicating how AI-ready your codebase is.
126
+ Use --score flag with any analysis command for detailed breakdown.
127
+
128
+ EXAMPLES:
129
+ $ aiready scan # Quick analysis of current directory
130
+ $ aiready scan --score # Get AI Readiness Score (0-100)
131
+ $ aiready scan --tools patterns # Run only pattern detection
132
+ $ aiready patterns --similarity 0.6 # Custom similarity threshold
133
+ $ aiready scan --output json --output-file results.json
134
+
135
+ GETTING STARTED:
136
+ 1. Run 'aiready scan' to analyze your codebase
137
+ 2. Use 'aiready scan --score' for AI readiness assessment
138
+ 3. Create aiready.json for persistent configuration
139
+ 4. Set up CI/CD with '--threshold' for quality gates
140
+
141
+ CONFIGURATION:
142
+ Config files (searched upward): aiready.json, .aiready.json, aiready.config.*
143
+ CLI options override config file settings
144
+
145
+ Example aiready.json:
146
+ {
147
+ "scan": { "exclude": ["**/dist/**", "**/node_modules/**"] },
148
+ "tools": {
149
+ "pattern-detect": { "minSimilarity": 0.5 },
150
+ "context-analyzer": { "maxContextBudget": 15000 }
151
+ },
152
+ "output": { "format": "json", "directory": ".aiready" }
153
+ }
154
+
155
+ VERSION: ${packageJson.version}
156
+ DOCUMENTATION: https://aiready.dev/docs/cli
157
+ GITHUB: https://github.com/caopengau/aiready-cli
158
+ LANDING: https://github.com/caopengau/aiready-landing`);
159
+ program.command("scan").description("Run comprehensive AI-readiness analysis (patterns + context + consistency)").argument("[directory]", "Directory to analyze", ".").option("-t, --tools <tools>", "Tools to run (comma-separated: patterns,context,consistency)", "patterns,context,consistency").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score (0-100) with breakdown").option("--weights <weights>", "Custom scoring weights (patterns:40,context:35,consistency:25)").option("--threshold <score>", "Fail CI/CD if score below threshold (0-100)").addHelpText("after", `
160
+ EXAMPLES:
161
+ $ aiready scan # Analyze all tools
162
+ $ aiready scan --tools patterns,context # Skip consistency
163
+ $ aiready scan --score --threshold 75 # CI/CD with threshold
164
+ $ aiready scan --output json --output-file report.json
165
+ `).action(async (directory, options) => {
125
166
  console.log(import_chalk.default.blue("\u{1F680} Starting AIReady unified analysis...\n"));
126
167
  const startTime = Date.now();
127
168
  try {
@@ -354,7 +395,12 @@ program.command("scan").description("Run unified analysis on a codebase").argume
354
395
  (0, import_core.handleCLIError)(error, "Analysis");
355
396
  }
356
397
  });
357
- program.command("patterns").description("Run pattern detection analysis").argument("[directory]", "Directory to analyze", ".").option("-s, --similarity <number>", "Minimum similarity score (0-1)", "0.40").option("-l, --min-lines <number>", "Minimum lines to consider", "5").option("--max-candidates <number>", "Maximum candidates per block (performance tuning)").option("--min-shared-tokens <number>", "Minimum shared tokens for candidates (performance tuning)").option("--full-scan", "Disable smart defaults for comprehensive analysis (slower)").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score for patterns (0-100)").action(async (directory, options) => {
398
+ program.command("patterns").description("Detect duplicate code patterns that confuse AI models").argument("[directory]", "Directory to analyze", ".").option("-s, --similarity <number>", "Minimum similarity score (0-1)", "0.40").option("-l, --min-lines <number>", "Minimum lines to consider", "5").option("--max-candidates <number>", "Maximum candidates per block (performance tuning)").option("--min-shared-tokens <number>", "Minimum shared tokens for candidates (performance tuning)").option("--full-scan", "Disable smart defaults for comprehensive analysis (slower)").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score for patterns (0-100)").addHelpText("after", `
399
+ EXAMPLES:
400
+ $ aiready patterns # Default analysis
401
+ $ aiready patterns --similarity 0.6 # Stricter matching
402
+ $ aiready patterns --min-lines 10 # Larger patterns only
403
+ `).action(async (directory, options) => {
358
404
  console.log(import_chalk.default.blue("\u{1F50D} Analyzing patterns...\n"));
359
405
  const startTime = Date.now();
360
406
  try {
@@ -458,7 +504,7 @@ program.command("patterns").description("Run pattern detection analysis").argume
458
504
  (0, import_core.handleCLIError)(error, "Pattern analysis");
459
505
  }
460
506
  });
461
- program.command("context").description("Run context window cost analysis").argument("[directory]", "Directory to analyze", ".").option("--max-depth <number>", "Maximum acceptable import depth", "5").option("--max-context <number>", "Maximum acceptable context budget (tokens)", "10000").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score for context (0-100)").action(async (directory, options) => {
507
+ program.command("context").description("Analyze context window costs and dependency fragmentation").argument("[directory]", "Directory to analyze", ".").option("--max-depth <number>", "Maximum acceptable import depth", "5").option("--max-context <number>", "Maximum acceptable context budget (tokens)", "10000").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score for context (0-100)").action(async (directory, options) => {
462
508
  console.log(import_chalk.default.blue("\u{1F9E0} Analyzing context costs...\n"));
463
509
  const startTime = Date.now();
464
510
  try {
@@ -595,7 +641,7 @@ program.command("context").description("Run context window cost analysis").argum
595
641
  (0, import_core.handleCLIError)(error, "Context analysis");
596
642
  }
597
643
  });
598
- program.command("consistency").description("Check naming, patterns, and architecture consistency").argument("[directory]", "Directory to analyze", ".").option("--naming", "Check naming conventions (default: true)").option("--no-naming", "Skip naming analysis").option("--patterns", "Check code patterns (default: true)").option("--no-patterns", "Skip pattern analysis").option("--min-severity <level>", "Minimum severity: info|minor|major|critical", "info").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json, markdown", "console").option("--output-file <path>", "Output file path (for json/markdown)").option("--score", "Calculate and display AI Readiness Score for consistency (0-100)").action(async (directory, options) => {
644
+ program.command("consistency").description("Check naming conventions and architectural consistency").argument("[directory]", "Directory to analyze", ".").option("--naming", "Check naming conventions (default: true)").option("--no-naming", "Skip naming analysis").option("--patterns", "Check code patterns (default: true)").option("--no-patterns", "Skip pattern analysis").option("--min-severity <level>", "Minimum severity: info|minor|major|critical", "info").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json, markdown", "console").option("--output-file <path>", "Output file path (for json/markdown)").option("--score", "Calculate and display AI Readiness Score for consistency (0-100)").action(async (directory, options) => {
599
645
  console.log(import_chalk.default.blue("\u{1F50D} Analyzing consistency...\n"));
600
646
  const startTime = Date.now();
601
647
  try {
package/dist/cli.mjs CHANGED
@@ -24,8 +24,49 @@ import {
24
24
  import { readFileSync } from "fs";
25
25
  var packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf8"));
26
26
  var program = new Command();
27
- program.name("aiready").description("AIReady - Unified AI-readiness analysis tools").version(packageJson.version).addHelpText("after", "\nCONFIGURATION:\n Supports config files: aiready.json, aiready.config.json, .aiready.json, .aireadyrc.json, aiready.config.js, .aireadyrc.js\n CLI options override config file settings");
28
- program.command("scan").description("Run unified analysis on a codebase").argument("[directory]", "Directory to analyze", ".").option("-t, --tools <tools>", "Tools to run (comma-separated: patterns,context,consistency)", "patterns,context,consistency").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score (0-100)").option("--weights <weights>", 'Override tool weights for scoring (e.g., "patterns:50,context:30,consistency:20")').option("--threshold <score>", "Minimum passing score for CI/CD (exits with code 1 if below)").action(async (directory, options) => {
27
+ program.name("aiready").description("AIReady - Assess and improve AI-readiness of codebases").version(packageJson.version).addHelpText("after", `
28
+ AI READINESS SCORING:
29
+ Get a 0-100 score indicating how AI-ready your codebase is.
30
+ Use --score flag with any analysis command for detailed breakdown.
31
+
32
+ EXAMPLES:
33
+ $ aiready scan # Quick analysis of current directory
34
+ $ aiready scan --score # Get AI Readiness Score (0-100)
35
+ $ aiready scan --tools patterns # Run only pattern detection
36
+ $ aiready patterns --similarity 0.6 # Custom similarity threshold
37
+ $ aiready scan --output json --output-file results.json
38
+
39
+ GETTING STARTED:
40
+ 1. Run 'aiready scan' to analyze your codebase
41
+ 2. Use 'aiready scan --score' for AI readiness assessment
42
+ 3. Create aiready.json for persistent configuration
43
+ 4. Set up CI/CD with '--threshold' for quality gates
44
+
45
+ CONFIGURATION:
46
+ Config files (searched upward): aiready.json, .aiready.json, aiready.config.*
47
+ CLI options override config file settings
48
+
49
+ Example aiready.json:
50
+ {
51
+ "scan": { "exclude": ["**/dist/**", "**/node_modules/**"] },
52
+ "tools": {
53
+ "pattern-detect": { "minSimilarity": 0.5 },
54
+ "context-analyzer": { "maxContextBudget": 15000 }
55
+ },
56
+ "output": { "format": "json", "directory": ".aiready" }
57
+ }
58
+
59
+ VERSION: ${packageJson.version}
60
+ DOCUMENTATION: https://aiready.dev/docs/cli
61
+ GITHUB: https://github.com/caopengau/aiready-cli
62
+ LANDING: https://github.com/caopengau/aiready-landing`);
63
+ program.command("scan").description("Run comprehensive AI-readiness analysis (patterns + context + consistency)").argument("[directory]", "Directory to analyze", ".").option("-t, --tools <tools>", "Tools to run (comma-separated: patterns,context,consistency)", "patterns,context,consistency").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score (0-100) with breakdown").option("--weights <weights>", "Custom scoring weights (patterns:40,context:35,consistency:25)").option("--threshold <score>", "Fail CI/CD if score below threshold (0-100)").addHelpText("after", `
64
+ EXAMPLES:
65
+ $ aiready scan # Analyze all tools
66
+ $ aiready scan --tools patterns,context # Skip consistency
67
+ $ aiready scan --score --threshold 75 # CI/CD with threshold
68
+ $ aiready scan --output json --output-file report.json
69
+ `).action(async (directory, options) => {
29
70
  console.log(chalk.blue("\u{1F680} Starting AIReady unified analysis...\n"));
30
71
  const startTime = Date.now();
31
72
  try {
@@ -258,7 +299,12 @@ program.command("scan").description("Run unified analysis on a codebase").argume
258
299
  handleCLIError(error, "Analysis");
259
300
  }
260
301
  });
261
- program.command("patterns").description("Run pattern detection analysis").argument("[directory]", "Directory to analyze", ".").option("-s, --similarity <number>", "Minimum similarity score (0-1)", "0.40").option("-l, --min-lines <number>", "Minimum lines to consider", "5").option("--max-candidates <number>", "Maximum candidates per block (performance tuning)").option("--min-shared-tokens <number>", "Minimum shared tokens for candidates (performance tuning)").option("--full-scan", "Disable smart defaults for comprehensive analysis (slower)").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score for patterns (0-100)").action(async (directory, options) => {
302
+ program.command("patterns").description("Detect duplicate code patterns that confuse AI models").argument("[directory]", "Directory to analyze", ".").option("-s, --similarity <number>", "Minimum similarity score (0-1)", "0.40").option("-l, --min-lines <number>", "Minimum lines to consider", "5").option("--max-candidates <number>", "Maximum candidates per block (performance tuning)").option("--min-shared-tokens <number>", "Minimum shared tokens for candidates (performance tuning)").option("--full-scan", "Disable smart defaults for comprehensive analysis (slower)").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score for patterns (0-100)").addHelpText("after", `
303
+ EXAMPLES:
304
+ $ aiready patterns # Default analysis
305
+ $ aiready patterns --similarity 0.6 # Stricter matching
306
+ $ aiready patterns --min-lines 10 # Larger patterns only
307
+ `).action(async (directory, options) => {
262
308
  console.log(chalk.blue("\u{1F50D} Analyzing patterns...\n"));
263
309
  const startTime = Date.now();
264
310
  try {
@@ -362,7 +408,7 @@ program.command("patterns").description("Run pattern detection analysis").argume
362
408
  handleCLIError(error, "Pattern analysis");
363
409
  }
364
410
  });
365
- program.command("context").description("Run context window cost analysis").argument("[directory]", "Directory to analyze", ".").option("--max-depth <number>", "Maximum acceptable import depth", "5").option("--max-context <number>", "Maximum acceptable context budget (tokens)", "10000").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score for context (0-100)").action(async (directory, options) => {
411
+ program.command("context").description("Analyze context window costs and dependency fragmentation").argument("[directory]", "Directory to analyze", ".").option("--max-depth <number>", "Maximum acceptable import depth", "5").option("--max-context <number>", "Maximum acceptable context budget (tokens)", "10000").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", "console").option("--output-file <path>", "Output file path (for json)").option("--score", "Calculate and display AI Readiness Score for context (0-100)").action(async (directory, options) => {
366
412
  console.log(chalk.blue("\u{1F9E0} Analyzing context costs...\n"));
367
413
  const startTime = Date.now();
368
414
  try {
@@ -499,7 +545,7 @@ program.command("context").description("Run context window cost analysis").argum
499
545
  handleCLIError(error, "Context analysis");
500
546
  }
501
547
  });
502
- program.command("consistency").description("Check naming, patterns, and architecture consistency").argument("[directory]", "Directory to analyze", ".").option("--naming", "Check naming conventions (default: true)").option("--no-naming", "Skip naming analysis").option("--patterns", "Check code patterns (default: true)").option("--no-patterns", "Skip pattern analysis").option("--min-severity <level>", "Minimum severity: info|minor|major|critical", "info").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json, markdown", "console").option("--output-file <path>", "Output file path (for json/markdown)").option("--score", "Calculate and display AI Readiness Score for consistency (0-100)").action(async (directory, options) => {
548
+ program.command("consistency").description("Check naming conventions and architectural consistency").argument("[directory]", "Directory to analyze", ".").option("--naming", "Check naming conventions (default: true)").option("--no-naming", "Skip naming analysis").option("--patterns", "Check code patterns (default: true)").option("--no-patterns", "Skip pattern analysis").option("--min-severity <level>", "Minimum severity: info|minor|major|critical", "info").option("--include <patterns>", "File patterns to include (comma-separated)").option("--exclude <patterns>", "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json, markdown", "console").option("--output-file <path>", "Output file path (for json/markdown)").option("--score", "Calculate and display AI Readiness Score for consistency (0-100)").action(async (directory, options) => {
503
549
  console.log(chalk.blue("\u{1F50D} Analyzing consistency...\n"));
504
550
  const startTime = Date.now();
505
551
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/cli",
3
- "version": "0.7.20",
3
+ "version": "0.7.21",
4
4
  "description": "Unified CLI for AIReady analysis tools",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -11,10 +11,10 @@
11
11
  "dependencies": {
12
12
  "commander": "^14.0.0",
13
13
  "chalk": "^5.3.0",
14
- "@aiready/pattern-detect": "0.9.22",
15
- "@aiready/consistency": "0.6.16",
16
- "@aiready/core": "0.7.13",
17
- "@aiready/context-analyzer": "0.7.18"
14
+ "@aiready/pattern-detect": "0.9.23",
15
+ "@aiready/core": "0.7.14",
16
+ "@aiready/context-analyzer": "0.7.19",
17
+ "@aiready/consistency": "0.6.17"
18
18
  },
19
19
  "devDependencies": {
20
20
  "tsup": "^8.3.5",
package/src/cli.ts CHANGED
@@ -28,22 +28,64 @@ const program = new Command();
28
28
 
29
29
  program
30
30
  .name('aiready')
31
- .description('AIReady - Unified AI-readiness analysis tools')
31
+ .description('AIReady - Assess and improve AI-readiness of codebases')
32
32
  .version(packageJson.version)
33
- .addHelpText('after', '\nCONFIGURATION:\n Supports config files: aiready.json, aiready.config.json, .aiready.json, .aireadyrc.json, aiready.config.js, .aireadyrc.js\n CLI options override config file settings');
33
+ .addHelpText('after', `
34
+ AI READINESS SCORING:
35
+ Get a 0-100 score indicating how AI-ready your codebase is.
36
+ Use --score flag with any analysis command for detailed breakdown.
37
+
38
+ EXAMPLES:
39
+ $ aiready scan # Quick analysis of current directory
40
+ $ aiready scan --score # Get AI Readiness Score (0-100)
41
+ $ aiready scan --tools patterns # Run only pattern detection
42
+ $ aiready patterns --similarity 0.6 # Custom similarity threshold
43
+ $ aiready scan --output json --output-file results.json
44
+
45
+ GETTING STARTED:
46
+ 1. Run 'aiready scan' to analyze your codebase
47
+ 2. Use 'aiready scan --score' for AI readiness assessment
48
+ 3. Create aiready.json for persistent configuration
49
+ 4. Set up CI/CD with '--threshold' for quality gates
50
+
51
+ CONFIGURATION:
52
+ Config files (searched upward): aiready.json, .aiready.json, aiready.config.*
53
+ CLI options override config file settings
54
+
55
+ Example aiready.json:
56
+ {
57
+ "scan": { "exclude": ["**/dist/**", "**/node_modules/**"] },
58
+ "tools": {
59
+ "pattern-detect": { "minSimilarity": 0.5 },
60
+ "context-analyzer": { "maxContextBudget": 15000 }
61
+ },
62
+ "output": { "format": "json", "directory": ".aiready" }
63
+ }
64
+
65
+ VERSION: ${packageJson.version}
66
+ DOCUMENTATION: https://aiready.dev/docs/cli
67
+ GITHUB: https://github.com/caopengau/aiready-cli
68
+ LANDING: https://github.com/caopengau/aiready-landing`);
34
69
 
35
70
  program
36
71
  .command('scan')
37
- .description('Run unified analysis on a codebase')
72
+ .description('Run comprehensive AI-readiness analysis (patterns + context + consistency)')
38
73
  .argument('[directory]', 'Directory to analyze', '.')
39
74
  .option('-t, --tools <tools>', 'Tools to run (comma-separated: patterns,context,consistency)', 'patterns,context,consistency')
40
75
  .option('--include <patterns>', 'File patterns to include (comma-separated)')
41
76
  .option('--exclude <patterns>', 'File patterns to exclude (comma-separated)')
42
77
  .option('-o, --output <format>', 'Output format: console, json', 'console')
43
78
  .option('--output-file <path>', 'Output file path (for json)')
44
- .option('--score', 'Calculate and display AI Readiness Score (0-100)')
45
- .option('--weights <weights>', 'Override tool weights for scoring (e.g., "patterns:50,context:30,consistency:20")')
46
- .option('--threshold <score>', 'Minimum passing score for CI/CD (exits with code 1 if below)')
79
+ .option('--score', 'Calculate and display AI Readiness Score (0-100) with breakdown')
80
+ .option('--weights <weights>', 'Custom scoring weights (patterns:40,context:35,consistency:25)')
81
+ .option('--threshold <score>', 'Fail CI/CD if score below threshold (0-100)')
82
+ .addHelpText('after', `
83
+ EXAMPLES:
84
+ $ aiready scan # Analyze all tools
85
+ $ aiready scan --tools patterns,context # Skip consistency
86
+ $ aiready scan --score --threshold 75 # CI/CD with threshold
87
+ $ aiready scan --output json --output-file report.json
88
+ `)
47
89
  .action(async (directory, options) => {
48
90
  console.log(chalk.blue('🚀 Starting AIReady unified analysis...\n'));
49
91
 
@@ -343,7 +385,7 @@ program
343
385
  // Individual tool commands for convenience
344
386
  program
345
387
  .command('patterns')
346
- .description('Run pattern detection analysis')
388
+ .description('Detect duplicate code patterns that confuse AI models')
347
389
  .argument('[directory]', 'Directory to analyze', '.')
348
390
  .option('-s, --similarity <number>', 'Minimum similarity score (0-1)', '0.40')
349
391
  .option('-l, --min-lines <number>', 'Minimum lines to consider', '5')
@@ -355,6 +397,12 @@ program
355
397
  .option('-o, --output <format>', 'Output format: console, json', 'console')
356
398
  .option('--output-file <path>', 'Output file path (for json)')
357
399
  .option('--score', 'Calculate and display AI Readiness Score for patterns (0-100)')
400
+ .addHelpText('after', `
401
+ EXAMPLES:
402
+ $ aiready patterns # Default analysis
403
+ $ aiready patterns --similarity 0.6 # Stricter matching
404
+ $ aiready patterns --min-lines 10 # Larger patterns only
405
+ `)
358
406
  .action(async (directory, options) => {
359
407
  console.log(chalk.blue('🔍 Analyzing patterns...\n'));
360
408
 
@@ -499,7 +547,7 @@ program
499
547
 
500
548
  program
501
549
  .command('context')
502
- .description('Run context window cost analysis')
550
+ .description('Analyze context window costs and dependency fragmentation')
503
551
  .argument('[directory]', 'Directory to analyze', '.')
504
552
  .option('--max-depth <number>', 'Maximum acceptable import depth', '5')
505
553
  .option('--max-context <number>', 'Maximum acceptable context budget (tokens)', '10000')
@@ -675,7 +723,7 @@ program
675
723
 
676
724
  program
677
725
  .command('consistency')
678
- .description('Check naming, patterns, and architecture consistency')
726
+ .description('Check naming conventions and architectural consistency')
679
727
  .argument('[directory]', 'Directory to analyze', '.')
680
728
  .option('--naming', 'Check naming conventions (default: true)')
681
729
  .option('--no-naming', 'Skip naming analysis')