mycontext-cli 0.1.0
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/README.md +440 -0
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts +43 -0
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts.map +1 -0
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.js +1440 -0
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.js.map +1 -0
- package/dist/cli/src/agents/implementations/DocsSubAgent.d.ts +35 -0
- package/dist/cli/src/agents/implementations/DocsSubAgent.d.ts.map +1 -0
- package/dist/cli/src/agents/implementations/DocsSubAgent.js +351 -0
- package/dist/cli/src/agents/implementations/DocsSubAgent.js.map +1 -0
- package/dist/cli/src/agents/implementations/QASubAgent.d.ts +31 -0
- package/dist/cli/src/agents/implementations/QASubAgent.d.ts.map +1 -0
- package/dist/cli/src/agents/implementations/QASubAgent.js +190 -0
- package/dist/cli/src/agents/implementations/QASubAgent.js.map +1 -0
- package/dist/cli/src/agents/interfaces/SubAgent.d.ts +157 -0
- package/dist/cli/src/agents/interfaces/SubAgent.d.ts.map +1 -0
- package/dist/cli/src/agents/interfaces/SubAgent.js +7 -0
- package/dist/cli/src/agents/interfaces/SubAgent.js.map +1 -0
- package/dist/cli/src/agents/orchestrator/SubAgentOrchestrator.d.ts +59 -0
- package/dist/cli/src/agents/orchestrator/SubAgentOrchestrator.d.ts.map +1 -0
- package/dist/cli/src/agents/orchestrator/SubAgentOrchestrator.js +305 -0
- package/dist/cli/src/agents/orchestrator/SubAgentOrchestrator.js.map +1 -0
- package/dist/cli/src/agents/personalities/definitions.d.ts +34 -0
- package/dist/cli/src/agents/personalities/definitions.d.ts.map +1 -0
- package/dist/cli/src/agents/personalities/definitions.js +360 -0
- package/dist/cli/src/agents/personalities/definitions.js.map +1 -0
- package/dist/cli/src/cli.d.ts +3 -0
- package/dist/cli/src/cli.d.ts.map +1 -0
- package/dist/cli/src/cli.js +286 -0
- package/dist/cli/src/cli.js.map +1 -0
- package/dist/cli/src/commands/auth.d.ts +23 -0
- package/dist/cli/src/commands/auth.d.ts.map +1 -0
- package/dist/cli/src/commands/auth.js +212 -0
- package/dist/cli/src/commands/auth.js.map +1 -0
- package/dist/cli/src/commands/generate-components.d.ts +28 -0
- package/dist/cli/src/commands/generate-components.d.ts.map +1 -0
- package/dist/cli/src/commands/generate-components.js +680 -0
- package/dist/cli/src/commands/generate-components.js.map +1 -0
- package/dist/cli/src/commands/generate.d.ts +108 -0
- package/dist/cli/src/commands/generate.d.ts.map +1 -0
- package/dist/cli/src/commands/generate.js +1984 -0
- package/dist/cli/src/commands/generate.js.map +1 -0
- package/dist/cli/src/commands/init.d.ts +13 -0
- package/dist/cli/src/commands/init.d.ts.map +1 -0
- package/dist/cli/src/commands/init.js +91 -0
- package/dist/cli/src/commands/init.js.map +1 -0
- package/dist/cli/src/commands/list.d.ts +17 -0
- package/dist/cli/src/commands/list.d.ts.map +1 -0
- package/dist/cli/src/commands/list.js +209 -0
- package/dist/cli/src/commands/list.js.map +1 -0
- package/dist/cli/src/commands/preview.d.ts +23 -0
- package/dist/cli/src/commands/preview.d.ts.map +1 -0
- package/dist/cli/src/commands/preview.js +1200 -0
- package/dist/cli/src/commands/preview.js.map +1 -0
- package/dist/cli/src/commands/status.d.ts +21 -0
- package/dist/cli/src/commands/status.d.ts.map +1 -0
- package/dist/cli/src/commands/status.js +287 -0
- package/dist/cli/src/commands/status.js.map +1 -0
- package/dist/cli/src/commands/validate.d.ts +22 -0
- package/dist/cli/src/commands/validate.d.ts.map +1 -0
- package/dist/cli/src/commands/validate.js +259 -0
- package/dist/cli/src/commands/validate.js.map +1 -0
- package/dist/cli/src/types/index.d.ts +152 -0
- package/dist/cli/src/types/index.d.ts.map +1 -0
- package/dist/cli/src/types/index.js +3 -0
- package/dist/cli/src/types/index.js.map +1 -0
- package/dist/cli/src/utils/apiKeyManager.d.ts +137 -0
- package/dist/cli/src/utils/apiKeyManager.d.ts.map +1 -0
- package/dist/cli/src/utils/apiKeyManager.js +471 -0
- package/dist/cli/src/utils/apiKeyManager.js.map +1 -0
- package/dist/cli/src/utils/errorHandler.d.ts +105 -0
- package/dist/cli/src/utils/errorHandler.d.ts.map +1 -0
- package/dist/cli/src/utils/errorHandler.js +332 -0
- package/dist/cli/src/utils/errorHandler.js.map +1 -0
- package/dist/cli/src/utils/fileSystem.d.ts +58 -0
- package/dist/cli/src/utils/fileSystem.d.ts.map +1 -0
- package/dist/cli/src/utils/fileSystem.js +230 -0
- package/dist/cli/src/utils/fileSystem.js.map +1 -0
- package/dist/cli/src/utils/githubModels.d.ts +53 -0
- package/dist/cli/src/utils/githubModels.d.ts.map +1 -0
- package/dist/cli/src/utils/githubModels.js +239 -0
- package/dist/cli/src/utils/githubModels.js.map +1 -0
- package/dist/cli/src/utils/spinner.d.ts +28 -0
- package/dist/cli/src/utils/spinner.d.ts.map +1 -0
- package/dist/cli/src/utils/spinner.js +112 -0
- package/dist/cli/src/utils/spinner.js.map +1 -0
- package/dist/cli/src/utils/xaiClient.d.ts +59 -0
- package/dist/cli/src/utils/xaiClient.d.ts.map +1 -0
- package/dist/cli/src/utils/xaiClient.js +244 -0
- package/dist/cli/src/utils/xaiClient.js.map +1 -0
- package/dist/lib/analytics/usage-tracker.d.ts +125 -0
- package/dist/lib/analytics/usage-tracker.d.ts.map +1 -0
- package/dist/lib/analytics/usage-tracker.js +429 -0
- package/dist/lib/analytics/usage-tracker.js.map +1 -0
- package/package.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
# MyContext CLI
|
|
2
|
+
|
|
3
|
+
AI-powered component generation CLI for the MyContext platform. Transform your project ideas into production-ready UI components with a systematic, context-first approach.
|
|
4
|
+
|
|
5
|
+
## ๐ Quick Start
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Install globally
|
|
11
|
+
npm install -g mycontext-cli
|
|
12
|
+
|
|
13
|
+
# Or use pnpm
|
|
14
|
+
pnpm add -g mycontext-cli
|
|
15
|
+
|
|
16
|
+
# Or install locally and link
|
|
17
|
+
cd cli
|
|
18
|
+
pnpm link --global
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Basic Usage
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Set up API keys for AI providers (production-ready security)
|
|
25
|
+
mycontext auth setup
|
|
26
|
+
|
|
27
|
+
# Initialize a new project
|
|
28
|
+
mycontext init my-app --description "My awesome application"
|
|
29
|
+
|
|
30
|
+
# Generate context files (PRD, user stories, technical specs)
|
|
31
|
+
mycontext generate context
|
|
32
|
+
|
|
33
|
+
# Validate your PRD
|
|
34
|
+
mycontext validate prd
|
|
35
|
+
|
|
36
|
+
# Generate TypeScript types
|
|
37
|
+
mycontext generate types
|
|
38
|
+
|
|
39
|
+
# Generate component list (AI-driven)
|
|
40
|
+
mycontext generate components-list
|
|
41
|
+
|
|
42
|
+
# Check project status
|
|
43
|
+
mycontext status
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## ๐ Commands
|
|
47
|
+
|
|
48
|
+
### `mycontext init <project-name>`
|
|
49
|
+
|
|
50
|
+
Initialize a new MyContext project with proper directory structure.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
mycontext init todo-app --description "A simple todo application"
|
|
54
|
+
mycontext init ecommerce-app --description "Online store with shopping cart"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Options:**
|
|
58
|
+
|
|
59
|
+
- `--description <desc>` - Project description
|
|
60
|
+
- `--force` - Force reinitialization
|
|
61
|
+
- `--yes` - Skip all prompts (non-interactive mode)
|
|
62
|
+
|
|
63
|
+
### `mycontext generate <type>`
|
|
64
|
+
|
|
65
|
+
Generate various project assets using AI.
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Generate context files
|
|
69
|
+
mycontext generate context
|
|
70
|
+
|
|
71
|
+
# Generate TypeScript types
|
|
72
|
+
mycontext generate types
|
|
73
|
+
|
|
74
|
+
# Generate branding guidelines
|
|
75
|
+
mycontext generate brand
|
|
76
|
+
|
|
77
|
+
# Generate component list (AI-driven analysis)
|
|
78
|
+
mycontext generate components-list
|
|
79
|
+
|
|
80
|
+
# Generate individual components
|
|
81
|
+
mycontext generate components
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Types:**
|
|
85
|
+
|
|
86
|
+
- `context` - PRD, user stories, technical specifications
|
|
87
|
+
- `types` - TypeScript type definitions
|
|
88
|
+
- `brand` - Branding guidelines and design system
|
|
89
|
+
- `components-list` - AI-driven component planning and grouping
|
|
90
|
+
- `components` - Individual component generation
|
|
91
|
+
- `app-structure` - Application structure and routing
|
|
92
|
+
|
|
93
|
+
**Options:**
|
|
94
|
+
|
|
95
|
+
- `--use-claude-code-sdk` - Use Claude Code SDK for generation
|
|
96
|
+
- `--use-gemini` - Use Gemini for generation
|
|
97
|
+
- `--use-xai` - Use XAI (Grok) for generation
|
|
98
|
+
- `--temperature <number>` - Generation temperature (0-1)
|
|
99
|
+
- `--max-tokens <number>` - Maximum tokens for generation
|
|
100
|
+
|
|
101
|
+
### `mycontext validate <target>`
|
|
102
|
+
|
|
103
|
+
Validate PRD or other context files for quality and completeness.
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
mycontext validate prd
|
|
107
|
+
mycontext validate prd --file path/to/prd.md
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Options:**
|
|
111
|
+
|
|
112
|
+
- `--file <path>` - Specific file to validate
|
|
113
|
+
- `--interactive` - Interactive validation mode
|
|
114
|
+
|
|
115
|
+
### `mycontext list [type]`
|
|
116
|
+
|
|
117
|
+
List projects, components, files, or all resources.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
mycontext list all
|
|
121
|
+
mycontext list projects
|
|
122
|
+
mycontext list components
|
|
123
|
+
mycontext list files
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Types:**
|
|
127
|
+
|
|
128
|
+
- `all` - List everything (default)
|
|
129
|
+
- `projects` - List all projects
|
|
130
|
+
- `components` - List generated components
|
|
131
|
+
- `files` - List context files
|
|
132
|
+
|
|
133
|
+
**Options:**
|
|
134
|
+
|
|
135
|
+
- `--format <format>` - Output format (table, json, simple)
|
|
136
|
+
|
|
137
|
+
### `mycontext status`
|
|
138
|
+
|
|
139
|
+
Check project status and progress through development phases.
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
mycontext status
|
|
143
|
+
mycontext status --detailed
|
|
144
|
+
mycontext status --check-health
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Options:**
|
|
148
|
+
|
|
149
|
+
- `--detailed` - Show detailed status information
|
|
150
|
+
- `--check-health` - Perform health checks
|
|
151
|
+
|
|
152
|
+
### `mycontext auth`
|
|
153
|
+
|
|
154
|
+
Authenticate with the MyContext platform for enhanced features.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
mycontext auth
|
|
158
|
+
mycontext auth --yes # Non-interactive mode
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## ๐ Authentication & Security
|
|
162
|
+
|
|
163
|
+
### Enterprise-Grade API Key Management
|
|
164
|
+
|
|
165
|
+
MyContext CLI includes production-ready security features for managing AI provider API keys:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Interactive setup for all providers
|
|
169
|
+
mycontext auth setup
|
|
170
|
+
|
|
171
|
+
# Set up specific providers
|
|
172
|
+
mycontext auth setup --provider xai
|
|
173
|
+
mycontext auth setup --provider openai
|
|
174
|
+
mycontext auth setup --provider anthropic
|
|
175
|
+
mycontext auth setup --provider google
|
|
176
|
+
|
|
177
|
+
# List configured API keys
|
|
178
|
+
mycontext auth list
|
|
179
|
+
|
|
180
|
+
# Export keys for backup (password-protected)
|
|
181
|
+
mycontext auth export --password "secure-password"
|
|
182
|
+
|
|
183
|
+
# Import keys from backup
|
|
184
|
+
mycontext auth import --file backup.json --password "secure-password"
|
|
185
|
+
|
|
186
|
+
# Remove all API keys
|
|
187
|
+
mycontext auth clear
|
|
188
|
+
|
|
189
|
+
# Check authentication status
|
|
190
|
+
mycontext auth:status
|
|
191
|
+
|
|
192
|
+
# Remove authentication
|
|
193
|
+
mycontext auth:logout
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Security Features:**
|
|
197
|
+
- **AES-256-CBC Encryption** with PBKDF2 key derivation
|
|
198
|
+
- **Local Storage** in `~/.mycontext/api-keys.json`
|
|
199
|
+
- **Environment Variable Integration** - Automatically detects `XAI_API_KEY`, `OPENAI_API_KEY`, etc.
|
|
200
|
+
- **Password-Protected Backup/Restore**
|
|
201
|
+
- **Key Validation** - Tests API keys with provider endpoints
|
|
202
|
+
- **Rate Limiting Information** - Tracks usage and limits per provider
|
|
203
|
+
|
|
204
|
+
### Supported AI Providers
|
|
205
|
+
|
|
206
|
+
| Provider | Key Format | Environment Variable |
|
|
207
|
+
|----------|------------|---------------------|
|
|
208
|
+
| **XAI (Grok)** | `xai-*` | `XAI_API_KEY` |
|
|
209
|
+
| **OpenAI** | `sk-*` | `OPENAI_API_KEY` |
|
|
210
|
+
| **Anthropic** | `sk-ant-*` | `ANTHROPIC_API_KEY` |
|
|
211
|
+
| **Google AI** | Various | `GOOGLE_AI_API_KEY` |
|
|
212
|
+
|
|
213
|
+
## ๐๏ธ Project Structure
|
|
214
|
+
|
|
215
|
+
When you initialize a project, MyContext creates this structure:
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
my-app/
|
|
219
|
+
โโโ .mycontext/
|
|
220
|
+
โ โโโ config.json # Project configuration
|
|
221
|
+
โโโ context/
|
|
222
|
+
โโโ prd.md # Product Requirements Document
|
|
223
|
+
โโโ 01_PRD.md # Generated PRD (v2)
|
|
224
|
+
โโโ 02_user_stories.md # User stories and workflows
|
|
225
|
+
โโโ 03_technical_specs.md # Technical specifications
|
|
226
|
+
โโโ types.ts # TypeScript type definitions
|
|
227
|
+
โโโ branding.md # Branding guidelines (generated)
|
|
228
|
+
โโโ component-list.json # Component planning (generated)
|
|
229
|
+
โโโ component-list.md # Component planning (markdown)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## ๐ Development Workflow
|
|
233
|
+
|
|
234
|
+
MyContext follows a 4-phase development process:
|
|
235
|
+
|
|
236
|
+
### Phase 1: Context & Architecture
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
mycontext init my-app
|
|
240
|
+
mycontext generate context
|
|
241
|
+
mycontext validate prd
|
|
242
|
+
mycontext generate types
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Phase 2: Brand & Design System
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
mycontext generate brand
|
|
249
|
+
mycontext preview brand
|
|
250
|
+
mycontext generate components-list
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Phase 3: Component Generation
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
mycontext generate components
|
|
257
|
+
mycontext preview components
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Phase 4: Development Integration
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
mycontext list components
|
|
264
|
+
mycontext status
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## ๐ฏ Features
|
|
268
|
+
|
|
269
|
+
### Enterprise-Grade Security & Authentication
|
|
270
|
+
|
|
271
|
+
- **Production-Ready API Key Management** - AES-256-CBC encryption with PBKDF2
|
|
272
|
+
- **Multi-Provider Support** - XAI, OpenAI, Anthropic, Google AI
|
|
273
|
+
- **Secure Local Storage** - Encrypted storage in `~/.mycontext/api-keys.json`
|
|
274
|
+
- **Password-Protected Backup/Restore** - Secure key export/import
|
|
275
|
+
- **Environment Variable Integration** - Seamless CI/CD integration
|
|
276
|
+
|
|
277
|
+
### Context-First Development
|
|
278
|
+
|
|
279
|
+
- Start with deep understanding before generating code
|
|
280
|
+
- User story mapping for actionable components
|
|
281
|
+
- Building blocks that work across projects
|
|
282
|
+
|
|
283
|
+
### AI-Powered Generation
|
|
284
|
+
|
|
285
|
+
- **Production-Ready CLI** - Fully functional command-line interface
|
|
286
|
+
- **Multi-Provider AI Support** - Choose between XAI, OpenAI, Anthropic, or Google
|
|
287
|
+
- **Dynamic app analysis** - Automatically detects app type and generates appropriate components
|
|
288
|
+
- **Brand-compliant component generation** - Components follow your design system
|
|
289
|
+
- **Type-safe TypeScript interfaces** - Full type safety throughout
|
|
290
|
+
- **Robust Error Handling** - Comprehensive error management and recovery
|
|
291
|
+
|
|
292
|
+
### Dynamic Component Generation
|
|
293
|
+
|
|
294
|
+
MyContext uses intelligent analysis to generate app-specific components:
|
|
295
|
+
|
|
296
|
+
**Supported App Types:**
|
|
297
|
+
|
|
298
|
+
- **Ecommerce**: ProductList, ShoppingCart, CheckoutForm, OrderHistory, UserProfile
|
|
299
|
+
- **Dashboard**: DashboardOverview, DataGrid, AnalyticsCharts, MetricCards
|
|
300
|
+
- **Productivity**: TodoList, TaskDetail, ProjectManager, CalendarView
|
|
301
|
+
- **Weather**: WeatherForecast, WeatherHistory, LocationPicker
|
|
302
|
+
- **Finance**: TransactionList, BudgetOverview, ExpenseTracker
|
|
303
|
+
- **Social**: UserFeed, ProfileCard, CommentThread, SocialActions
|
|
304
|
+
|
|
305
|
+
**Example:**
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Ecommerce app
|
|
309
|
+
mycontext init ecommerce-app --description "Online store with shopping cart"
|
|
310
|
+
mycontext generate components-list
|
|
311
|
+
# Generates: ProductList, ShoppingCart, CheckoutForm, OrderHistory, UserProfile
|
|
312
|
+
|
|
313
|
+
# Dashboard app
|
|
314
|
+
mycontext init dashboard-app --description "Analytics dashboard"
|
|
315
|
+
mycontext generate components-list
|
|
316
|
+
# Generates: DashboardOverview, DataGrid, AnalyticsCharts, MetricCards
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Production-Ready Features
|
|
320
|
+
|
|
321
|
+
- **Comprehensive Test Suite** - 28+ passing unit tests
|
|
322
|
+
- **TypeScript Strict Mode** - Full type safety and validation
|
|
323
|
+
- **Enhanced Error Handling** - Structured error types with recovery suggestions
|
|
324
|
+
- **Interactive CLI Experience** - Modern prompts with progress feedback
|
|
325
|
+
- **Non-Interactive Mode** - Full automation support for CI/CD
|
|
326
|
+
|
|
327
|
+
### Project Management
|
|
328
|
+
|
|
329
|
+
- Status tracking through development phases
|
|
330
|
+
- File validation and health checks
|
|
331
|
+
- Resource discovery and listing
|
|
332
|
+
|
|
333
|
+
## ๐ง Configuration
|
|
334
|
+
|
|
335
|
+
### Global Options
|
|
336
|
+
|
|
337
|
+
- `--verbose` - Enable verbose logging
|
|
338
|
+
- `--project <name>` - Specify project name
|
|
339
|
+
- `--yes` - Skip all prompts (non-interactive mode)
|
|
340
|
+
|
|
341
|
+
### Environment Variables
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
# AI Provider API Keys (automatically detected)
|
|
345
|
+
export XAI_API_KEY="your-xai-key"
|
|
346
|
+
export OPENAI_API_KEY="your-openai-key"
|
|
347
|
+
export ANTHROPIC_API_KEY="your-anthropic-key"
|
|
348
|
+
export GOOGLE_AI_API_KEY="your-google-key"
|
|
349
|
+
|
|
350
|
+
# Optional: Custom API endpoint
|
|
351
|
+
export MYCONTEXT_API_ENDPOINT="https://custom-endpoint.com"
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## ๐งช Testing
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
# Test API key setup
|
|
358
|
+
mycontext auth setup --provider xai --key "test-key"
|
|
359
|
+
mycontext auth list
|
|
360
|
+
|
|
361
|
+
# Test project initialization
|
|
362
|
+
mycontext init test-app --description "Test application" --yes
|
|
363
|
+
|
|
364
|
+
# Test context generation
|
|
365
|
+
cd test-app
|
|
366
|
+
mycontext generate context --yes
|
|
367
|
+
|
|
368
|
+
# Test validation
|
|
369
|
+
mycontext validate prd --yes
|
|
370
|
+
|
|
371
|
+
# Test component list generation
|
|
372
|
+
mycontext generate components-list --yes
|
|
373
|
+
|
|
374
|
+
# Test status checking
|
|
375
|
+
mycontext status --detailed --yes
|
|
376
|
+
|
|
377
|
+
# Test authentication commands
|
|
378
|
+
mycontext auth:status
|
|
379
|
+
mycontext auth clear
|
|
380
|
+
|
|
381
|
+
# Clean up
|
|
382
|
+
cd ..
|
|
383
|
+
rm -rf test-app
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### Production Testing
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
# Test with real API keys
|
|
390
|
+
mycontext auth setup
|
|
391
|
+
mycontext init production-test --description "Production testing app"
|
|
392
|
+
cd production-test
|
|
393
|
+
|
|
394
|
+
# Test full workflow
|
|
395
|
+
mycontext generate context
|
|
396
|
+
mycontext validate prd
|
|
397
|
+
mycontext generate types
|
|
398
|
+
mycontext generate components-list
|
|
399
|
+
mycontext status --detailed
|
|
400
|
+
|
|
401
|
+
# Test component generation with AI
|
|
402
|
+
mycontext generate components --use-xai
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
## ๐ Documentation
|
|
406
|
+
|
|
407
|
+
- [Platform Overview](../README.md)
|
|
408
|
+
- [Architecture](../docs/architecture/overview.md)
|
|
409
|
+
- [CLI Implementation](../docs/cli/implementation.md)
|
|
410
|
+
- [XAI Integration](../docs/cli/xai-integration.md)
|
|
411
|
+
|
|
412
|
+
## ๐ค Contributing
|
|
413
|
+
|
|
414
|
+
1. Fork the repository
|
|
415
|
+
2. Create a feature branch
|
|
416
|
+
3. Make your changes
|
|
417
|
+
4. Add tests if applicable
|
|
418
|
+
5. Submit a pull request
|
|
419
|
+
|
|
420
|
+
## ๐ License
|
|
421
|
+
|
|
422
|
+
MIT License - see [LICENSE](../LICENSE) for details.
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
**MyContext CLI**: Where AI-generated code becomes a valuable, reusable asset rather than technical debt.
|
|
427
|
+
|
|
428
|
+
## ๐ Production Ready
|
|
429
|
+
|
|
430
|
+
**Current Status: PRODUCTION READY** โ
|
|
431
|
+
|
|
432
|
+
- **โ
28+ Passing Tests** - Comprehensive unit test coverage
|
|
433
|
+
- **โ
Enterprise Security** - AES-256-CBC encrypted API key management
|
|
434
|
+
- **โ
Multi-Provider AI** - XAI, OpenAI, Anthropic, Google AI support
|
|
435
|
+
- **โ
Robust Error Handling** - Structured error management with recovery
|
|
436
|
+
- **โ
TypeScript Strict Mode** - Full type safety throughout
|
|
437
|
+
- **โ
Production CLI** - All commands functional and tested
|
|
438
|
+
- **โ
CI/CD Ready** - Non-interactive mode for automation
|
|
439
|
+
|
|
440
|
+
The MyContext CLI is ready for production use with enterprise-grade security, comprehensive testing, and full TypeScript support. All core features are implemented and working.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeGenSubAgent Implementation
|
|
3
|
+
*
|
|
4
|
+
* Specialized sub-agent for generating production-ready React components and TypeScript code.
|
|
5
|
+
* Uses Claude Code for optimal code generation capabilities.
|
|
6
|
+
* Enhanced with shadcn/ui primitives and modern React patterns for Next.js 14+.
|
|
7
|
+
*/
|
|
8
|
+
import { SubAgent, ComponentGenerationInput, ComponentGenerationOutput } from "../interfaces/SubAgent";
|
|
9
|
+
export declare class CodeGenSubAgent implements SubAgent<ComponentGenerationInput, ComponentGenerationOutput> {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
personality: string;
|
|
13
|
+
llmProvider: string;
|
|
14
|
+
expertise: string[];
|
|
15
|
+
constructor();
|
|
16
|
+
run(input: ComponentGenerationInput): Promise<ComponentGenerationOutput>;
|
|
17
|
+
validate(input: ComponentGenerationInput): Promise<boolean>;
|
|
18
|
+
getStatus(): Promise<{
|
|
19
|
+
name: string;
|
|
20
|
+
status: "idle" | "running" | "completed" | "error";
|
|
21
|
+
lastRun?: Date;
|
|
22
|
+
executionTime?: number;
|
|
23
|
+
errorCount: number;
|
|
24
|
+
successCount: number;
|
|
25
|
+
}>;
|
|
26
|
+
private generateProductionReadyComponent;
|
|
27
|
+
private getReactImportsForType;
|
|
28
|
+
private getShadcnImportsForType;
|
|
29
|
+
private getCustomImportsForType;
|
|
30
|
+
private generateTypeDefinitions;
|
|
31
|
+
private generateDetailedPropsForType;
|
|
32
|
+
private generateExampleProps;
|
|
33
|
+
private generateEnhancedPropsDestructuring;
|
|
34
|
+
private generateProductionComponentLogic;
|
|
35
|
+
private generateAccessibleComponentJSX;
|
|
36
|
+
private generateProductionActionFunctions;
|
|
37
|
+
private extractDependencies;
|
|
38
|
+
private extractShadcnComponents;
|
|
39
|
+
private calculateQualityScore;
|
|
40
|
+
private generateComponentName;
|
|
41
|
+
private generateWithXAI;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=CodeGenSubAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeGenSubAgent.d.ts","sourceRoot":"","sources":["../../../../../src/agents/implementations/CodeGenSubAgent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAuChC,qBAAa,eACX,YAAW,QAAQ,CAAC,wBAAwB,EAAE,yBAAyB,CAAC;IAExE,IAAI,SAAqB;IACzB,WAAW,SACkG;IAC7G,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;;IAad,GAAG,CACP,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAuC/B,QAAQ,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC;IAwB3D,SAAS,IAAI,OAAO,CAAC;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;QACnD,OAAO,CAAC,EAAE,IAAI,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;YASY,gCAAgC;IA+G9C,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,uBAAuB;IAoI/B,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,uBAAuB;IA2E/B,OAAO,CAAC,4BAA4B;IAmIpC,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,kCAAkC;IA4E1C,OAAO,CAAC,gCAAgC;IAwIxC,OAAO,CAAC,8BAA8B;IAyetC,OAAO,CAAC,iCAAiC;IA0HzC,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,qBAAqB;IAoC7B,OAAO,CAAC,qBAAqB;YASf,eAAe;CAkC9B"}
|