@aiready/cli 0.9.12 → 0.9.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @aiready/cli@0.9.12 build /Users/pengcao/projects/aiready/packages/cli
3
+ > @aiready/cli@0.9.13 build /Users/pengcao/projects/aiready/packages/cli
4
4
  > tsup src/index.ts src/cli.ts --format cjs,esm
5
5
 
6
6
  CLI Building entry: src/cli.ts, src/index.ts
@@ -11,8 +11,8 @@
11
11
  ESM Build start
12
12
  CJS dist/cli.js 58.90 KB
13
13
  CJS dist/index.js 4.93 KB
14
- CJS ⚡️ Build success in 48ms
14
+ CJS ⚡️ Build success in 37ms
15
15
  ESM dist/index.mjs 138.00 B
16
- ESM dist/chunk-5GZDRZ3T.mjs 4.17 KB
17
16
  ESM dist/cli.mjs 51.71 KB
18
- ESM ⚡️ Build success in 49ms
17
+ ESM dist/chunk-5GZDRZ3T.mjs 4.17 KB
18
+ ESM ⚡️ Build success in 38ms
@@ -1,17 +1,17 @@
1
1
 
2
2
  
3
- > @aiready/cli@0.9.12 test /Users/pengcao/projects/aiready/packages/cli
3
+ > @aiready/cli@0.9.13 test /Users/pengcao/projects/aiready/packages/cli
4
4
  > vitest run
5
5
 
6
6
  [?25l
7
7
   RUN  v4.0.18 /Users/pengcao/projects/aiready/packages/cli
8
8
 
9
9
  ✓ src/__tests__/cli.test.ts (3 tests) 3ms
10
- ✓ dist/__tests__/cli.test.js (3 tests) 3ms
10
+ ✓ dist/__tests__/cli.test.js (3 tests) 5ms
11
11
 
12
12
   Test Files  2 passed (2)
13
13
   Tests  6 passed (6)
14
-  Start at  19:26:05
15
-  Duration  5.30s (transform 2.54s, setup 0ms, import 7.21s, tests 7ms, environment 3ms)
14
+  Start at  22:06:58
15
+  Duration  4.31s (transform 1.25s, setup 0ms, import 5.35s, tests 8ms, environment 15ms)
16
16
 
17
17
  [?25h
@@ -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.12",
3
+ "version": "0.9.13",
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.10",
15
- "@aiready/context-analyzer": "0.9.11",
16
- "@aiready/consistency": "0.8.11",
17
- "@aiready/core": "0.9.11",
18
- "@aiready/pattern-detect": "0.11.11"
14
+ "@aiready/visualizer": "0.1.11",
15
+ "@aiready/pattern-detect": "0.11.12",
16
+ "@aiready/context-analyzer": "0.9.12",
17
+ "@aiready/core": "0.9.12",
18
+ "@aiready/consistency": "0.8.12"
19
19
  },
20
20
  "devDependencies": {
21
21
  "tsup": "^8.3.5",