@aiready/cli 0.9.12 → 0.9.14
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 +4 -4
- package/.turbo/turbo-test.log +5 -5
- package/CONTRIBUTING.md +227 -0
- package/package.json +6 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.9.
|
|
3
|
+
> @aiready/cli@0.9.14 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
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[32mCJS[39m [1mdist/cli.js [22m[32m58.90 KB[39m
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m4.93 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 21ms
|
|
15
15
|
[32mESM[39m [1mdist/index.mjs [22m[32m138.00 B[39m
|
|
16
|
-
[32mESM[39m [1mdist/chunk-5GZDRZ3T.mjs [22m[32m4.17 KB[39m
|
|
17
16
|
[32mESM[39m [1mdist/cli.mjs [22m[32m51.71 KB[39m
|
|
18
|
-
[32mESM[39m
|
|
17
|
+
[32mESM[39m [1mdist/chunk-5GZDRZ3T.mjs [22m[32m4.17 KB[39m
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 20ms
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/cli@0.9.
|
|
3
|
+
> @aiready/cli@0.9.14 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
|
|
10
|
-
[32m✓[39m dist/__tests__/cli.test.js [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
9
|
+
[32m✓[39m src/__tests__/cli.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
10
|
+
[32m✓[39m dist/__tests__/cli.test.js [2m([22m[2m3 tests[22m[2m)[22m[32m 2[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 22:54:42
|
|
15
|
+
[2m Duration [22m 1.84s[2m (transform 1.01s, setup 0ms, import 2.36s, tests 6ms, environment 0ms)[22m
|
|
16
16
|
|
|
17
17
|
[?25h
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# Contributing to @aiready/cli
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to AIReady CLI! We welcome bug reports, feature requests, and code contributions.
|
|
4
|
+
|
|
5
|
+
## 🎯 What is the CLI?
|
|
6
|
+
|
|
7
|
+
The CLI is the **unified interface** for all AIReady analysis tools. It provides:
|
|
8
|
+
- **Unified scanning**: Run multiple tools (patterns, context, consistency) with one command
|
|
9
|
+
- **Individual tool access**: Use each tool directly for focused analysis
|
|
10
|
+
- **Consistent output**: Unified reporting across all tools
|
|
11
|
+
- **Configuration management**: Persist settings across runs
|
|
12
|
+
|
|
13
|
+
## 🏛️ Architecture
|
|
14
|
+
|
|
15
|
+
The CLI follows a **hub-and-spoke** pattern:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
🎯 USER
|
|
19
|
+
│
|
|
20
|
+
▼
|
|
21
|
+
┌─────────────────────────────────────────────────────────┐
|
|
22
|
+
│ 🎛️ CLI (@aiready/cli) │
|
|
23
|
+
│ Unified Interface & Orchestration │
|
|
24
|
+
└────────────────────────┬────────────────────────────────┘
|
|
25
|
+
│
|
|
26
|
+
▼
|
|
27
|
+
🏢 HUB (core)
|
|
28
|
+
│
|
|
29
|
+
┌───────────────┼───────────────┬───────────────┐
|
|
30
|
+
▼ ▼ ▼ ▼
|
|
31
|
+
📊 PATTERN 📦 CONTEXT 🔧 CONSIST 📚 DOC
|
|
32
|
+
DETECT ANALYZER ENCY DRIFT
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Key Principles
|
|
36
|
+
|
|
37
|
+
- **No spoke dependencies**: CLI only imports from `@aiready/core`
|
|
38
|
+
- **Spoke integration**: Each analysis tool is independent and imported as needed
|
|
39
|
+
- **Unified interface**: Consistent CLI options across all tools
|
|
40
|
+
|
|
41
|
+
## 🐛 Reporting Issues
|
|
42
|
+
|
|
43
|
+
Found a bug or have a feature request? [Open an issue](https://github.com/caopengau/aiready-cli/issues) with:
|
|
44
|
+
- Clear description of the problem or feature
|
|
45
|
+
- Steps to reproduce (for bugs)
|
|
46
|
+
- Expected vs actual behavior
|
|
47
|
+
- Your environment (Node version, OS)
|
|
48
|
+
|
|
49
|
+
## 🔧 Development Setup
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Clone your fork
|
|
53
|
+
git clone https://github.com/YOUR_USERNAME/aiready-cli
|
|
54
|
+
cd aiready-cli
|
|
55
|
+
|
|
56
|
+
# Install dependencies
|
|
57
|
+
pnpm install
|
|
58
|
+
|
|
59
|
+
# Build
|
|
60
|
+
pnpm build
|
|
61
|
+
|
|
62
|
+
# Run tests
|
|
63
|
+
pnpm test
|
|
64
|
+
|
|
65
|
+
# Link for local testing
|
|
66
|
+
pnpm link
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## 📝 Making Changes
|
|
70
|
+
|
|
71
|
+
1. **Fork the repository** and create a new branch:
|
|
72
|
+
```bash
|
|
73
|
+
git checkout -b fix/cli-output-format
|
|
74
|
+
# or
|
|
75
|
+
git checkout -b feat/new-tool-integration
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. **Make your changes** following our code style:
|
|
79
|
+
- Use TypeScript strict mode
|
|
80
|
+
- Add tests for new features
|
|
81
|
+
- Update README with new commands
|
|
82
|
+
- Keep commands modular and focused
|
|
83
|
+
|
|
84
|
+
3. **Test your changes**:
|
|
85
|
+
```bash
|
|
86
|
+
pnpm build
|
|
87
|
+
pnpm test
|
|
88
|
+
|
|
89
|
+
# Test CLI locally
|
|
90
|
+
./dist/cli.js scan /path/to/project
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
4. **Commit using conventional commits**:
|
|
94
|
+
```bash
|
|
95
|
+
git commit -m "fix: correct output format for JSON"
|
|
96
|
+
git commit -m "feat: add new tool integration"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
5. **Push and open a PR**:
|
|
100
|
+
```bash
|
|
101
|
+
git push origin feat/new-tool-integration
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 📋 Commit Convention
|
|
105
|
+
|
|
106
|
+
We use [Conventional Commits](https://www.conventionalcommits.org/):
|
|
107
|
+
|
|
108
|
+
- `feat:` - New feature (new command, option, or tool integration)
|
|
109
|
+
- `fix:` - Bug fix (output format, option handling)
|
|
110
|
+
- `docs:` - Documentation updates
|
|
111
|
+
- `perf:` - Performance improvements
|
|
112
|
+
- `refactor:` - Code restructuring
|
|
113
|
+
- `test:` - Test additions/updates
|
|
114
|
+
- `chore:` - Maintenance tasks
|
|
115
|
+
|
|
116
|
+
## 🧪 Testing Guidelines
|
|
117
|
+
|
|
118
|
+
- Add test cases in `src/__tests__/`
|
|
119
|
+
- Test CLI commands end-to-end
|
|
120
|
+
- Verify output formats (console, JSON)
|
|
121
|
+
- Test edge cases (missing arguments, invalid paths)
|
|
122
|
+
|
|
123
|
+
Example test:
|
|
124
|
+
```typescript
|
|
125
|
+
test('scan command runs all tools by default', async () => {
|
|
126
|
+
const result = await runCli(['scan', './test-project']);
|
|
127
|
+
expect(result.stdout).toContain('Pattern Detection');
|
|
128
|
+
expect(result.stdout).toContain('Context Analysis');
|
|
129
|
+
expect(result.exitCode).toBe(0);
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## 🏗️ Architecture
|
|
134
|
+
|
|
135
|
+
### Directory Structure
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
src/
|
|
139
|
+
├── commands/
|
|
140
|
+
│ ├── scan.ts # Unified scan command
|
|
141
|
+
│ ├── patterns.ts # Pattern detection command
|
|
142
|
+
│ ├── context.ts # Context analysis command
|
|
143
|
+
│ └── consistency.ts # Consistency check command
|
|
144
|
+
├── options/
|
|
145
|
+
│ ├── global.ts # Global CLI options
|
|
146
|
+
│ └── tools.ts # Tool-specific options
|
|
147
|
+
├── output/
|
|
148
|
+
│ ├── formatter.ts # Output formatting
|
|
149
|
+
│ └── reporter.ts # Result reporting
|
|
150
|
+
├── integration/
|
|
151
|
+
│ └── tools.ts # Tool invocation logic
|
|
152
|
+
├── types.ts # Type definitions
|
|
153
|
+
├── cli.ts # CLI entry point
|
|
154
|
+
└── index.ts # Public API exports
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Adding a New Command
|
|
158
|
+
|
|
159
|
+
1. Create `src/commands/your-command.ts`:
|
|
160
|
+
```typescript
|
|
161
|
+
import { Command } from 'commander';
|
|
162
|
+
import { globalOptions } from '../options/global';
|
|
163
|
+
|
|
164
|
+
export const yourCommand = new Command('your-command')
|
|
165
|
+
.description('Description of your command')
|
|
166
|
+
.argument('<directory>', 'Directory to analyze')
|
|
167
|
+
.option('-o, --output <format>', 'Output format')
|
|
168
|
+
.action(async (directory, options) => {
|
|
169
|
+
// Your implementation
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
2. Register in `src/cli.ts`
|
|
174
|
+
|
|
175
|
+
3. Add tests in `src/__tests__/`
|
|
176
|
+
|
|
177
|
+
4. Document in README.md
|
|
178
|
+
|
|
179
|
+
### Integrating a New Tool
|
|
180
|
+
|
|
181
|
+
1. Ensure the tool follows the CLI spec (--output, --include, --exclude)
|
|
182
|
+
2. Import the tool in `src/integration/tools.ts`
|
|
183
|
+
3. Add tool name to the valid tools list
|
|
184
|
+
4. Update scan command to include the new tool
|
|
185
|
+
5. Document in README.md
|
|
186
|
+
|
|
187
|
+
## 🎯 Areas for Contribution
|
|
188
|
+
|
|
189
|
+
Great places to start:
|
|
190
|
+
- **New commands**: Add new CLI commands
|
|
191
|
+
- **Tool integration**: Integrate new analysis tools
|
|
192
|
+
- **Output formats**: Add new output options (XML, CSV, HTML)
|
|
193
|
+
- **Configuration**: Improve config file handling
|
|
194
|
+
- **Performance**: Optimize for large codebases
|
|
195
|
+
- **Documentation**: Usage examples, tutorials
|
|
196
|
+
|
|
197
|
+
## 🔍 Code Review
|
|
198
|
+
|
|
199
|
+
- All checks must pass (build, tests, lint)
|
|
200
|
+
- Maintainers review within 2 business days
|
|
201
|
+
- Address feedback and update PR
|
|
202
|
+
- Once approved, we'll merge and publish
|
|
203
|
+
|
|
204
|
+
## 📚 Documentation
|
|
205
|
+
|
|
206
|
+
- Update README.md for new commands
|
|
207
|
+
- Document new CLI options
|
|
208
|
+
- Include usage examples
|
|
209
|
+
- Add to website documentation
|
|
210
|
+
|
|
211
|
+
## 💡 Feature Ideas
|
|
212
|
+
|
|
213
|
+
Looking for inspiration? Consider:
|
|
214
|
+
- Interactive mode with guided analysis
|
|
215
|
+
- Watch mode for file changes
|
|
216
|
+
- IDE plugins integration
|
|
217
|
+
- CI/CD report generation
|
|
218
|
+
- Export to different formats
|
|
219
|
+
- Multi-project scanning
|
|
220
|
+
|
|
221
|
+
## ❓ Questions?
|
|
222
|
+
|
|
223
|
+
Open an issue or reach out to the maintainers. We're here to help!
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
**Thank you for helping make AI-ready code accessible to everyone!** 💙
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.14",
|
|
4
4
|
"description": "Unified CLI for AIReady analysis tools",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"commander": "^14.0.0",
|
|
13
13
|
"chalk": "^5.3.0",
|
|
14
|
-
"@aiready/visualizer": "0.1.
|
|
15
|
-
"@aiready/
|
|
16
|
-
"@aiready/
|
|
17
|
-
"@aiready/
|
|
18
|
-
"@aiready/
|
|
14
|
+
"@aiready/visualizer": "0.1.12",
|
|
15
|
+
"@aiready/pattern-detect": "0.11.13",
|
|
16
|
+
"@aiready/core": "0.9.13",
|
|
17
|
+
"@aiready/context-analyzer": "0.9.13",
|
|
18
|
+
"@aiready/consistency": "0.8.13"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"tsup": "^8.3.5",
|