@aiready/cli 0.15.3 → 0.15.4

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.
Files changed (3) hide show
  1. package/dist/cli.js +89 -43
  2. package/dist/cli.mjs +89 -43
  3. package/package.json +13 -13
package/dist/cli.js CHANGED
@@ -2304,6 +2304,45 @@ EXAMPLES:
2304
2304
 
2305
2305
  // src/cli.ts
2306
2306
  var import_meta = {};
2307
+ var CLI_CONSTANTS = {
2308
+ NAME: "aiready",
2309
+ DESCRIPTION: "AIReady - Assess and improve AI-readiness of codebases",
2310
+ CONFIG_FILES: "aiready.json, .aiready.json, aiready.config.*",
2311
+ DOCS_URL: "https://aiready.dev/docs/cli",
2312
+ GITHUB_URL: "https://github.com/caopengau/aiready-cli",
2313
+ LANDING_URL: "https://github.com/caopengau/aiready-landing",
2314
+ DEFAULT_DIRECTORY: ".",
2315
+ FORMATS: {
2316
+ JSON: "json",
2317
+ JS: "js",
2318
+ CONSOLE: "console"
2319
+ },
2320
+ ALIASES: {
2321
+ VISUALISE: "visualise",
2322
+ VISUALIZE: "visualize"
2323
+ },
2324
+ OPTIONS: {
2325
+ FORCE: "-f, --force",
2326
+ JS: "--js",
2327
+ FULL: "--full",
2328
+ REPORT: "--report <path>",
2329
+ OUTPUT: "-o, --output <path>",
2330
+ OPEN: "--open",
2331
+ SERVE: "--serve [port]",
2332
+ DEV: "--dev",
2333
+ INCLUDE: "--include <patterns>",
2334
+ EXCLUDE: "--exclude <patterns>",
2335
+ OUTPUT_FILE: "--output-file <path>",
2336
+ MIN_COVERAGE: "--min-coverage <ratio>",
2337
+ MIN_CHAIN_DEPTH: "--min-chain-depth <depth>",
2338
+ API_KEY: "--api-key <key>",
2339
+ REPO_ID: "--repo-id <id>",
2340
+ SERVER: "--server <url>",
2341
+ TOOL: "-t, --tool <name>",
2342
+ TYPE: "-t, --type <type>",
2343
+ SUBMIT: "--submit"
2344
+ }
2345
+ };
2307
2346
  var getDirname = () => {
2308
2347
  if (typeof __dirname !== "undefined") return __dirname;
2309
2348
  return (0, import_path8.dirname)((0, import_url.fileURLToPath)(import_meta.url));
@@ -2312,7 +2351,7 @@ var packageJson = JSON.parse(
2312
2351
  (0, import_fs8.readFileSync)((0, import_path8.join)(getDirname(), "../package.json"), "utf8")
2313
2352
  );
2314
2353
  var program = new import_commander.Command();
2315
- program.name("aiready").description("AIReady - Assess and improve AI-readiness of codebases").version(packageJson.version).addHelpText(
2354
+ program.name(CLI_CONSTANTS.NAME).description(CLI_CONSTANTS.DESCRIPTION).version(packageJson.version).addHelpText(
2316
2355
  "after",
2317
2356
  `
2318
2357
  AI READINESS SCORING:
@@ -2320,96 +2359,103 @@ AI READINESS SCORING:
2320
2359
  Use --score flag with any analysis command for detailed breakdown.
2321
2360
 
2322
2361
  EXAMPLES:
2323
- $ aiready scan # Comprehensive analysis with AI Readiness Score
2324
- $ aiready scan --no-score # Run scan without score calculation
2325
- $ aiready init # Create a default aiready.json configuration
2326
- $ aiready init --full # Create configuration with ALL available options
2327
- $ npx @aiready/cli scan # Industry standard way to run standard scan
2328
- $ aiready scan --output json # Output raw JSON for piping
2362
+ $ ${CLI_CONSTANTS.NAME} scan # Comprehensive analysis with AI Readiness Score
2363
+ $ ${CLI_CONSTANTS.NAME} scan --no-score # Run scan without score calculation
2364
+ $ ${CLI_CONSTANTS.NAME} init # Create a default aiready.json configuration
2365
+ $ ${CLI_CONSTANTS.NAME} init --full # Create configuration with ALL available options
2366
+ $ npx @${CLI_CONSTANTS.NAME}/cli scan # Industry standard way to run standard scan
2367
+ $ ${CLI_CONSTANTS.NAME} scan --output json # Output raw JSON for piping
2329
2368
 
2330
2369
  GETTING STARTED:
2331
- 1. Run 'aiready init' to create a persistent 'aiready.json' config file
2332
- 2. Run 'aiready scan' to analyze your codebase and get an AI Readiness Score
2333
- 3. Use 'aiready init --full' to see every fine-tuning parameter available
2370
+ 1. Run '${CLI_CONSTANTS.NAME} init' to create a persistent 'aiready.json' config file
2371
+ 2. Run '${CLI_CONSTANTS.NAME} scan' to analyze your codebase and get an AI Readiness Score
2372
+ 3. Use '${CLI_CONSTANTS.NAME} init --full' to see every fine-tuning parameter available
2334
2373
  4. Use '--profile agentic' for agent-focused analysis
2335
2374
  5. Set up CI/CD with '--threshold' for quality gates
2336
2375
 
2337
2376
  CONFIGURATION:
2338
- Config files (searched upward): aiready.json, .aiready.json, aiready.config.*
2377
+ Config files (searched upward): ${CLI_CONSTANTS.CONFIG_FILES}
2339
2378
  CLI options override config file settings
2340
2379
 
2341
2380
  VERSION: ${packageJson.version}
2342
- DOCUMENTATION: https://aiready.dev/docs/cli
2343
- GITHUB: https://github.com/caopengau/aiready-cli
2344
- LANDING: https://github.com/caopengau/aiready-landing`
2381
+ DOCUMENTATION: ${CLI_CONSTANTS.DOCS_URL}
2382
+ GITHUB: ${CLI_CONSTANTS.GITHUB_URL}
2383
+ LANDING: ${CLI_CONSTANTS.LANDING_URL}`
2345
2384
  );
2346
2385
  defineScanCommand(program);
2347
2386
  definePatternsCommand(program);
2348
2387
  defineContextCommand(program);
2349
2388
  defineConsistencyCommand(program);
2350
- program.command("init").description("Generate a default configuration (aiready.json)").option("-f, --force", "Overwrite existing configuration file").option(
2351
- "--js",
2352
- "Generate configuration as a JavaScript file (aiready.config.js)"
2353
- ).option("--full", "Generate a full configuration with all available options").action(async (options) => {
2354
- const format = options.js ? "js" : "json";
2355
- await initAction({ force: options.force, format, full: options.full });
2389
+ program.command("init").description("Generate a default configuration (aiready.json)").option(CLI_CONSTANTS.OPTIONS.FORCE, "Overwrite existing configuration file").option(CLI_CONSTANTS.OPTIONS.JS, "Generate configuration as a JavaScript file (aiready.config.js)").option(CLI_CONSTANTS.OPTIONS.FULL, "Generate a full configuration with all available options").action(async (options) => {
2390
+ const format = options.js ? CLI_CONSTANTS.FORMATS.JS : CLI_CONSTANTS.FORMATS.JSON;
2391
+ await initAction({ force: !!options.force, format, full: !!options.full });
2356
2392
  });
2357
- program.command("visualise").description("Alias for visualize (British spelling)").argument("[directory]", "Directory to analyze", ".").option(
2358
- "--report <path>",
2393
+ program.command(CLI_CONSTANTS.ALIASES.VISUALISE).description("Alias for visualize (British spelling)").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(
2394
+ CLI_CONSTANTS.OPTIONS.REPORT,
2359
2395
  "Report path (auto-detects latest .aiready/aiready-report-*.json if not provided)"
2360
2396
  ).option(
2361
- "-o, --output <path>",
2397
+ CLI_CONSTANTS.OPTIONS.OUTPUT,
2362
2398
  "Output HTML path (relative to directory)",
2363
2399
  "packages/visualizer/visualization.html"
2364
- ).option("--open", "Open generated HTML in default browser").option(
2365
- "--serve [port]",
2400
+ ).option(CLI_CONSTANTS.OPTIONS.OPEN, "Open generated HTML in default browser").option(
2401
+ CLI_CONSTANTS.OPTIONS.SERVE,
2366
2402
  "Start a local static server to serve the visualization (optional port number)",
2367
2403
  false
2368
2404
  ).option(
2369
- "--dev",
2405
+ CLI_CONSTANTS.OPTIONS.DEV,
2370
2406
  "Start Vite dev server (live reload) for interactive development",
2371
2407
  true
2372
2408
  ).addHelpText("after", VISUALISE_HELP_TEXT).action(async (directory, options) => {
2373
- await visualizeAction(directory, options);
2409
+ await visualizeAction(directory, {
2410
+ ...options,
2411
+ force: !!options.force,
2412
+ open: !!options.open,
2413
+ dev: !!options.dev
2414
+ });
2374
2415
  });
2375
- program.command("visualize").description("Generate interactive visualization from an AIReady report").argument("[directory]", "Directory to analyze", ".").option(
2376
- "--report <path>",
2416
+ program.command(CLI_CONSTANTS.ALIASES.VISUALIZE).description("Generate interactive visualization from an AIReady report").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(
2417
+ CLI_CONSTANTS.OPTIONS.REPORT,
2377
2418
  "Report path (auto-detects latest .aiready/aiready-report-*.json if not provided)"
2378
2419
  ).option(
2379
- "-o, --output <path>",
2420
+ CLI_CONSTANTS.OPTIONS.OUTPUT,
2380
2421
  "Output HTML path (relative to directory)",
2381
2422
  "packages/visualizer/visualization.html"
2382
- ).option("--open", "Open generated HTML in default browser").option(
2383
- "--serve [port]",
2423
+ ).option(CLI_CONSTANTS.OPTIONS.OPEN, "Open generated HTML in default browser").option(
2424
+ CLI_CONSTANTS.OPTIONS.SERVE,
2384
2425
  "Start a local static server to serve the visualization (optional port number)",
2385
2426
  false
2386
2427
  ).option(
2387
- "--dev",
2428
+ CLI_CONSTANTS.OPTIONS.DEV,
2388
2429
  "Start Vite dev server (live reload) for interactive development",
2389
2430
  false
2390
2431
  ).addHelpText("after", VISUALIZE_HELP_TEXT).action(async (directory, options) => {
2391
- await visualizeAction(directory, options);
2432
+ await visualizeAction(directory, {
2433
+ ...options,
2434
+ force: !!options.force,
2435
+ open: !!options.open,
2436
+ dev: !!options.dev
2437
+ });
2392
2438
  });
2393
- program.command("change-amplification").description("Analyze graph metrics for change amplification").argument("[directory]", "Directory to analyze", ".").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)").action(async (directory, options) => {
2439
+ program.command("change-amplification").description("Analyze graph metrics for change amplification").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(CLI_CONSTANTS.OPTIONS.INCLUDE, "File patterns to include (comma-separated)").option(CLI_CONSTANTS.OPTIONS.EXCLUDE, "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", CLI_CONSTANTS.FORMATS.CONSOLE).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
2394
2440
  await (0, import_cli.changeAmplificationAction)(directory, options);
2395
2441
  });
2396
- program.command("testability").description("Analyze test coverage and AI readiness").argument("[directory]", "Directory to analyze", ".").option("--min-coverage <ratio>", "Minimum acceptable coverage ratio", "0.3").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)").action(async (directory, options) => {
2442
+ program.command("testability").description("Analyze test coverage and AI readiness").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(CLI_CONSTANTS.OPTIONS.MIN_COVERAGE, "Minimum acceptable coverage ratio", "0.3").option(CLI_CONSTANTS.OPTIONS.INCLUDE, "File patterns to include (comma-separated)").option(CLI_CONSTANTS.OPTIONS.EXCLUDE, "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", CLI_CONSTANTS.FORMATS.CONSOLE).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
2397
2443
  await testabilityAction(directory, options);
2398
2444
  });
2399
- program.command("contract").description("Analyze structural contract enforcement and defensive coding").argument("[directory]", "Directory to analyze", ".").option(
2400
- "--min-chain-depth <depth>",
2445
+ program.command("contract").description("Analyze structural contract enforcement and defensive coding").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(
2446
+ CLI_CONSTANTS.OPTIONS.MIN_CHAIN_DEPTH,
2401
2447
  "Minimum optional chain depth to flag",
2402
2448
  "3"
2403
- ).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)").action(async (directory, options) => {
2449
+ ).option(CLI_CONSTANTS.OPTIONS.INCLUDE, "File patterns to include (comma-separated)").option(CLI_CONSTANTS.OPTIONS.EXCLUDE, "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", CLI_CONSTANTS.FORMATS.CONSOLE).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
2404
2450
  await contractEnforcementAction(directory, options);
2405
2451
  });
2406
- program.command("upload").description("Upload an AIReady report JSON to the platform").argument("<file>", "Report JSON file to upload").option("--api-key <key>", "Platform API key").option("--repo-id <id>", "Platform repository ID (optional)").option("--server <url>", "Custom platform URL").addHelpText("after", UPLOAD_HELP_TEXT).action(async (file, options) => {
2452
+ program.command("upload").description("Upload an AIReady report JSON to the platform").argument("<file>", "Report JSON file to upload").option(CLI_CONSTANTS.OPTIONS.API_KEY, "Platform API key").option(CLI_CONSTANTS.OPTIONS.REPO_ID, "Platform repository ID (optional)").option(CLI_CONSTANTS.OPTIONS.SERVER, "Custom platform URL").addHelpText("after", UPLOAD_HELP_TEXT).action(async (file, options) => {
2407
2453
  await uploadAction(file, options);
2408
2454
  });
2409
- program.command("remediate").description("Suggest AI-ready refactors based on a scan report").argument("[directory]", "Directory to remediate", ".").option("-r, --report <path>", "AIReady report JSON file").option("-t, --tool <name>", "Filter by tool: patterns, context, consistency").option("--server <url>", "Custom platform URL").addHelpText("after", REMEDIATE_HELP_TEXT).action(async (directory, options) => {
2455
+ program.command("remediate").description("Suggest AI-ready refactors based on a scan report").argument("[directory]", "Directory to remediate", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(CLI_CONSTANTS.OPTIONS.REPORT, "AIReady report JSON file").option(CLI_CONSTANTS.OPTIONS.TOOL, "Filter by tool: patterns, context, consistency").option(CLI_CONSTANTS.OPTIONS.SERVER, "Custom platform URL").addHelpText("after", REMEDIATE_HELP_TEXT).action(async (directory, options) => {
2410
2456
  await remediateAction(directory, options);
2411
2457
  });
2412
- program.command("bug").description("Report a bug or provide feedback (Agent-friendly)").argument("[message]", "Short description of the issue").option("-t, --type <type>", "Issue type: bug, feature, metric", "bug").option("--submit", "Submit the issue directly using the GitHub CLI (gh)").addHelpText("after", BUG_HELP_TEXT).action(async (message, options) => {
2413
- await bugAction(message, options);
2458
+ program.command("bug").description("Report a bug or provide feedback (Agent-friendly)").argument("[message]", "Short description of the issue").option(CLI_CONSTANTS.OPTIONS.TYPE, "Issue type: bug, feature, metric", "bug").option(CLI_CONSTANTS.OPTIONS.SUBMIT, "Submit the issue directly using the GitHub CLI (gh)").addHelpText("after", BUG_HELP_TEXT).action(async (message, options) => {
2459
+ await bugAction(message, { ...options, submit: !!options.submit });
2414
2460
  });
2415
2461
  program.parse();
package/dist/cli.mjs CHANGED
@@ -2012,6 +2012,45 @@ EXAMPLES:
2012
2012
  `;
2013
2013
 
2014
2014
  // src/cli.ts
2015
+ var CLI_CONSTANTS = {
2016
+ NAME: "aiready",
2017
+ DESCRIPTION: "AIReady - Assess and improve AI-readiness of codebases",
2018
+ CONFIG_FILES: "aiready.json, .aiready.json, aiready.config.*",
2019
+ DOCS_URL: "https://aiready.dev/docs/cli",
2020
+ GITHUB_URL: "https://github.com/caopengau/aiready-cli",
2021
+ LANDING_URL: "https://github.com/caopengau/aiready-landing",
2022
+ DEFAULT_DIRECTORY: ".",
2023
+ FORMATS: {
2024
+ JSON: "json",
2025
+ JS: "js",
2026
+ CONSOLE: "console"
2027
+ },
2028
+ ALIASES: {
2029
+ VISUALISE: "visualise",
2030
+ VISUALIZE: "visualize"
2031
+ },
2032
+ OPTIONS: {
2033
+ FORCE: "-f, --force",
2034
+ JS: "--js",
2035
+ FULL: "--full",
2036
+ REPORT: "--report <path>",
2037
+ OUTPUT: "-o, --output <path>",
2038
+ OPEN: "--open",
2039
+ SERVE: "--serve [port]",
2040
+ DEV: "--dev",
2041
+ INCLUDE: "--include <patterns>",
2042
+ EXCLUDE: "--exclude <patterns>",
2043
+ OUTPUT_FILE: "--output-file <path>",
2044
+ MIN_COVERAGE: "--min-coverage <ratio>",
2045
+ MIN_CHAIN_DEPTH: "--min-chain-depth <depth>",
2046
+ API_KEY: "--api-key <key>",
2047
+ REPO_ID: "--repo-id <id>",
2048
+ SERVER: "--server <url>",
2049
+ TOOL: "-t, --tool <name>",
2050
+ TYPE: "-t, --type <type>",
2051
+ SUBMIT: "--submit"
2052
+ }
2053
+ };
2015
2054
  var getDirname = () => {
2016
2055
  if (typeof __dirname !== "undefined") return __dirname;
2017
2056
  return dirname(fileURLToPath(import.meta.url));
@@ -2020,7 +2059,7 @@ var packageJson = JSON.parse(
2020
2059
  readFileSync4(join2(getDirname(), "../package.json"), "utf8")
2021
2060
  );
2022
2061
  var program = new Command();
2023
- program.name("aiready").description("AIReady - Assess and improve AI-readiness of codebases").version(packageJson.version).addHelpText(
2062
+ program.name(CLI_CONSTANTS.NAME).description(CLI_CONSTANTS.DESCRIPTION).version(packageJson.version).addHelpText(
2024
2063
  "after",
2025
2064
  `
2026
2065
  AI READINESS SCORING:
@@ -2028,96 +2067,103 @@ AI READINESS SCORING:
2028
2067
  Use --score flag with any analysis command for detailed breakdown.
2029
2068
 
2030
2069
  EXAMPLES:
2031
- $ aiready scan # Comprehensive analysis with AI Readiness Score
2032
- $ aiready scan --no-score # Run scan without score calculation
2033
- $ aiready init # Create a default aiready.json configuration
2034
- $ aiready init --full # Create configuration with ALL available options
2035
- $ npx @aiready/cli scan # Industry standard way to run standard scan
2036
- $ aiready scan --output json # Output raw JSON for piping
2070
+ $ ${CLI_CONSTANTS.NAME} scan # Comprehensive analysis with AI Readiness Score
2071
+ $ ${CLI_CONSTANTS.NAME} scan --no-score # Run scan without score calculation
2072
+ $ ${CLI_CONSTANTS.NAME} init # Create a default aiready.json configuration
2073
+ $ ${CLI_CONSTANTS.NAME} init --full # Create configuration with ALL available options
2074
+ $ npx @${CLI_CONSTANTS.NAME}/cli scan # Industry standard way to run standard scan
2075
+ $ ${CLI_CONSTANTS.NAME} scan --output json # Output raw JSON for piping
2037
2076
 
2038
2077
  GETTING STARTED:
2039
- 1. Run 'aiready init' to create a persistent 'aiready.json' config file
2040
- 2. Run 'aiready scan' to analyze your codebase and get an AI Readiness Score
2041
- 3. Use 'aiready init --full' to see every fine-tuning parameter available
2078
+ 1. Run '${CLI_CONSTANTS.NAME} init' to create a persistent 'aiready.json' config file
2079
+ 2. Run '${CLI_CONSTANTS.NAME} scan' to analyze your codebase and get an AI Readiness Score
2080
+ 3. Use '${CLI_CONSTANTS.NAME} init --full' to see every fine-tuning parameter available
2042
2081
  4. Use '--profile agentic' for agent-focused analysis
2043
2082
  5. Set up CI/CD with '--threshold' for quality gates
2044
2083
 
2045
2084
  CONFIGURATION:
2046
- Config files (searched upward): aiready.json, .aiready.json, aiready.config.*
2085
+ Config files (searched upward): ${CLI_CONSTANTS.CONFIG_FILES}
2047
2086
  CLI options override config file settings
2048
2087
 
2049
2088
  VERSION: ${packageJson.version}
2050
- DOCUMENTATION: https://aiready.dev/docs/cli
2051
- GITHUB: https://github.com/caopengau/aiready-cli
2052
- LANDING: https://github.com/caopengau/aiready-landing`
2089
+ DOCUMENTATION: ${CLI_CONSTANTS.DOCS_URL}
2090
+ GITHUB: ${CLI_CONSTANTS.GITHUB_URL}
2091
+ LANDING: ${CLI_CONSTANTS.LANDING_URL}`
2053
2092
  );
2054
2093
  defineScanCommand(program);
2055
2094
  definePatternsCommand(program);
2056
2095
  defineContextCommand(program);
2057
2096
  defineConsistencyCommand(program);
2058
- program.command("init").description("Generate a default configuration (aiready.json)").option("-f, --force", "Overwrite existing configuration file").option(
2059
- "--js",
2060
- "Generate configuration as a JavaScript file (aiready.config.js)"
2061
- ).option("--full", "Generate a full configuration with all available options").action(async (options) => {
2062
- const format = options.js ? "js" : "json";
2063
- await initAction({ force: options.force, format, full: options.full });
2097
+ program.command("init").description("Generate a default configuration (aiready.json)").option(CLI_CONSTANTS.OPTIONS.FORCE, "Overwrite existing configuration file").option(CLI_CONSTANTS.OPTIONS.JS, "Generate configuration as a JavaScript file (aiready.config.js)").option(CLI_CONSTANTS.OPTIONS.FULL, "Generate a full configuration with all available options").action(async (options) => {
2098
+ const format = options.js ? CLI_CONSTANTS.FORMATS.JS : CLI_CONSTANTS.FORMATS.JSON;
2099
+ await initAction({ force: !!options.force, format, full: !!options.full });
2064
2100
  });
2065
- program.command("visualise").description("Alias for visualize (British spelling)").argument("[directory]", "Directory to analyze", ".").option(
2066
- "--report <path>",
2101
+ program.command(CLI_CONSTANTS.ALIASES.VISUALISE).description("Alias for visualize (British spelling)").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(
2102
+ CLI_CONSTANTS.OPTIONS.REPORT,
2067
2103
  "Report path (auto-detects latest .aiready/aiready-report-*.json if not provided)"
2068
2104
  ).option(
2069
- "-o, --output <path>",
2105
+ CLI_CONSTANTS.OPTIONS.OUTPUT,
2070
2106
  "Output HTML path (relative to directory)",
2071
2107
  "packages/visualizer/visualization.html"
2072
- ).option("--open", "Open generated HTML in default browser").option(
2073
- "--serve [port]",
2108
+ ).option(CLI_CONSTANTS.OPTIONS.OPEN, "Open generated HTML in default browser").option(
2109
+ CLI_CONSTANTS.OPTIONS.SERVE,
2074
2110
  "Start a local static server to serve the visualization (optional port number)",
2075
2111
  false
2076
2112
  ).option(
2077
- "--dev",
2113
+ CLI_CONSTANTS.OPTIONS.DEV,
2078
2114
  "Start Vite dev server (live reload) for interactive development",
2079
2115
  true
2080
2116
  ).addHelpText("after", VISUALISE_HELP_TEXT).action(async (directory, options) => {
2081
- await visualizeAction(directory, options);
2117
+ await visualizeAction(directory, {
2118
+ ...options,
2119
+ force: !!options.force,
2120
+ open: !!options.open,
2121
+ dev: !!options.dev
2122
+ });
2082
2123
  });
2083
- program.command("visualize").description("Generate interactive visualization from an AIReady report").argument("[directory]", "Directory to analyze", ".").option(
2084
- "--report <path>",
2124
+ program.command(CLI_CONSTANTS.ALIASES.VISUALIZE).description("Generate interactive visualization from an AIReady report").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(
2125
+ CLI_CONSTANTS.OPTIONS.REPORT,
2085
2126
  "Report path (auto-detects latest .aiready/aiready-report-*.json if not provided)"
2086
2127
  ).option(
2087
- "-o, --output <path>",
2128
+ CLI_CONSTANTS.OPTIONS.OUTPUT,
2088
2129
  "Output HTML path (relative to directory)",
2089
2130
  "packages/visualizer/visualization.html"
2090
- ).option("--open", "Open generated HTML in default browser").option(
2091
- "--serve [port]",
2131
+ ).option(CLI_CONSTANTS.OPTIONS.OPEN, "Open generated HTML in default browser").option(
2132
+ CLI_CONSTANTS.OPTIONS.SERVE,
2092
2133
  "Start a local static server to serve the visualization (optional port number)",
2093
2134
  false
2094
2135
  ).option(
2095
- "--dev",
2136
+ CLI_CONSTANTS.OPTIONS.DEV,
2096
2137
  "Start Vite dev server (live reload) for interactive development",
2097
2138
  false
2098
2139
  ).addHelpText("after", VISUALIZE_HELP_TEXT).action(async (directory, options) => {
2099
- await visualizeAction(directory, options);
2140
+ await visualizeAction(directory, {
2141
+ ...options,
2142
+ force: !!options.force,
2143
+ open: !!options.open,
2144
+ dev: !!options.dev
2145
+ });
2100
2146
  });
2101
- program.command("change-amplification").description("Analyze graph metrics for change amplification").argument("[directory]", "Directory to analyze", ".").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)").action(async (directory, options) => {
2147
+ program.command("change-amplification").description("Analyze graph metrics for change amplification").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(CLI_CONSTANTS.OPTIONS.INCLUDE, "File patterns to include (comma-separated)").option(CLI_CONSTANTS.OPTIONS.EXCLUDE, "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", CLI_CONSTANTS.FORMATS.CONSOLE).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
2102
2148
  await changeAmplificationAction(directory, options);
2103
2149
  });
2104
- program.command("testability").description("Analyze test coverage and AI readiness").argument("[directory]", "Directory to analyze", ".").option("--min-coverage <ratio>", "Minimum acceptable coverage ratio", "0.3").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)").action(async (directory, options) => {
2150
+ program.command("testability").description("Analyze test coverage and AI readiness").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(CLI_CONSTANTS.OPTIONS.MIN_COVERAGE, "Minimum acceptable coverage ratio", "0.3").option(CLI_CONSTANTS.OPTIONS.INCLUDE, "File patterns to include (comma-separated)").option(CLI_CONSTANTS.OPTIONS.EXCLUDE, "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", CLI_CONSTANTS.FORMATS.CONSOLE).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
2105
2151
  await testabilityAction(directory, options);
2106
2152
  });
2107
- program.command("contract").description("Analyze structural contract enforcement and defensive coding").argument("[directory]", "Directory to analyze", ".").option(
2108
- "--min-chain-depth <depth>",
2153
+ program.command("contract").description("Analyze structural contract enforcement and defensive coding").argument("[directory]", "Directory to analyze", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(
2154
+ CLI_CONSTANTS.OPTIONS.MIN_CHAIN_DEPTH,
2109
2155
  "Minimum optional chain depth to flag",
2110
2156
  "3"
2111
- ).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)").action(async (directory, options) => {
2157
+ ).option(CLI_CONSTANTS.OPTIONS.INCLUDE, "File patterns to include (comma-separated)").option(CLI_CONSTANTS.OPTIONS.EXCLUDE, "File patterns to exclude (comma-separated)").option("-o, --output <format>", "Output format: console, json", CLI_CONSTANTS.FORMATS.CONSOLE).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
2112
2158
  await contractEnforcementAction(directory, options);
2113
2159
  });
2114
- program.command("upload").description("Upload an AIReady report JSON to the platform").argument("<file>", "Report JSON file to upload").option("--api-key <key>", "Platform API key").option("--repo-id <id>", "Platform repository ID (optional)").option("--server <url>", "Custom platform URL").addHelpText("after", UPLOAD_HELP_TEXT).action(async (file, options) => {
2160
+ program.command("upload").description("Upload an AIReady report JSON to the platform").argument("<file>", "Report JSON file to upload").option(CLI_CONSTANTS.OPTIONS.API_KEY, "Platform API key").option(CLI_CONSTANTS.OPTIONS.REPO_ID, "Platform repository ID (optional)").option(CLI_CONSTANTS.OPTIONS.SERVER, "Custom platform URL").addHelpText("after", UPLOAD_HELP_TEXT).action(async (file, options) => {
2115
2161
  await uploadAction(file, options);
2116
2162
  });
2117
- program.command("remediate").description("Suggest AI-ready refactors based on a scan report").argument("[directory]", "Directory to remediate", ".").option("-r, --report <path>", "AIReady report JSON file").option("-t, --tool <name>", "Filter by tool: patterns, context, consistency").option("--server <url>", "Custom platform URL").addHelpText("after", REMEDIATE_HELP_TEXT).action(async (directory, options) => {
2163
+ program.command("remediate").description("Suggest AI-ready refactors based on a scan report").argument("[directory]", "Directory to remediate", CLI_CONSTANTS.DEFAULT_DIRECTORY).option(CLI_CONSTANTS.OPTIONS.REPORT, "AIReady report JSON file").option(CLI_CONSTANTS.OPTIONS.TOOL, "Filter by tool: patterns, context, consistency").option(CLI_CONSTANTS.OPTIONS.SERVER, "Custom platform URL").addHelpText("after", REMEDIATE_HELP_TEXT).action(async (directory, options) => {
2118
2164
  await remediateAction(directory, options);
2119
2165
  });
2120
- program.command("bug").description("Report a bug or provide feedback (Agent-friendly)").argument("[message]", "Short description of the issue").option("-t, --type <type>", "Issue type: bug, feature, metric", "bug").option("--submit", "Submit the issue directly using the GitHub CLI (gh)").addHelpText("after", BUG_HELP_TEXT).action(async (message, options) => {
2121
- await bugAction(message, options);
2166
+ program.command("bug").description("Report a bug or provide feedback (Agent-friendly)").argument("[message]", "Short description of the issue").option(CLI_CONSTANTS.OPTIONS.TYPE, "Issue type: bug, feature, metric", "bug").option(CLI_CONSTANTS.OPTIONS.SUBMIT, "Submit the issue directly using the GitHub CLI (gh)").addHelpText("after", BUG_HELP_TEXT).action(async (message, options) => {
2167
+ await bugAction(message, { ...options, submit: !!options.submit });
2122
2168
  });
2123
2169
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/cli",
3
- "version": "0.15.3",
3
+ "version": "0.15.4",
4
4
  "description": "Assess and improve your codebase's AI-readiness. Get an AI Readiness Score (0-100) and detect semantic duplicates, context fragmentation, and naming inconsistencies.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -24,18 +24,18 @@
24
24
  "dependencies": {
25
25
  "chalk": "^5.3.0",
26
26
  "commander": "^14.0.0",
27
- "@aiready/agent-grounding": "0.14.3",
28
- "@aiready/consistency": "0.21.3",
29
- "@aiready/context-analyzer": "0.22.3",
30
- "@aiready/deps": "0.14.3",
31
- "@aiready/core": "0.24.3",
32
- "@aiready/doc-drift": "0.14.3",
33
- "@aiready/change-amplification": "0.14.3",
34
- "@aiready/contract-enforcement": "0.2.3",
35
- "@aiready/pattern-detect": "0.17.3",
36
- "@aiready/ai-signal-clarity": "0.14.3",
37
- "@aiready/testability": "0.7.3",
38
- "@aiready/visualizer": "0.7.3"
27
+ "@aiready/agent-grounding": "0.14.4",
28
+ "@aiready/consistency": "0.21.4",
29
+ "@aiready/core": "0.24.4",
30
+ "@aiready/context-analyzer": "0.22.4",
31
+ "@aiready/deps": "0.14.4",
32
+ "@aiready/doc-drift": "0.14.4",
33
+ "@aiready/contract-enforcement": "0.2.4",
34
+ "@aiready/ai-signal-clarity": "0.14.4",
35
+ "@aiready/pattern-detect": "0.17.4",
36
+ "@aiready/change-amplification": "0.14.4",
37
+ "@aiready/testability": "0.7.4",
38
+ "@aiready/visualizer": "0.7.4"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^24.0.0",