@aiready/cli 0.15.3 → 0.15.5
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/dist/cli.js +158 -42
- package/dist/cli.mjs +158 -42
- package/package.json +21 -16
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(
|
|
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,173 @@ AI READINESS SCORING:
|
|
|
2320
2359
|
Use --score flag with any analysis command for detailed breakdown.
|
|
2321
2360
|
|
|
2322
2361
|
EXAMPLES:
|
|
2323
|
-
$
|
|
2324
|
-
$
|
|
2325
|
-
$
|
|
2326
|
-
$
|
|
2327
|
-
$ npx
|
|
2328
|
-
$
|
|
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 '
|
|
2332
|
-
2. Run '
|
|
2333
|
-
3. Use '
|
|
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):
|
|
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:
|
|
2343
|
-
GITHUB:
|
|
2344
|
-
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(
|
|
2351
|
-
|
|
2389
|
+
program.command("init").description("Generate a default configuration (aiready.json)").option(CLI_CONSTANTS.OPTIONS.FORCE, "Overwrite existing configuration file").option(
|
|
2390
|
+
CLI_CONSTANTS.OPTIONS.JS,
|
|
2352
2391
|
"Generate configuration as a JavaScript file (aiready.config.js)"
|
|
2353
|
-
).option(
|
|
2354
|
-
|
|
2355
|
-
|
|
2392
|
+
).option(
|
|
2393
|
+
CLI_CONSTANTS.OPTIONS.FULL,
|
|
2394
|
+
"Generate a full configuration with all available options"
|
|
2395
|
+
).action(async (options) => {
|
|
2396
|
+
const format = options.js ? CLI_CONSTANTS.FORMATS.JS : CLI_CONSTANTS.FORMATS.JSON;
|
|
2397
|
+
await initAction({ force: !!options.force, format, full: !!options.full });
|
|
2356
2398
|
});
|
|
2357
|
-
program.command(
|
|
2358
|
-
"
|
|
2399
|
+
program.command(CLI_CONSTANTS.ALIASES.VISUALISE).description("Alias for visualize (British spelling)").argument(
|
|
2400
|
+
"[directory]",
|
|
2401
|
+
"Directory to analyze",
|
|
2402
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2403
|
+
).option(
|
|
2404
|
+
CLI_CONSTANTS.OPTIONS.REPORT,
|
|
2359
2405
|
"Report path (auto-detects latest .aiready/aiready-report-*.json if not provided)"
|
|
2360
2406
|
).option(
|
|
2361
|
-
|
|
2407
|
+
CLI_CONSTANTS.OPTIONS.OUTPUT,
|
|
2362
2408
|
"Output HTML path (relative to directory)",
|
|
2363
2409
|
"packages/visualizer/visualization.html"
|
|
2364
|
-
).option(
|
|
2365
|
-
|
|
2410
|
+
).option(CLI_CONSTANTS.OPTIONS.OPEN, "Open generated HTML in default browser").option(
|
|
2411
|
+
CLI_CONSTANTS.OPTIONS.SERVE,
|
|
2366
2412
|
"Start a local static server to serve the visualization (optional port number)",
|
|
2367
2413
|
false
|
|
2368
2414
|
).option(
|
|
2369
|
-
|
|
2415
|
+
CLI_CONSTANTS.OPTIONS.DEV,
|
|
2370
2416
|
"Start Vite dev server (live reload) for interactive development",
|
|
2371
2417
|
true
|
|
2372
2418
|
).addHelpText("after", VISUALISE_HELP_TEXT).action(async (directory, options) => {
|
|
2373
|
-
await visualizeAction(directory,
|
|
2419
|
+
await visualizeAction(directory, {
|
|
2420
|
+
...options,
|
|
2421
|
+
force: !!options.force,
|
|
2422
|
+
open: !!options.open,
|
|
2423
|
+
dev: !!options.dev
|
|
2424
|
+
});
|
|
2374
2425
|
});
|
|
2375
|
-
program.command(
|
|
2376
|
-
"
|
|
2426
|
+
program.command(CLI_CONSTANTS.ALIASES.VISUALIZE).description("Generate interactive visualization from an AIReady report").argument(
|
|
2427
|
+
"[directory]",
|
|
2428
|
+
"Directory to analyze",
|
|
2429
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2430
|
+
).option(
|
|
2431
|
+
CLI_CONSTANTS.OPTIONS.REPORT,
|
|
2377
2432
|
"Report path (auto-detects latest .aiready/aiready-report-*.json if not provided)"
|
|
2378
2433
|
).option(
|
|
2379
|
-
|
|
2434
|
+
CLI_CONSTANTS.OPTIONS.OUTPUT,
|
|
2380
2435
|
"Output HTML path (relative to directory)",
|
|
2381
2436
|
"packages/visualizer/visualization.html"
|
|
2382
|
-
).option(
|
|
2383
|
-
|
|
2437
|
+
).option(CLI_CONSTANTS.OPTIONS.OPEN, "Open generated HTML in default browser").option(
|
|
2438
|
+
CLI_CONSTANTS.OPTIONS.SERVE,
|
|
2384
2439
|
"Start a local static server to serve the visualization (optional port number)",
|
|
2385
2440
|
false
|
|
2386
2441
|
).option(
|
|
2387
|
-
|
|
2442
|
+
CLI_CONSTANTS.OPTIONS.DEV,
|
|
2388
2443
|
"Start Vite dev server (live reload) for interactive development",
|
|
2389
2444
|
false
|
|
2390
2445
|
).addHelpText("after", VISUALIZE_HELP_TEXT).action(async (directory, options) => {
|
|
2391
|
-
await visualizeAction(directory,
|
|
2446
|
+
await visualizeAction(directory, {
|
|
2447
|
+
...options,
|
|
2448
|
+
force: !!options.force,
|
|
2449
|
+
open: !!options.open,
|
|
2450
|
+
dev: !!options.dev
|
|
2451
|
+
});
|
|
2392
2452
|
});
|
|
2393
|
-
program.command("change-amplification").description("Analyze graph metrics for change amplification").argument(
|
|
2453
|
+
program.command("change-amplification").description("Analyze graph metrics for change amplification").argument(
|
|
2454
|
+
"[directory]",
|
|
2455
|
+
"Directory to analyze",
|
|
2456
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2457
|
+
).option(
|
|
2458
|
+
CLI_CONSTANTS.OPTIONS.INCLUDE,
|
|
2459
|
+
"File patterns to include (comma-separated)"
|
|
2460
|
+
).option(
|
|
2461
|
+
CLI_CONSTANTS.OPTIONS.EXCLUDE,
|
|
2462
|
+
"File patterns to exclude (comma-separated)"
|
|
2463
|
+
).option(
|
|
2464
|
+
"-o, --output <format>",
|
|
2465
|
+
"Output format: console, json",
|
|
2466
|
+
CLI_CONSTANTS.FORMATS.CONSOLE
|
|
2467
|
+
).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
|
|
2394
2468
|
await (0, import_cli.changeAmplificationAction)(directory, options);
|
|
2395
2469
|
});
|
|
2396
|
-
program.command("testability").description("Analyze test coverage and AI readiness").argument(
|
|
2470
|
+
program.command("testability").description("Analyze test coverage and AI readiness").argument(
|
|
2471
|
+
"[directory]",
|
|
2472
|
+
"Directory to analyze",
|
|
2473
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2474
|
+
).option(
|
|
2475
|
+
CLI_CONSTANTS.OPTIONS.MIN_COVERAGE,
|
|
2476
|
+
"Minimum acceptable coverage ratio",
|
|
2477
|
+
"0.3"
|
|
2478
|
+
).option(
|
|
2479
|
+
CLI_CONSTANTS.OPTIONS.INCLUDE,
|
|
2480
|
+
"File patterns to include (comma-separated)"
|
|
2481
|
+
).option(
|
|
2482
|
+
CLI_CONSTANTS.OPTIONS.EXCLUDE,
|
|
2483
|
+
"File patterns to exclude (comma-separated)"
|
|
2484
|
+
).option(
|
|
2485
|
+
"-o, --output <format>",
|
|
2486
|
+
"Output format: console, json",
|
|
2487
|
+
CLI_CONSTANTS.FORMATS.CONSOLE
|
|
2488
|
+
).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
|
|
2397
2489
|
await testabilityAction(directory, options);
|
|
2398
2490
|
});
|
|
2399
|
-
program.command("contract").description("Analyze structural contract enforcement and defensive coding").argument(
|
|
2400
|
-
"
|
|
2491
|
+
program.command("contract").description("Analyze structural contract enforcement and defensive coding").argument(
|
|
2492
|
+
"[directory]",
|
|
2493
|
+
"Directory to analyze",
|
|
2494
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2495
|
+
).option(
|
|
2496
|
+
CLI_CONSTANTS.OPTIONS.MIN_CHAIN_DEPTH,
|
|
2401
2497
|
"Minimum optional chain depth to flag",
|
|
2402
2498
|
"3"
|
|
2403
|
-
).option(
|
|
2499
|
+
).option(
|
|
2500
|
+
CLI_CONSTANTS.OPTIONS.INCLUDE,
|
|
2501
|
+
"File patterns to include (comma-separated)"
|
|
2502
|
+
).option(
|
|
2503
|
+
CLI_CONSTANTS.OPTIONS.EXCLUDE,
|
|
2504
|
+
"File patterns to exclude (comma-separated)"
|
|
2505
|
+
).option(
|
|
2506
|
+
"-o, --output <format>",
|
|
2507
|
+
"Output format: console, json",
|
|
2508
|
+
CLI_CONSTANTS.FORMATS.CONSOLE
|
|
2509
|
+
).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
|
|
2404
2510
|
await contractEnforcementAction(directory, options);
|
|
2405
2511
|
});
|
|
2406
|
-
program.command("upload").description("Upload an AIReady report JSON to the platform").argument("<file>", "Report JSON file to upload").option(
|
|
2512
|
+
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
2513
|
await uploadAction(file, options);
|
|
2408
2514
|
});
|
|
2409
|
-
program.command("remediate").description("Suggest AI-ready refactors based on a scan report").argument(
|
|
2515
|
+
program.command("remediate").description("Suggest AI-ready refactors based on a scan report").argument(
|
|
2516
|
+
"[directory]",
|
|
2517
|
+
"Directory to remediate",
|
|
2518
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2519
|
+
).option(CLI_CONSTANTS.OPTIONS.REPORT, "AIReady report JSON file").option(
|
|
2520
|
+
CLI_CONSTANTS.OPTIONS.TOOL,
|
|
2521
|
+
"Filter by tool: patterns, context, consistency"
|
|
2522
|
+
).option(CLI_CONSTANTS.OPTIONS.SERVER, "Custom platform URL").addHelpText("after", REMEDIATE_HELP_TEXT).action(async (directory, options) => {
|
|
2410
2523
|
await remediateAction(directory, options);
|
|
2411
2524
|
});
|
|
2412
|
-
program.command("bug").description("Report a bug or provide feedback (Agent-friendly)").argument("[message]", "Short description of the issue").option(
|
|
2413
|
-
|
|
2525
|
+
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(
|
|
2526
|
+
CLI_CONSTANTS.OPTIONS.SUBMIT,
|
|
2527
|
+
"Submit the issue directly using the GitHub CLI (gh)"
|
|
2528
|
+
).addHelpText("after", BUG_HELP_TEXT).action(async (message, options) => {
|
|
2529
|
+
await bugAction(message, { ...options, submit: !!options.submit });
|
|
2414
2530
|
});
|
|
2415
2531
|
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(
|
|
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,173 @@ AI READINESS SCORING:
|
|
|
2028
2067
|
Use --score flag with any analysis command for detailed breakdown.
|
|
2029
2068
|
|
|
2030
2069
|
EXAMPLES:
|
|
2031
|
-
$
|
|
2032
|
-
$
|
|
2033
|
-
$
|
|
2034
|
-
$
|
|
2035
|
-
$ npx
|
|
2036
|
-
$
|
|
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 '
|
|
2040
|
-
2. Run '
|
|
2041
|
-
3. Use '
|
|
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):
|
|
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:
|
|
2051
|
-
GITHUB:
|
|
2052
|
-
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(
|
|
2059
|
-
|
|
2097
|
+
program.command("init").description("Generate a default configuration (aiready.json)").option(CLI_CONSTANTS.OPTIONS.FORCE, "Overwrite existing configuration file").option(
|
|
2098
|
+
CLI_CONSTANTS.OPTIONS.JS,
|
|
2060
2099
|
"Generate configuration as a JavaScript file (aiready.config.js)"
|
|
2061
|
-
).option(
|
|
2062
|
-
|
|
2063
|
-
|
|
2100
|
+
).option(
|
|
2101
|
+
CLI_CONSTANTS.OPTIONS.FULL,
|
|
2102
|
+
"Generate a full configuration with all available options"
|
|
2103
|
+
).action(async (options) => {
|
|
2104
|
+
const format = options.js ? CLI_CONSTANTS.FORMATS.JS : CLI_CONSTANTS.FORMATS.JSON;
|
|
2105
|
+
await initAction({ force: !!options.force, format, full: !!options.full });
|
|
2064
2106
|
});
|
|
2065
|
-
program.command(
|
|
2066
|
-
"
|
|
2107
|
+
program.command(CLI_CONSTANTS.ALIASES.VISUALISE).description("Alias for visualize (British spelling)").argument(
|
|
2108
|
+
"[directory]",
|
|
2109
|
+
"Directory to analyze",
|
|
2110
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2111
|
+
).option(
|
|
2112
|
+
CLI_CONSTANTS.OPTIONS.REPORT,
|
|
2067
2113
|
"Report path (auto-detects latest .aiready/aiready-report-*.json if not provided)"
|
|
2068
2114
|
).option(
|
|
2069
|
-
|
|
2115
|
+
CLI_CONSTANTS.OPTIONS.OUTPUT,
|
|
2070
2116
|
"Output HTML path (relative to directory)",
|
|
2071
2117
|
"packages/visualizer/visualization.html"
|
|
2072
|
-
).option(
|
|
2073
|
-
|
|
2118
|
+
).option(CLI_CONSTANTS.OPTIONS.OPEN, "Open generated HTML in default browser").option(
|
|
2119
|
+
CLI_CONSTANTS.OPTIONS.SERVE,
|
|
2074
2120
|
"Start a local static server to serve the visualization (optional port number)",
|
|
2075
2121
|
false
|
|
2076
2122
|
).option(
|
|
2077
|
-
|
|
2123
|
+
CLI_CONSTANTS.OPTIONS.DEV,
|
|
2078
2124
|
"Start Vite dev server (live reload) for interactive development",
|
|
2079
2125
|
true
|
|
2080
2126
|
).addHelpText("after", VISUALISE_HELP_TEXT).action(async (directory, options) => {
|
|
2081
|
-
await visualizeAction(directory,
|
|
2127
|
+
await visualizeAction(directory, {
|
|
2128
|
+
...options,
|
|
2129
|
+
force: !!options.force,
|
|
2130
|
+
open: !!options.open,
|
|
2131
|
+
dev: !!options.dev
|
|
2132
|
+
});
|
|
2082
2133
|
});
|
|
2083
|
-
program.command(
|
|
2084
|
-
"
|
|
2134
|
+
program.command(CLI_CONSTANTS.ALIASES.VISUALIZE).description("Generate interactive visualization from an AIReady report").argument(
|
|
2135
|
+
"[directory]",
|
|
2136
|
+
"Directory to analyze",
|
|
2137
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2138
|
+
).option(
|
|
2139
|
+
CLI_CONSTANTS.OPTIONS.REPORT,
|
|
2085
2140
|
"Report path (auto-detects latest .aiready/aiready-report-*.json if not provided)"
|
|
2086
2141
|
).option(
|
|
2087
|
-
|
|
2142
|
+
CLI_CONSTANTS.OPTIONS.OUTPUT,
|
|
2088
2143
|
"Output HTML path (relative to directory)",
|
|
2089
2144
|
"packages/visualizer/visualization.html"
|
|
2090
|
-
).option(
|
|
2091
|
-
|
|
2145
|
+
).option(CLI_CONSTANTS.OPTIONS.OPEN, "Open generated HTML in default browser").option(
|
|
2146
|
+
CLI_CONSTANTS.OPTIONS.SERVE,
|
|
2092
2147
|
"Start a local static server to serve the visualization (optional port number)",
|
|
2093
2148
|
false
|
|
2094
2149
|
).option(
|
|
2095
|
-
|
|
2150
|
+
CLI_CONSTANTS.OPTIONS.DEV,
|
|
2096
2151
|
"Start Vite dev server (live reload) for interactive development",
|
|
2097
2152
|
false
|
|
2098
2153
|
).addHelpText("after", VISUALIZE_HELP_TEXT).action(async (directory, options) => {
|
|
2099
|
-
await visualizeAction(directory,
|
|
2154
|
+
await visualizeAction(directory, {
|
|
2155
|
+
...options,
|
|
2156
|
+
force: !!options.force,
|
|
2157
|
+
open: !!options.open,
|
|
2158
|
+
dev: !!options.dev
|
|
2159
|
+
});
|
|
2100
2160
|
});
|
|
2101
|
-
program.command("change-amplification").description("Analyze graph metrics for change amplification").argument(
|
|
2161
|
+
program.command("change-amplification").description("Analyze graph metrics for change amplification").argument(
|
|
2162
|
+
"[directory]",
|
|
2163
|
+
"Directory to analyze",
|
|
2164
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2165
|
+
).option(
|
|
2166
|
+
CLI_CONSTANTS.OPTIONS.INCLUDE,
|
|
2167
|
+
"File patterns to include (comma-separated)"
|
|
2168
|
+
).option(
|
|
2169
|
+
CLI_CONSTANTS.OPTIONS.EXCLUDE,
|
|
2170
|
+
"File patterns to exclude (comma-separated)"
|
|
2171
|
+
).option(
|
|
2172
|
+
"-o, --output <format>",
|
|
2173
|
+
"Output format: console, json",
|
|
2174
|
+
CLI_CONSTANTS.FORMATS.CONSOLE
|
|
2175
|
+
).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
|
|
2102
2176
|
await changeAmplificationAction(directory, options);
|
|
2103
2177
|
});
|
|
2104
|
-
program.command("testability").description("Analyze test coverage and AI readiness").argument(
|
|
2178
|
+
program.command("testability").description("Analyze test coverage and AI readiness").argument(
|
|
2179
|
+
"[directory]",
|
|
2180
|
+
"Directory to analyze",
|
|
2181
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2182
|
+
).option(
|
|
2183
|
+
CLI_CONSTANTS.OPTIONS.MIN_COVERAGE,
|
|
2184
|
+
"Minimum acceptable coverage ratio",
|
|
2185
|
+
"0.3"
|
|
2186
|
+
).option(
|
|
2187
|
+
CLI_CONSTANTS.OPTIONS.INCLUDE,
|
|
2188
|
+
"File patterns to include (comma-separated)"
|
|
2189
|
+
).option(
|
|
2190
|
+
CLI_CONSTANTS.OPTIONS.EXCLUDE,
|
|
2191
|
+
"File patterns to exclude (comma-separated)"
|
|
2192
|
+
).option(
|
|
2193
|
+
"-o, --output <format>",
|
|
2194
|
+
"Output format: console, json",
|
|
2195
|
+
CLI_CONSTANTS.FORMATS.CONSOLE
|
|
2196
|
+
).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
|
|
2105
2197
|
await testabilityAction(directory, options);
|
|
2106
2198
|
});
|
|
2107
|
-
program.command("contract").description("Analyze structural contract enforcement and defensive coding").argument(
|
|
2108
|
-
"
|
|
2199
|
+
program.command("contract").description("Analyze structural contract enforcement and defensive coding").argument(
|
|
2200
|
+
"[directory]",
|
|
2201
|
+
"Directory to analyze",
|
|
2202
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2203
|
+
).option(
|
|
2204
|
+
CLI_CONSTANTS.OPTIONS.MIN_CHAIN_DEPTH,
|
|
2109
2205
|
"Minimum optional chain depth to flag",
|
|
2110
2206
|
"3"
|
|
2111
|
-
).option(
|
|
2207
|
+
).option(
|
|
2208
|
+
CLI_CONSTANTS.OPTIONS.INCLUDE,
|
|
2209
|
+
"File patterns to include (comma-separated)"
|
|
2210
|
+
).option(
|
|
2211
|
+
CLI_CONSTANTS.OPTIONS.EXCLUDE,
|
|
2212
|
+
"File patterns to exclude (comma-separated)"
|
|
2213
|
+
).option(
|
|
2214
|
+
"-o, --output <format>",
|
|
2215
|
+
"Output format: console, json",
|
|
2216
|
+
CLI_CONSTANTS.FORMATS.CONSOLE
|
|
2217
|
+
).option(CLI_CONSTANTS.OPTIONS.OUTPUT_FILE, "Output file path (for json)").action(async (directory, options) => {
|
|
2112
2218
|
await contractEnforcementAction(directory, options);
|
|
2113
2219
|
});
|
|
2114
|
-
program.command("upload").description("Upload an AIReady report JSON to the platform").argument("<file>", "Report JSON file to upload").option(
|
|
2220
|
+
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
2221
|
await uploadAction(file, options);
|
|
2116
2222
|
});
|
|
2117
|
-
program.command("remediate").description("Suggest AI-ready refactors based on a scan report").argument(
|
|
2223
|
+
program.command("remediate").description("Suggest AI-ready refactors based on a scan report").argument(
|
|
2224
|
+
"[directory]",
|
|
2225
|
+
"Directory to remediate",
|
|
2226
|
+
CLI_CONSTANTS.DEFAULT_DIRECTORY
|
|
2227
|
+
).option(CLI_CONSTANTS.OPTIONS.REPORT, "AIReady report JSON file").option(
|
|
2228
|
+
CLI_CONSTANTS.OPTIONS.TOOL,
|
|
2229
|
+
"Filter by tool: patterns, context, consistency"
|
|
2230
|
+
).option(CLI_CONSTANTS.OPTIONS.SERVER, "Custom platform URL").addHelpText("after", REMEDIATE_HELP_TEXT).action(async (directory, options) => {
|
|
2118
2231
|
await remediateAction(directory, options);
|
|
2119
2232
|
});
|
|
2120
|
-
program.command("bug").description("Report a bug or provide feedback (Agent-friendly)").argument("[message]", "Short description of the issue").option(
|
|
2121
|
-
|
|
2233
|
+
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(
|
|
2234
|
+
CLI_CONSTANTS.OPTIONS.SUBMIT,
|
|
2235
|
+
"Submit the issue directly using the GitHub CLI (gh)"
|
|
2236
|
+
).addHelpText("after", BUG_HELP_TEXT).action(async (message, options) => {
|
|
2237
|
+
await bugAction(message, { ...options, submit: !!options.submit });
|
|
2122
2238
|
});
|
|
2123
2239
|
program.parse();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.15.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.15.5",
|
|
4
|
+
"description": "The unified CLI for Agentic Readiness. Optimize codebases for AI agents like Cursor, Windsurf, and Claude. Detect semantic duplicates, analyze context fragmentation, and improve agentic leverage.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -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.
|
|
28
|
-
"@aiready/
|
|
29
|
-
"@aiready/context-analyzer": "0.22.
|
|
30
|
-
"@aiready/
|
|
31
|
-
"@aiready/
|
|
32
|
-
"@aiready/doc-drift": "0.14.
|
|
33
|
-
"@aiready/
|
|
34
|
-
"@aiready/
|
|
35
|
-
"@aiready/
|
|
36
|
-
"@aiready/
|
|
37
|
-
"@aiready/
|
|
38
|
-
"@aiready/visualizer": "0.7.
|
|
27
|
+
"@aiready/agent-grounding": "0.14.5",
|
|
28
|
+
"@aiready/core": "0.24.5",
|
|
29
|
+
"@aiready/context-analyzer": "0.22.5",
|
|
30
|
+
"@aiready/consistency": "0.21.5",
|
|
31
|
+
"@aiready/deps": "0.14.5",
|
|
32
|
+
"@aiready/doc-drift": "0.14.5",
|
|
33
|
+
"@aiready/contract-enforcement": "0.2.5",
|
|
34
|
+
"@aiready/change-amplification": "0.14.5",
|
|
35
|
+
"@aiready/ai-signal-clarity": "0.14.5",
|
|
36
|
+
"@aiready/testability": "0.7.5",
|
|
37
|
+
"@aiready/pattern-detect": "0.17.5",
|
|
38
|
+
"@aiready/visualizer": "0.7.5"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^24.0.0",
|
|
@@ -44,6 +44,13 @@
|
|
|
44
44
|
"keywords": [
|
|
45
45
|
"aiready",
|
|
46
46
|
"cli",
|
|
47
|
+
"Agentic Readiness",
|
|
48
|
+
"Model Context Protocol",
|
|
49
|
+
"MCP",
|
|
50
|
+
"Cursor",
|
|
51
|
+
"Windsurf",
|
|
52
|
+
"Claude",
|
|
53
|
+
"Copilot",
|
|
47
54
|
"ai-readiness",
|
|
48
55
|
"code-analysis",
|
|
49
56
|
"semantic-duplicates",
|
|
@@ -52,8 +59,6 @@
|
|
|
52
59
|
"code-quality",
|
|
53
60
|
"static-analysis",
|
|
54
61
|
"developer-tools",
|
|
55
|
-
"mcp",
|
|
56
|
-
"model-context-protocol",
|
|
57
62
|
"vscode-extension"
|
|
58
63
|
],
|
|
59
64
|
"author": "AIReady Team",
|