@aiready/cli 0.7.11 → 0.7.13
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 +5 -5
- package/.turbo/turbo-test.log +6 -6
- package/README.md +84 -39
- package/package.json +13 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.7.
|
|
3
|
+
> @aiready/cli@0.7.13 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
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[32mCJS[39m [1mdist/index.js [22m[32m4.55 KB[39m
|
|
13
13
|
[32mCJS[39m [1mdist/cli.js [22m[32m28.45 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
15
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m138.00 B[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 58ms
|
|
16
15
|
[32mESM[39m [1mdist/cli.mjs [22m[32m21.98 KB[39m
|
|
16
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m138.00 B[39m
|
|
17
17
|
[32mESM[39m [1mdist/chunk-AGAMURT4.mjs [22m[32m3.42 KB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 59ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 506ms
|
|
21
21
|
DTS dist/cli.d.ts 20.00 B
|
|
22
22
|
DTS dist/index.d.ts 991.00 B
|
|
23
23
|
DTS dist/cli.d.mts 20.00 B
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.7.
|
|
3
|
+
> @aiready/cli@0.7.13 test /Users/pengcao/projects/aiready/packages/cli
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
[?25l
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
|
|
12
12
|
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
13
13
|
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
14
|
-
[2m Start at [
|
|
14
|
+
[2m Start at [22m18:33:26
|
|
15
15
|
[2m Duration [22m0ms
|
|
16
16
|
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
17
17
|
[1m[33m ❯ [39m[22msrc/__tests__/cli.test.ts[2m 0/3[22m
|
|
18
18
|
|
|
19
19
|
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
20
20
|
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (3)[39m
|
|
21
|
-
[2m Start at [
|
|
22
|
-
[2m Duration [
|
|
21
|
+
[2m Start at [22m18:33:26
|
|
22
|
+
[2m Duration [22m200ms
|
|
23
23
|
[?2026l[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K [32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
24
24
|
[32m✓[39m CLI Unified Analysis [2m(3)[22m
|
|
25
25
|
[32m✓[39m should run unified analysis with both tools[32m 1[2mms[22m[39m
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
30
30
|
[2m Tests [22m [1m[32m3 passed[39m[22m[90m (3)[39m
|
|
31
|
-
[2m Start at [22m
|
|
32
|
-
[2m Duration [22m
|
|
31
|
+
[2m Start at [22m 18:33:26
|
|
32
|
+
[2m Duration [22m 303ms[2m (transform 53ms, setup 0ms, import 227ms, tests 2ms, environment 0ms)[22m
|
|
33
33
|
|
|
34
34
|
[?25h
|
package/README.md
CHANGED
|
@@ -1,36 +1,82 @@
|
|
|
1
1
|
# @aiready/cli
|
|
2
2
|
|
|
3
|
-
Unified CLI for AIReady analysis tools
|
|
3
|
+
> **Unified CLI for AIReady analysis tools - Run all AI-readiness checks from a single command**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The CLI provides both unified analysis (scan multiple tools at once) and individual tool access for pattern detection, context analysis, and consistency checking.
|
|
6
|
+
|
|
7
|
+
## 🚀 Quick Start
|
|
8
|
+
|
|
9
|
+
**Zero config, works out of the box:**
|
|
6
10
|
|
|
7
11
|
```bash
|
|
12
|
+
# Run without installation (recommended)
|
|
13
|
+
npx @aiready/cli scan ./src
|
|
14
|
+
|
|
15
|
+
# Or install globally for simpler command and faster runs
|
|
8
16
|
npm install -g @aiready/cli
|
|
9
|
-
|
|
10
|
-
pnpm add -g @aiready/cli
|
|
11
|
-
# or
|
|
12
|
-
yarn global add @aiready/cli
|
|
17
|
+
aiready scan ./src
|
|
13
18
|
```
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
### 🎯 Input & Output
|
|
21
|
+
|
|
22
|
+
**Input:** Path to your source code directory
|
|
23
|
+
```bash
|
|
24
|
+
aiready scan ./src
|
|
25
|
+
```
|
|
16
26
|
|
|
17
|
-
|
|
27
|
+
**Output:** Terminal report + optional JSON file (saved to `.aiready/` directory)
|
|
28
|
+
```
|
|
29
|
+
📊 AIReady Scan Results
|
|
30
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
31
|
+
🔍 Pattern Detection
|
|
32
|
+
📁 Files analyzed: 47
|
|
33
|
+
⚠️ Duplicate patterns: 12 files with 23 issues
|
|
34
|
+
💰 Wasted tokens: 8,450
|
|
35
|
+
|
|
36
|
+
📦 Context Analysis
|
|
37
|
+
📁 Files analyzed: 47
|
|
38
|
+
⚠️ High context cost: 8 files
|
|
39
|
+
🔗 Deep import chains: 5 files
|
|
40
|
+
```
|
|
18
41
|
|
|
19
|
-
|
|
42
|
+
### ✨ Smart Defaults (Zero Config)
|
|
43
|
+
|
|
44
|
+
- ✅ **Auto-excludes** test files (`**/*.test.*`, `**/*.spec.*`, `**/__tests__/**`)
|
|
45
|
+
- ✅ **Auto-excludes** build outputs (`dist/`, `build/`, `.next/`, `cdk.out/`)
|
|
46
|
+
- ✅ **Auto-excludes** dependencies (`node_modules/`)
|
|
47
|
+
- ✅ **Adaptive thresholds**: Adjusts issue detection based on codebase size
|
|
48
|
+
- ✅ **Unified reporting**: Combines results from all tools into one view
|
|
49
|
+
|
|
50
|
+
> Override defaults with `--include` or `--exclude` options as needed
|
|
51
|
+
|
|
52
|
+
## 📦 Commands
|
|
53
|
+
|
|
54
|
+
### Unified Scan
|
|
55
|
+
|
|
56
|
+
Run multiple analysis tools in one command:
|
|
20
57
|
|
|
21
58
|
```bash
|
|
22
59
|
aiready scan <directory>
|
|
23
60
|
```
|
|
24
61
|
|
|
62
|
+
**Options:**
|
|
63
|
+
- `-t, --tools <tools>`: Tools to run (comma-separated: patterns,context,consistency) (default: patterns,context)
|
|
64
|
+
- `--include <patterns>`: File patterns to include (comma-separated)
|
|
65
|
+
- `--exclude <patterns>`: File patterns to exclude (comma-separated)
|
|
66
|
+
- `-o, --output <format>`: Output format: console, json (default: console)
|
|
67
|
+
- `--output-file <path>`: Output file path (defaults to `.aiready/aiready-scan-YYYY-MM-DD.json`)
|
|
68
|
+
|
|
25
69
|
### Individual Tools
|
|
26
70
|
|
|
71
|
+
Access each tool directly for focused analysis:
|
|
72
|
+
|
|
27
73
|
#### Pattern Detection
|
|
28
74
|
|
|
29
75
|
```bash
|
|
30
76
|
aiready patterns <directory> [options]
|
|
31
77
|
```
|
|
32
78
|
|
|
33
|
-
Options
|
|
79
|
+
**Options:**
|
|
34
80
|
- `-s, --similarity <number>`: Minimum similarity score (0-1) (default: 0.40)
|
|
35
81
|
- `-l, --min-lines <number>`: Minimum lines to consider (default: 5)
|
|
36
82
|
- `--include <patterns>`: File patterns to include (comma-separated)
|
|
@@ -44,7 +90,7 @@ Options:
|
|
|
44
90
|
aiready context <directory> [options]
|
|
45
91
|
```
|
|
46
92
|
|
|
47
|
-
Options
|
|
93
|
+
**Options:**
|
|
48
94
|
- `--max-depth <number>`: Maximum acceptable import depth (default: 5)
|
|
49
95
|
- `--max-context <number>`: Maximum acceptable context budget (tokens) (default: 10000)
|
|
50
96
|
- `--include <patterns>`: File patterns to include (comma-separated)
|
|
@@ -52,34 +98,39 @@ Options:
|
|
|
52
98
|
- `-o, --output <format>`: Output format: console, json (default: console)
|
|
53
99
|
- `--output-file <path>`: Output file path (defaults to `.aiready/context-report-YYYY-MM-DD.json`)
|
|
54
100
|
|
|
55
|
-
|
|
101
|
+
#### Consistency Analysis
|
|
56
102
|
|
|
57
103
|
```bash
|
|
58
|
-
aiready
|
|
104
|
+
aiready consistency <directory> [options]
|
|
59
105
|
```
|
|
60
106
|
|
|
61
|
-
Options
|
|
62
|
-
- `-t, --tools <tools>`: Tools to run (comma-separated: patterns,context) (default: patterns,context)
|
|
107
|
+
**Options:**
|
|
63
108
|
- `--include <patterns>`: File patterns to include (comma-separated)
|
|
64
109
|
- `--exclude <patterns>`: File patterns to exclude (comma-separated)
|
|
65
110
|
- `-o, --output <format>`: Output format: console, json (default: console)
|
|
66
|
-
- `--output-file <path>`: Output file path (defaults to `.aiready/
|
|
111
|
+
- `--output-file <path>`: Output file path (defaults to `.aiready/consistency-report-YYYY-MM-DD.json`)
|
|
67
112
|
|
|
68
113
|
> **📁 Output Files:** By default, all output files are saved to the `.aiready/` directory in your project root with timestamped filenames. You can override this with `--output-file`.
|
|
69
114
|
|
|
70
|
-
## Examples
|
|
115
|
+
## 💡 Examples
|
|
71
116
|
|
|
72
|
-
###
|
|
117
|
+
### Basic Usage
|
|
73
118
|
|
|
74
119
|
```bash
|
|
75
|
-
# Analyze current directory with
|
|
120
|
+
# Analyze current directory with all tools
|
|
76
121
|
aiready scan .
|
|
77
122
|
|
|
123
|
+
# Run specific tools only
|
|
124
|
+
aiready scan . --tools patterns,context
|
|
125
|
+
|
|
78
126
|
# Analyze only patterns
|
|
79
127
|
aiready patterns .
|
|
80
128
|
|
|
81
129
|
# Analyze only context costs
|
|
82
130
|
aiready context .
|
|
131
|
+
|
|
132
|
+
# Analyze only consistency
|
|
133
|
+
aiready consistency .
|
|
83
134
|
```
|
|
84
135
|
|
|
85
136
|
### Advanced Usage
|
|
@@ -99,22 +150,12 @@ aiready scan . --output json --output-file custom-results.json
|
|
|
99
150
|
|
|
100
151
|
# Run only pattern analysis with custom similarity threshold
|
|
101
152
|
aiready patterns . --similarity 0.6 --min-lines 10
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Default Exclusions
|
|
105
|
-
|
|
106
|
-
By default, these common build and output directories are excluded from analysis:
|
|
107
|
-
|
|
108
|
-
- Dependencies: `**/node_modules/**`
|
|
109
|
-
- Build outputs: `**/dist/**`, `**/build/**`, `**/out/**`, `**/output/**`, etc.
|
|
110
|
-
- Framework caches: `**/.next/**`, `**/.nuxt/**`, `**/.cache/**`, `**/.turbo/**`
|
|
111
|
-
- Test/coverage: `**/coverage/**`, `**/.nyc_output/**`, `**/.jest/**`
|
|
112
|
-
- Version control/IDE: `**/.git/**`, `**/.vscode/**`, `**/.idea/**`
|
|
113
|
-
- Build artifacts: `**/*.min.js`, `**/*.bundle.js`, `**/*.tsbuildinfo`
|
|
114
153
|
|
|
115
|
-
|
|
154
|
+
# Run context analysis with custom thresholds
|
|
155
|
+
aiready context . --max-depth 3 --max-context 5000
|
|
156
|
+
```
|
|
116
157
|
|
|
117
|
-
|
|
158
|
+
## ⚙️ Configuration
|
|
118
159
|
|
|
119
160
|
AIReady supports configuration files to persist your settings. Create one of these files in your project root:
|
|
120
161
|
|
|
@@ -125,7 +166,7 @@ AIReady supports configuration files to persist your settings. Create one of the
|
|
|
125
166
|
- `aiready.config.js`
|
|
126
167
|
- `.aireadyrc.js`
|
|
127
168
|
|
|
128
|
-
|
|
169
|
+
### Example Configuration
|
|
129
170
|
|
|
130
171
|
```json
|
|
131
172
|
{
|
|
@@ -154,7 +195,7 @@ AIReady supports configuration files to persist your settings. Create one of the
|
|
|
154
195
|
|
|
155
196
|
Configuration values are merged with defaults, and CLI options take precedence over config file settings.
|
|
156
197
|
|
|
157
|
-
|
|
198
|
+
## 🔄 CI/CD Integration
|
|
158
199
|
|
|
159
200
|
```bash
|
|
160
201
|
# JSON output for automated processing
|
|
@@ -164,7 +205,7 @@ aiready scan . --output json --output-file aiready-results.json
|
|
|
164
205
|
aiready scan . && echo "No issues found" || echo "Issues detected"
|
|
165
206
|
```
|
|
166
207
|
|
|
167
|
-
## Output Formats
|
|
208
|
+
## 📊 Output Formats
|
|
168
209
|
|
|
169
210
|
### Console Output
|
|
170
211
|
|
|
@@ -178,12 +219,12 @@ Structured data including:
|
|
|
178
219
|
- Issue breakdowns
|
|
179
220
|
- Execution timing
|
|
180
221
|
|
|
181
|
-
## Exit Codes
|
|
222
|
+
## 🚦 Exit Codes
|
|
182
223
|
|
|
183
224
|
- `0`: Success, no critical issues
|
|
184
225
|
- `1`: Analysis failed or critical issues found
|
|
185
226
|
|
|
186
|
-
## Integration
|
|
227
|
+
## 🔗 Integration
|
|
187
228
|
|
|
188
229
|
The CLI is designed to integrate with:
|
|
189
230
|
- CI/CD pipelines
|
|
@@ -194,4 +235,8 @@ The CLI is designed to integrate with:
|
|
|
194
235
|
For programmatic usage, see the individual packages:
|
|
195
236
|
- [@aiready/pattern-detect](https://www.npmjs.com/package/@aiready/pattern-detect)
|
|
196
237
|
- [@aiready/context-analyzer](https://www.npmjs.com/package/@aiready/context-analyzer)
|
|
197
|
-
- [@aiready/consistency](https://www.npmjs.com/package/@aiready/consistency)
|
|
238
|
+
- [@aiready/consistency](https://www.npmjs.com/package/@aiready/consistency)
|
|
239
|
+
|
|
240
|
+
## 🌐 Visit Our Website
|
|
241
|
+
|
|
242
|
+
**Try AIReady tools online and learn more:** [getaiready.dev](https://getaiready.dev)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.13",
|
|
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": "^12.1.0",
|
|
13
13
|
"chalk": "^5.3.0",
|
|
14
|
-
"@aiready/core": "0.7.
|
|
15
|
-
"@aiready/
|
|
16
|
-
"@aiready/
|
|
17
|
-
"@aiready/
|
|
14
|
+
"@aiready/core": "0.7.5",
|
|
15
|
+
"@aiready/context-analyzer": "0.7.7",
|
|
16
|
+
"@aiready/consistency": "0.6.7",
|
|
17
|
+
"@aiready/pattern-detect": "0.9.11"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"tsup": "^8.3.5",
|
|
@@ -27,6 +27,14 @@
|
|
|
27
27
|
"code-analysis"
|
|
28
28
|
],
|
|
29
29
|
"license": "MIT",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/caopengau/aiready-cli.git"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/caopengau/aiready-cli",
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/caopengau/aiready-cli/issues"
|
|
37
|
+
},
|
|
30
38
|
"scripts": {
|
|
31
39
|
"build": "tsup src/index.ts src/cli.ts --format cjs,esm --dts",
|
|
32
40
|
"dev": "tsup src/index.ts src/cli.ts --format cjs,esm --dts --watch",
|