@aiready/cli 0.3.4 → 0.3.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/.turbo/turbo-build.log +7 -7
- package/dist/cli.js +8 -1
- package/dist/cli.mjs +8 -1
- package/package.json +4 -4
- package/src/cli.ts +10 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.3.
|
|
3
|
+
> @aiready/cli@0.3.5 build /Users/pengcao/projects/aiready/packages/cli
|
|
4
4
|
> tsup src/index.ts src/cli.ts --format cjs,esm --dts
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mCJS[39m [1mdist/cli.js [22m[
|
|
12
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m10.43 KB[39m
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m2.57 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist/chunk-KZKXZKES.mjs [22m[32m1.45 KB[39m
|
|
16
|
-
[32mESM[39m [1mdist/cli.mjs [22m[32m6.94 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 60ms
|
|
17
15
|
[32mESM[39m [1mdist/index.mjs [22m[32m138.00 B[39m
|
|
18
|
-
[32mESM[39m
|
|
16
|
+
[32mESM[39m [1mdist/chunk-KZKXZKES.mjs [22m[32m1.45 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m7.58 KB[39m
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 60ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 523ms
|
|
21
21
|
DTS dist/cli.d.ts 20.00 B
|
|
22
22
|
DTS dist/index.d.ts 731.00 B
|
|
23
23
|
DTS dist/cli.d.mts 20.00 B
|
package/dist/cli.js
CHANGED
|
@@ -122,13 +122,16 @@ program.command("scan").description("Run unified analysis on a codebase").argume
|
|
|
122
122
|
(0, import_core.handleCLIError)(error, "Analysis");
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
|
-
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("--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) => {
|
|
125
|
+
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)").action(async (directory, options) => {
|
|
126
126
|
console.log(import_chalk.default.blue("\u{1F50D} Analyzing patterns...\n"));
|
|
127
127
|
const startTime = Date.now();
|
|
128
128
|
try {
|
|
129
129
|
const defaults = {
|
|
130
130
|
minSimilarity: 0.4,
|
|
131
131
|
minLines: 5,
|
|
132
|
+
maxCandidatesPerBlock: 100,
|
|
133
|
+
minSharedTokens: 8,
|
|
134
|
+
useSmartDefaults: true,
|
|
132
135
|
include: void 0,
|
|
133
136
|
exclude: void 0,
|
|
134
137
|
output: {
|
|
@@ -139,6 +142,10 @@ program.command("patterns").description("Run pattern detection analysis").argume
|
|
|
139
142
|
const finalOptions = (0, import_core.loadMergedConfig)(directory, defaults, {
|
|
140
143
|
minSimilarity: options.similarity ? parseFloat(options.similarity) : void 0,
|
|
141
144
|
minLines: options.minLines ? parseInt(options.minLines) : void 0,
|
|
145
|
+
maxCandidatesPerBlock: options.maxCandidates ? parseInt(options.maxCandidates) : void 0,
|
|
146
|
+
minSharedTokens: options.minSharedTokens ? parseInt(options.minSharedTokens) : void 0,
|
|
147
|
+
// If --full-scan is specified, don't use smart defaults
|
|
148
|
+
useSmartDefaults: !options.fullScan,
|
|
142
149
|
include: options.include?.split(","),
|
|
143
150
|
exclude: options.exclude?.split(",")
|
|
144
151
|
});
|
package/dist/cli.mjs
CHANGED
|
@@ -51,13 +51,16 @@ program.command("scan").description("Run unified analysis on a codebase").argume
|
|
|
51
51
|
handleCLIError(error, "Analysis");
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
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("--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) => {
|
|
54
|
+
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)").action(async (directory, options) => {
|
|
55
55
|
console.log(chalk.blue("\u{1F50D} Analyzing patterns...\n"));
|
|
56
56
|
const startTime = Date.now();
|
|
57
57
|
try {
|
|
58
58
|
const defaults = {
|
|
59
59
|
minSimilarity: 0.4,
|
|
60
60
|
minLines: 5,
|
|
61
|
+
maxCandidatesPerBlock: 100,
|
|
62
|
+
minSharedTokens: 8,
|
|
63
|
+
useSmartDefaults: true,
|
|
61
64
|
include: void 0,
|
|
62
65
|
exclude: void 0,
|
|
63
66
|
output: {
|
|
@@ -68,6 +71,10 @@ program.command("patterns").description("Run pattern detection analysis").argume
|
|
|
68
71
|
const finalOptions = loadMergedConfig(directory, defaults, {
|
|
69
72
|
minSimilarity: options.similarity ? parseFloat(options.similarity) : void 0,
|
|
70
73
|
minLines: options.minLines ? parseInt(options.minLines) : void 0,
|
|
74
|
+
maxCandidatesPerBlock: options.maxCandidates ? parseInt(options.maxCandidates) : void 0,
|
|
75
|
+
minSharedTokens: options.minSharedTokens ? parseInt(options.minSharedTokens) : void 0,
|
|
76
|
+
// If --full-scan is specified, don't use smart defaults
|
|
77
|
+
useSmartDefaults: !options.fullScan,
|
|
71
78
|
include: options.include?.split(","),
|
|
72
79
|
exclude: options.exclude?.split(",")
|
|
73
80
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Unified CLI for AIReady analysis tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"commander": "^12.1.0",
|
|
13
13
|
"chalk": "^5.3.0",
|
|
14
|
-
"@aiready/core": "0.3.
|
|
15
|
-
"@aiready/
|
|
16
|
-
"@aiready/
|
|
14
|
+
"@aiready/core": "0.3.3",
|
|
15
|
+
"@aiready/context-analyzer": "0.3.5",
|
|
16
|
+
"@aiready/pattern-detect": "0.7.7"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"tsup": "^8.3.5",
|
package/src/cli.ts
CHANGED
|
@@ -84,6 +84,9 @@ program
|
|
|
84
84
|
.argument('<directory>', 'Directory to analyze')
|
|
85
85
|
.option('-s, --similarity <number>', 'Minimum similarity score (0-1)', '0.40')
|
|
86
86
|
.option('-l, --min-lines <number>', 'Minimum lines to consider', '5')
|
|
87
|
+
.option('--max-candidates <number>', 'Maximum candidates per block (performance tuning)')
|
|
88
|
+
.option('--min-shared-tokens <number>', 'Minimum shared tokens for candidates (performance tuning)')
|
|
89
|
+
.option('--full-scan', 'Disable smart defaults for comprehensive analysis (slower)')
|
|
87
90
|
.option('--include <patterns>', 'File patterns to include (comma-separated)')
|
|
88
91
|
.option('--exclude <patterns>', 'File patterns to exclude (comma-separated)')
|
|
89
92
|
.option('-o, --output <format>', 'Output format: console, json', 'console')
|
|
@@ -98,6 +101,9 @@ program
|
|
|
98
101
|
const defaults = {
|
|
99
102
|
minSimilarity: 0.4,
|
|
100
103
|
minLines: 5,
|
|
104
|
+
maxCandidatesPerBlock: 100,
|
|
105
|
+
minSharedTokens: 8,
|
|
106
|
+
useSmartDefaults: true,
|
|
101
107
|
include: undefined,
|
|
102
108
|
exclude: undefined,
|
|
103
109
|
output: {
|
|
@@ -110,6 +116,10 @@ program
|
|
|
110
116
|
const finalOptions = loadMergedConfig(directory, defaults, {
|
|
111
117
|
minSimilarity: options.similarity ? parseFloat(options.similarity) : undefined,
|
|
112
118
|
minLines: options.minLines ? parseInt(options.minLines) : undefined,
|
|
119
|
+
maxCandidatesPerBlock: options.maxCandidates ? parseInt(options.maxCandidates) : undefined,
|
|
120
|
+
minSharedTokens: options.minSharedTokens ? parseInt(options.minSharedTokens) : undefined,
|
|
121
|
+
// If --full-scan is specified, don't use smart defaults
|
|
122
|
+
useSmartDefaults: !options.fullScan,
|
|
113
123
|
include: options.include?.split(','),
|
|
114
124
|
exclude: options.exclude?.split(','),
|
|
115
125
|
});
|