@aiready/cli 0.9.41 → 0.9.45
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/.aiready/aiready-report-20260228-003433.json +7939 -0
- package/.aiready/aiready-report-20260228-003613.json +771 -0
- package/.turbo/turbo-build.log +11 -11
- package/.turbo/turbo-lint.log +5 -0
- package/.turbo/turbo-test.log +4 -4
- package/README.md +22 -1
- package/dist/chunk-LLJMKNBI.mjs +243 -0
- package/dist/cli.js +424 -263
- package/dist/cli.mjs +373 -212
- package/dist/index.js +12 -6
- package/dist/index.mjs +1 -1
- package/package.json +12 -12
- package/src/cli.ts +18 -0
- package/src/commands/ai-signal-clarity.ts +2 -2
- package/src/commands/consistency.ts +1 -1
- package/src/commands/context.ts +1 -1
- package/src/commands/index.ts +1 -0
- package/src/commands/scan.ts +125 -7
- package/src/commands/upload.ts +87 -0
- package/src/index.ts +6 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.9.
|
|
3
|
+
> @aiready/cli@0.9.45 build /Users/pengcao/projects/aiready/packages/cli
|
|
4
4
|
> tsup src/index.ts src/cli.ts --format cjs,esm
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m138.00 B[39m
|
|
13
|
-
[32mESM[39m [1mdist/cli.mjs [22m[32m70.01 KB[39m
|
|
14
|
-
[32mESM[39m [1mdist/chunk-HLBKROD3.mjs [22m[32m7.85 KB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in 84ms
|
|
16
12
|
|
|
17
|
-
[90m[[
|
|
13
|
+
[90m[[90m2:01:22 PM[90m][39m [43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1m"import.meta" is not available with the "cjs" output format and will be empty[0m [empty-import-meta]
|
|
18
14
|
|
|
19
|
-
src/cli.ts:
|
|
20
|
-
[37m
|
|
15
|
+
src/cli.ts:25:31:
|
|
16
|
+
[37m 25 │ return dirname(fileURLToPath([32mimport.meta[37m.url));
|
|
21
17
|
╵ [32m~~~~~~~~~~~[0m
|
|
22
18
|
|
|
23
19
|
You need to set the output format to "esm" for "import.meta" to work correctly.
|
|
24
20
|
|
|
25
21
|
|
|
26
22
|
|
|
27
|
-
[32mCJS[39m [1mdist/index.js [22m[32m9.
|
|
28
|
-
[32mCJS[39m [1mdist/cli.js [22m[
|
|
29
|
-
[32mCJS[39m ⚡️ Build success in
|
|
23
|
+
[32mCJS[39m [1mdist/index.js [22m[32m9.42 KB[39m
|
|
24
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m88.27 KB[39m
|
|
25
|
+
[32mCJS[39m ⚡️ Build success in 107ms
|
|
26
|
+
[32mESM[39m [1mdist/cli.mjs [22m[32m77.34 KB[39m
|
|
27
|
+
[32mESM[39m [1mdist/chunk-LLJMKNBI.mjs [22m[32m8.07 KB[39m
|
|
28
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m138.00 B[39m
|
|
29
|
+
[32mESM[39m ⚡️ Build success in 107ms
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.9.
|
|
3
|
+
> @aiready/cli@0.9.43 test /Users/pengcao/projects/aiready/packages/cli
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
[?25l
|
|
7
7
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/cli[39m
|
|
8
8
|
|
|
9
|
+
[32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
9
10
|
[32m✓[39m dist/__tests__/cli.test.js [2m([22m[2m3 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
10
|
-
[32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
11
11
|
|
|
12
12
|
[2m Test Files [22m [1m[32m2 passed[39m[22m[90m (2)[39m
|
|
13
13
|
[2m Tests [22m [1m[32m6 passed[39m[22m[90m (6)[39m
|
|
14
|
-
[2m Start at [22m
|
|
15
|
-
[2m Duration [22m
|
|
14
|
+
[2m Start at [22m 00:56:33
|
|
15
|
+
[2m Duration [22m 7.83s[2m (transform 2.63s, setup 0ms, import 12.42s, tests 12ms, environment 0ms)[22m
|
|
16
16
|
|
|
17
17
|
[?25h
|
package/README.md
CHANGED
|
@@ -37,7 +37,28 @@ The CLI provides both unified analysis (scan multiple tools at once) and individ
|
|
|
37
37
|
aiready scan .
|
|
38
38
|
|
|
39
39
|
# Run a specific tool
|
|
40
|
-
aiready
|
|
40
|
+
aiready patterns . --similarity 0.6
|
|
41
|
+
|
|
42
|
+
## 🌐 Platform Integration
|
|
43
|
+
|
|
44
|
+
Connect your local scans to the [AIReady Dashboard](https://getaiready.dev/dashboard).
|
|
45
|
+
|
|
46
|
+
### Automatic Upload
|
|
47
|
+
Scan and upload results in one step:
|
|
48
|
+
```bash
|
|
49
|
+
aiready scan . --upload --api-key ar_...
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Manual Upload
|
|
53
|
+
Upload an existing report JSON:
|
|
54
|
+
```bash
|
|
55
|
+
aiready upload .aiready/latest.json --api-key ar_...
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Options
|
|
59
|
+
- `--upload`: Automatically upload results after scan
|
|
60
|
+
- `--api-key <key>`: Your platform API key (or set `AIREADY_API_KEY`)
|
|
61
|
+
- `--server <url>`: Custom platform URL (optional)
|
|
41
62
|
```
|
|
42
63
|
|
|
43
64
|
## License
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// src/index.ts
|
|
9
|
+
import { analyzePatterns } from "@aiready/pattern-detect";
|
|
10
|
+
import { analyzeContext } from "@aiready/context-analyzer";
|
|
11
|
+
import { analyzeConsistency } from "@aiready/consistency";
|
|
12
|
+
var severityOrder = {
|
|
13
|
+
critical: 4,
|
|
14
|
+
major: 3,
|
|
15
|
+
minor: 2,
|
|
16
|
+
info: 1
|
|
17
|
+
};
|
|
18
|
+
function sortBySeverity(results) {
|
|
19
|
+
return results.map((file) => {
|
|
20
|
+
const sortedIssues = [...file.issues].sort((a, b) => {
|
|
21
|
+
const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
|
|
22
|
+
if (severityDiff !== 0) return severityDiff;
|
|
23
|
+
return (a.location?.line || 0) - (b.location?.line || 0);
|
|
24
|
+
});
|
|
25
|
+
return { ...file, issues: sortedIssues };
|
|
26
|
+
}).sort((a, b) => {
|
|
27
|
+
const aMaxSeverity = Math.max(
|
|
28
|
+
...a.issues.map((i) => severityOrder[i.severity] || 0),
|
|
29
|
+
0
|
|
30
|
+
);
|
|
31
|
+
const bMaxSeverity = Math.max(
|
|
32
|
+
...b.issues.map((i) => severityOrder[i.severity] || 0),
|
|
33
|
+
0
|
|
34
|
+
);
|
|
35
|
+
if (aMaxSeverity !== bMaxSeverity) {
|
|
36
|
+
return bMaxSeverity - aMaxSeverity;
|
|
37
|
+
}
|
|
38
|
+
if (a.issues.length !== b.issues.length) {
|
|
39
|
+
return b.issues.length - a.issues.length;
|
|
40
|
+
}
|
|
41
|
+
return a.fileName.localeCompare(b.fileName);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async function analyzeUnified(options) {
|
|
45
|
+
const startTime = Date.now();
|
|
46
|
+
const tools = options.tools || ["patterns", "context", "consistency"];
|
|
47
|
+
const result = {
|
|
48
|
+
summary: {
|
|
49
|
+
totalIssues: 0,
|
|
50
|
+
toolsRun: tools,
|
|
51
|
+
executionTime: 0
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
if (tools.includes("patterns")) {
|
|
55
|
+
const patternResult = await analyzePatterns(options);
|
|
56
|
+
if (options.progressCallback) {
|
|
57
|
+
options.progressCallback({ tool: "patterns", data: patternResult });
|
|
58
|
+
}
|
|
59
|
+
result.patterns = sortBySeverity(patternResult.results);
|
|
60
|
+
result.duplicates = patternResult.duplicates;
|
|
61
|
+
result.summary.totalIssues += patternResult.results.reduce(
|
|
62
|
+
(sum, file) => sum + file.issues.length,
|
|
63
|
+
0
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
if (tools.includes("context")) {
|
|
67
|
+
const contextResults = await analyzeContext(options);
|
|
68
|
+
if (options.progressCallback) {
|
|
69
|
+
options.progressCallback({ tool: "context", data: contextResults });
|
|
70
|
+
}
|
|
71
|
+
result.context = contextResults.sort((a, b) => {
|
|
72
|
+
const severityDiff = (severityOrder[b.severity] || 0) - (severityOrder[a.severity] || 0);
|
|
73
|
+
if (severityDiff !== 0) return severityDiff;
|
|
74
|
+
if (a.tokenCost !== b.tokenCost) return b.tokenCost - a.tokenCost;
|
|
75
|
+
return b.fragmentationScore - a.fragmentationScore;
|
|
76
|
+
});
|
|
77
|
+
result.summary.totalIssues += result.context?.length || 0;
|
|
78
|
+
}
|
|
79
|
+
if (tools.includes("consistency")) {
|
|
80
|
+
const consistencyOptions = {
|
|
81
|
+
rootDir: options.rootDir,
|
|
82
|
+
include: options.include,
|
|
83
|
+
exclude: options.exclude,
|
|
84
|
+
...options.consistency || {}
|
|
85
|
+
};
|
|
86
|
+
const report = await analyzeConsistency(consistencyOptions);
|
|
87
|
+
if (options.progressCallback) {
|
|
88
|
+
options.progressCallback({ tool: "consistency", data: report });
|
|
89
|
+
}
|
|
90
|
+
if (report.results) {
|
|
91
|
+
report.results = sortBySeverity(report.results);
|
|
92
|
+
}
|
|
93
|
+
result.consistency = report;
|
|
94
|
+
result.summary.totalIssues += report.summary.totalIssues;
|
|
95
|
+
}
|
|
96
|
+
if (tools.includes("doc-drift")) {
|
|
97
|
+
const { analyzeDocDrift } = await import("@aiready/doc-drift");
|
|
98
|
+
const report = await analyzeDocDrift({
|
|
99
|
+
rootDir: options.rootDir,
|
|
100
|
+
include: options.include,
|
|
101
|
+
exclude: options.exclude,
|
|
102
|
+
onProgress: options.onProgress
|
|
103
|
+
});
|
|
104
|
+
if (options.progressCallback) {
|
|
105
|
+
options.progressCallback({ tool: "doc-drift", data: report });
|
|
106
|
+
}
|
|
107
|
+
result.docDrift = report;
|
|
108
|
+
result.summary.totalIssues += report.issues?.length || 0;
|
|
109
|
+
}
|
|
110
|
+
if (tools.includes("deps-health")) {
|
|
111
|
+
const { analyzeDeps } = await import("@aiready/deps");
|
|
112
|
+
const report = await analyzeDeps({
|
|
113
|
+
rootDir: options.rootDir,
|
|
114
|
+
include: options.include,
|
|
115
|
+
exclude: options.exclude,
|
|
116
|
+
onProgress: options.onProgress
|
|
117
|
+
});
|
|
118
|
+
if (options.progressCallback) {
|
|
119
|
+
options.progressCallback({ tool: "deps-health", data: report });
|
|
120
|
+
}
|
|
121
|
+
result.deps = report;
|
|
122
|
+
result.summary.totalIssues += report.issues?.length || 0;
|
|
123
|
+
}
|
|
124
|
+
if (tools.includes("aiSignalClarity")) {
|
|
125
|
+
const { analyzeAiSignalClarity } = await import("@aiready/ai-signal-clarity");
|
|
126
|
+
const report = await analyzeAiSignalClarity({
|
|
127
|
+
rootDir: options.rootDir,
|
|
128
|
+
include: options.include,
|
|
129
|
+
exclude: options.exclude,
|
|
130
|
+
onProgress: options.onProgress
|
|
131
|
+
});
|
|
132
|
+
if (options.progressCallback) {
|
|
133
|
+
options.progressCallback({ tool: "aiSignalClarity", data: report });
|
|
134
|
+
}
|
|
135
|
+
result.aiSignalClarity = report;
|
|
136
|
+
result.summary.totalIssues += report.results?.reduce(
|
|
137
|
+
(sum, r) => sum + (r.issues?.length || 0),
|
|
138
|
+
0
|
|
139
|
+
) || 0;
|
|
140
|
+
}
|
|
141
|
+
if (tools.includes("grounding")) {
|
|
142
|
+
const { analyzeAgentGrounding } = await import("@aiready/agent-grounding");
|
|
143
|
+
const report = await analyzeAgentGrounding({
|
|
144
|
+
rootDir: options.rootDir,
|
|
145
|
+
include: options.include,
|
|
146
|
+
exclude: options.exclude,
|
|
147
|
+
onProgress: options.onProgress
|
|
148
|
+
});
|
|
149
|
+
if (options.progressCallback) {
|
|
150
|
+
options.progressCallback({ tool: "grounding", data: report });
|
|
151
|
+
}
|
|
152
|
+
result.grounding = report;
|
|
153
|
+
result.summary.totalIssues += report.issues?.length || 0;
|
|
154
|
+
}
|
|
155
|
+
if (tools.includes("testability")) {
|
|
156
|
+
const { analyzeTestability } = await import("@aiready/testability");
|
|
157
|
+
const report = await analyzeTestability({
|
|
158
|
+
rootDir: options.rootDir,
|
|
159
|
+
include: options.include,
|
|
160
|
+
exclude: options.exclude,
|
|
161
|
+
onProgress: options.onProgress
|
|
162
|
+
});
|
|
163
|
+
if (options.progressCallback) {
|
|
164
|
+
options.progressCallback({ tool: "testability", data: report });
|
|
165
|
+
}
|
|
166
|
+
result.testability = report;
|
|
167
|
+
result.summary.totalIssues += report.issues?.length || 0;
|
|
168
|
+
}
|
|
169
|
+
if (tools.includes("changeAmplification")) {
|
|
170
|
+
const { analyzeChangeAmplification } = await import("@aiready/change-amplification");
|
|
171
|
+
const report = await analyzeChangeAmplification({
|
|
172
|
+
rootDir: options.rootDir,
|
|
173
|
+
include: options.include,
|
|
174
|
+
exclude: options.exclude,
|
|
175
|
+
onProgress: options.onProgress
|
|
176
|
+
});
|
|
177
|
+
if (options.progressCallback) {
|
|
178
|
+
options.progressCallback({ tool: "changeAmplification", data: report });
|
|
179
|
+
}
|
|
180
|
+
result.changeAmplification = report;
|
|
181
|
+
result.summary.totalIssues += report.summary?.totalIssues || 0;
|
|
182
|
+
}
|
|
183
|
+
result.summary.executionTime = Date.now() - startTime;
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
function generateUnifiedSummary(result) {
|
|
187
|
+
const { summary } = result;
|
|
188
|
+
let output = `\u{1F680} AIReady Analysis Complete
|
|
189
|
+
|
|
190
|
+
`;
|
|
191
|
+
output += `\u{1F4CA} Summary:
|
|
192
|
+
`;
|
|
193
|
+
output += ` Tools run: ${summary.toolsRun.join(", ")}
|
|
194
|
+
`;
|
|
195
|
+
output += ` Total issues found: ${summary.totalIssues}
|
|
196
|
+
`;
|
|
197
|
+
output += ` Execution time: ${(summary.executionTime / 1e3).toFixed(2)}s
|
|
198
|
+
|
|
199
|
+
`;
|
|
200
|
+
if (result.patterns) {
|
|
201
|
+
output += `\u{1F50D} Pattern Analysis: ${result.patterns.length} issues
|
|
202
|
+
`;
|
|
203
|
+
}
|
|
204
|
+
if (result.context) {
|
|
205
|
+
output += `\u{1F9E0} Context Analysis: ${result.context.length} issues
|
|
206
|
+
`;
|
|
207
|
+
}
|
|
208
|
+
if (result.consistency) {
|
|
209
|
+
output += `\u{1F3F7}\uFE0F Consistency Analysis: ${result.consistency.summary.totalIssues} issues
|
|
210
|
+
`;
|
|
211
|
+
}
|
|
212
|
+
if (result.docDrift) {
|
|
213
|
+
output += `\u{1F4DD} Doc Drift Analysis: ${result.docDrift.issues?.length || 0} issues
|
|
214
|
+
`;
|
|
215
|
+
}
|
|
216
|
+
if (result.deps) {
|
|
217
|
+
output += `\u{1F4E6} Dependency Health: ${result.deps.issues?.length || 0} issues
|
|
218
|
+
`;
|
|
219
|
+
}
|
|
220
|
+
if (result.aiSignalClarity) {
|
|
221
|
+
output += `\u{1F9E0} AI Signal Clarity: ${result.aiSignalClarity.summary?.totalSignals || 0} signals
|
|
222
|
+
`;
|
|
223
|
+
}
|
|
224
|
+
if (result.grounding) {
|
|
225
|
+
output += `\u{1F9ED} Agent Grounding: ${result.grounding.issues?.length || 0} issues
|
|
226
|
+
`;
|
|
227
|
+
}
|
|
228
|
+
if (result.testability) {
|
|
229
|
+
output += `\u{1F9EA} Testability Index: ${result.testability.issues?.length || 0} issues
|
|
230
|
+
`;
|
|
231
|
+
}
|
|
232
|
+
if (result.changeAmplification) {
|
|
233
|
+
output += `\u{1F4A5} Change Amplification: ${result.changeAmplification.summary?.totalIssues || 0} cascading risks
|
|
234
|
+
`;
|
|
235
|
+
}
|
|
236
|
+
return output;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export {
|
|
240
|
+
__require,
|
|
241
|
+
analyzeUnified,
|
|
242
|
+
generateUnifiedSummary
|
|
243
|
+
};
|