mycontext-cli 0.1.2 โ 0.2.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 +264 -71
- package/dist/agents/implementations/CodeGenSubAgent.d.ts +48 -0
- package/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -0
- package/dist/agents/implementations/CodeGenSubAgent.js +1356 -0
- package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -0
- package/dist/agents/implementations/DocsSubAgent.d.ts +35 -0
- package/dist/agents/implementations/DocsSubAgent.d.ts.map +1 -0
- package/dist/agents/implementations/DocsSubAgent.js +351 -0
- package/dist/agents/implementations/DocsSubAgent.js.map +1 -0
- package/dist/agents/implementations/EnhancementAgent.d.ts +119 -0
- package/dist/agents/implementations/EnhancementAgent.d.ts.map +1 -0
- package/dist/agents/implementations/EnhancementAgent.js +598 -0
- package/dist/agents/implementations/EnhancementAgent.js.map +1 -0
- package/dist/agents/implementations/QASubAgent.d.ts +31 -0
- package/dist/agents/implementations/QASubAgent.d.ts.map +1 -0
- package/dist/agents/implementations/QASubAgent.js +190 -0
- package/dist/agents/implementations/QASubAgent.js.map +1 -0
- package/dist/agents/interfaces/SubAgent.d.ts +287 -0
- package/dist/agents/interfaces/SubAgent.d.ts.map +1 -0
- package/dist/agents/interfaces/SubAgent.js +7 -0
- package/dist/agents/interfaces/SubAgent.js.map +1 -0
- package/dist/agents/orchestrator/SubAgentOrchestrator.d.ts +59 -0
- package/dist/agents/orchestrator/SubAgentOrchestrator.d.ts.map +1 -0
- package/dist/agents/orchestrator/SubAgentOrchestrator.js +305 -0
- package/dist/agents/orchestrator/SubAgentOrchestrator.js.map +1 -0
- package/dist/agents/personalities/definitions.d.ts +32 -0
- package/dist/agents/personalities/definitions.d.ts.map +1 -0
- package/dist/agents/personalities/definitions.js +359 -0
- package/dist/agents/personalities/definitions.js.map +1 -0
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts +1 -0
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.js +25 -91
- package/dist/cli/src/agents/implementations/CodeGenSubAgent.js.map +1 -1
- package/dist/cli/src/agents/implementations/EnhancementAgent.d.ts +120 -0
- package/dist/cli/src/agents/implementations/EnhancementAgent.d.ts.map +1 -0
- package/dist/cli/src/agents/implementations/EnhancementAgent.js +606 -0
- package/dist/cli/src/agents/implementations/EnhancementAgent.js.map +1 -0
- package/dist/cli/src/agents/interfaces/SubAgent.d.ts +130 -0
- package/dist/cli/src/agents/interfaces/SubAgent.d.ts.map +1 -1
- package/dist/cli/src/agents/personalities/definitions.d.ts +1 -1
- package/dist/cli/src/agents/personalities/definitions.d.ts.map +1 -1
- package/dist/cli/src/agents/personalities/definitions.js +31 -2
- package/dist/cli/src/agents/personalities/definitions.js.map +1 -1
- package/dist/cli/src/cli.js +12 -0
- package/dist/cli/src/cli.js.map +1 -1
- package/dist/cli/src/commands/enhance.d.ts +28 -0
- package/dist/cli/src/commands/enhance.d.ts.map +1 -0
- package/dist/cli/src/commands/enhance.js +246 -0
- package/dist/cli/src/commands/enhance.js.map +1 -0
- package/dist/cli/src/commands/generate-components.d.ts +0 -1
- package/dist/cli/src/commands/generate-components.d.ts.map +1 -1
- package/dist/cli/src/commands/generate-components.js +2 -2
- package/dist/cli/src/commands/generate-components.js.map +1 -1
- package/dist/cli/src/commands/generate.d.ts.map +1 -1
- package/dist/cli/src/commands/generate.js +8 -22
- package/dist/cli/src/commands/generate.js.map +1 -1
- package/dist/cli/src/commands/list.d.ts.map +1 -1
- package/dist/cli/src/commands/list.js +2 -1
- package/dist/cli/src/commands/list.js.map +1 -1
- package/dist/cli/src/commands/model.d.ts +25 -0
- package/dist/cli/src/commands/model.d.ts.map +1 -0
- package/dist/cli/src/commands/model.js +317 -0
- package/dist/cli/src/commands/model.js.map +1 -0
- package/dist/cli/src/commands/setup.d.ts +35 -0
- package/dist/cli/src/commands/setup.d.ts.map +1 -0
- package/dist/cli/src/commands/setup.js +412 -0
- package/dist/cli/src/commands/setup.js.map +1 -0
- package/dist/cli/src/config/dependencies.json +180 -0
- package/dist/cli/src/utils/componentValidator.d.ts +60 -0
- package/dist/cli/src/utils/componentValidator.d.ts.map +1 -0
- package/dist/cli/src/utils/componentValidator.js +191 -0
- package/dist/cli/src/utils/componentValidator.js.map +1 -0
- package/dist/cli/src/utils/designTokenExtractor.d.ts +94 -0
- package/dist/cli/src/utils/designTokenExtractor.d.ts.map +1 -0
- package/dist/cli/src/utils/designTokenExtractor.js +231 -0
- package/dist/cli/src/utils/designTokenExtractor.js.map +1 -0
- package/dist/cli/src/utils/ollamaClient.d.ts +37 -0
- package/dist/cli/src/utils/ollamaClient.d.ts.map +1 -0
- package/dist/cli/src/utils/ollamaClient.js +213 -0
- package/dist/cli/src/utils/ollamaClient.js.map +1 -0
- package/dist/cli/src/utils/spinner.d.ts +2 -0
- package/dist/cli/src/utils/spinner.d.ts.map +1 -1
- package/dist/cli/src/utils/spinner.js +7 -0
- package/dist/cli/src/utils/spinner.js.map +1 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +299 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/auth.d.ts +23 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +212 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/enhance.d.ts +25 -0
- package/dist/commands/enhance.d.ts.map +1 -0
- package/dist/commands/enhance.js +242 -0
- package/dist/commands/enhance.js.map +1 -0
- package/dist/commands/generate-components.d.ts +27 -0
- package/dist/commands/generate-components.d.ts.map +1 -0
- package/dist/commands/generate-components.js +680 -0
- package/dist/commands/generate-components.js.map +1 -0
- package/dist/commands/generate.d.ts +23 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +222 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +91 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +17 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +210 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/model.d.ts +25 -0
- package/dist/commands/model.d.ts.map +1 -0
- package/dist/commands/model.js +317 -0
- package/dist/commands/model.js.map +1 -0
- package/dist/commands/preview.d.ts +23 -0
- package/dist/commands/preview.d.ts.map +1 -0
- package/dist/commands/preview.js +1200 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/commands/setup.d.ts +35 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +412 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/status.d.ts +21 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +287 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/validate.d.ts +22 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +259 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/types/index.d.ts +154 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/apiKeyManager.d.ts +137 -0
- package/dist/utils/apiKeyManager.d.ts.map +1 -0
- package/dist/utils/apiKeyManager.js +471 -0
- package/dist/utils/apiKeyManager.js.map +1 -0
- package/dist/utils/componentValidator.d.ts +60 -0
- package/dist/utils/componentValidator.d.ts.map +1 -0
- package/dist/utils/componentValidator.js +191 -0
- package/dist/utils/componentValidator.js.map +1 -0
- package/dist/utils/designTokenExtractor.d.ts +94 -0
- package/dist/utils/designTokenExtractor.d.ts.map +1 -0
- package/dist/utils/designTokenExtractor.js +231 -0
- package/dist/utils/designTokenExtractor.js.map +1 -0
- package/dist/utils/errorHandler.d.ts +105 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/errorHandler.js +332 -0
- package/dist/utils/errorHandler.js.map +1 -0
- package/dist/utils/fileSystem.d.ts +58 -0
- package/dist/utils/fileSystem.d.ts.map +1 -0
- package/dist/utils/fileSystem.js +230 -0
- package/dist/utils/fileSystem.js.map +1 -0
- package/dist/utils/githubModels.d.ts +53 -0
- package/dist/utils/githubModels.d.ts.map +1 -0
- package/dist/utils/githubModels.js +239 -0
- package/dist/utils/githubModels.js.map +1 -0
- package/dist/utils/ollamaClient.d.ts +37 -0
- package/dist/utils/ollamaClient.d.ts.map +1 -0
- package/dist/utils/ollamaClient.js +213 -0
- package/dist/utils/ollamaClient.js.map +1 -0
- package/dist/utils/spinner.d.ts +30 -0
- package/dist/utils/spinner.d.ts.map +1 -0
- package/dist/utils/spinner.js +119 -0
- package/dist/utils/spinner.js.map +1 -0
- package/package.json +11 -9
package/README.md
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
# MyContext CLI
|
|
2
2
|
|
|
3
|
+
**The Micro-Tool That Does Heavy Lifting** ๐
|
|
4
|
+
|
|
3
5
|
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
6
|
|
|
7
|
+
> **Why MyContext CLI?** A lightweight, self-contained tool that generates unlimited React components locally with zero ongoing costs. Perfect for developers who want AI-powered development without subscription fees.
|
|
8
|
+
|
|
9
|
+
## ๐ฐ Pricing Model
|
|
10
|
+
|
|
11
|
+
**Sustainable, Affordable Plans** - Because we're a micro-tool with zero ongoing costs:
|
|
12
|
+
|
|
13
|
+
- **$1/month** - Basic CLI access
|
|
14
|
+
- **$5/month** - Advanced features + priority support
|
|
15
|
+
- **$10/month** - Enterprise features + team collaboration
|
|
16
|
+
|
|
17
|
+
_No API costs, no usage limits, no hidden fees. You control your own AI infrastructure._
|
|
18
|
+
|
|
5
19
|
## ๐ Quick Start
|
|
6
20
|
|
|
7
21
|
### Installation
|
|
@@ -17,12 +31,19 @@ pnpm add -g mycontext-cli
|
|
|
17
31
|
yarn global add mycontext-cli
|
|
18
32
|
```
|
|
19
33
|
|
|
20
|
-
###
|
|
34
|
+
### First-Time Setup
|
|
21
35
|
|
|
22
36
|
```bash
|
|
23
|
-
# Set up
|
|
37
|
+
# Set up local AI environment (recommended - ZERO ongoing costs)
|
|
38
|
+
mycontext setup
|
|
39
|
+
|
|
40
|
+
# Or set up API keys for cloud-based generation (optional)
|
|
24
41
|
mycontext auth setup
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Basic Usage
|
|
25
45
|
|
|
46
|
+
```bash
|
|
26
47
|
# Initialize a new project
|
|
27
48
|
mycontext init my-app --description "My awesome application"
|
|
28
49
|
|
|
@@ -38,12 +59,77 @@ mycontext generate types
|
|
|
38
59
|
# Generate component list (AI-driven)
|
|
39
60
|
mycontext generate components-list
|
|
40
61
|
|
|
62
|
+
# Generate React components (using your local AI - FREE)
|
|
63
|
+
mycontext generate-components all
|
|
64
|
+
|
|
65
|
+
# Enhance existing components
|
|
66
|
+
mycontext enhance TodoApp.tsx --prompt "Make it more accessible"
|
|
67
|
+
|
|
41
68
|
# Check project status
|
|
42
69
|
mycontext status
|
|
43
70
|
```
|
|
44
71
|
|
|
72
|
+
## ๐ฏ Why This Architecture Works
|
|
73
|
+
|
|
74
|
+
### **Micro-Tool, Massive Value**
|
|
75
|
+
|
|
76
|
+
- **Tiny CLI** (~10MB) - Easy to install and update
|
|
77
|
+
- **Local AI Generation** - Zero API costs, unlimited usage
|
|
78
|
+
- **User-Controlled Setup** - Each developer manages their own Ollama
|
|
79
|
+
- **Sustainable Pricing** - No ongoing infrastructure costs to pass on
|
|
80
|
+
|
|
81
|
+
### **Smart Dependency Management**
|
|
82
|
+
|
|
83
|
+
- **Ollama Runtime** - Users install locally (platform-native)
|
|
84
|
+
- **Specialized Models** - We provide the MyContext-optimized AI model
|
|
85
|
+
- **Health Checks** - CLI validates everything works
|
|
86
|
+
- **Fallback Options** - Cloud APIs available if needed
|
|
87
|
+
|
|
45
88
|
## ๐ Commands
|
|
46
89
|
|
|
90
|
+
### `mycontext setup`
|
|
91
|
+
|
|
92
|
+
Set up your local AI environment with Ollama and specialized models.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Interactive setup
|
|
96
|
+
mycontext setup
|
|
97
|
+
|
|
98
|
+
# Force local setup
|
|
99
|
+
mycontext setup --local
|
|
100
|
+
|
|
101
|
+
# Skip prompts
|
|
102
|
+
mycontext setup --skip-prompts
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Features:**
|
|
106
|
+
|
|
107
|
+
- **Automatic Ollama Installation** - Installs Ollama runtime for your platform
|
|
108
|
+
- **Specialized Model Creation** - Creates MyContext-optimized AI model
|
|
109
|
+
- **Health Checks** - Validates installation and model functionality
|
|
110
|
+
- **Fallback Options** - Always provides cloud-based alternatives
|
|
111
|
+
|
|
112
|
+
### `mycontext model`
|
|
113
|
+
|
|
114
|
+
Manage your local AI models and monitor performance.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Check model status
|
|
118
|
+
mycontext model status
|
|
119
|
+
|
|
120
|
+
# Test model generation
|
|
121
|
+
mycontext model test
|
|
122
|
+
|
|
123
|
+
# Update model
|
|
124
|
+
mycontext model update
|
|
125
|
+
|
|
126
|
+
# Reset model
|
|
127
|
+
mycontext model reset
|
|
128
|
+
|
|
129
|
+
# View statistics
|
|
130
|
+
mycontext model stats
|
|
131
|
+
```
|
|
132
|
+
|
|
47
133
|
### `mycontext init <project-name>`
|
|
48
134
|
|
|
49
135
|
Initialize a new MyContext project with proper directory structure.
|
|
@@ -78,6 +164,9 @@ mycontext generate components-list
|
|
|
78
164
|
|
|
79
165
|
# Generate individual components
|
|
80
166
|
mycontext generate components
|
|
167
|
+
|
|
168
|
+
# Generate app structure
|
|
169
|
+
mycontext generate app-structure
|
|
81
170
|
```
|
|
82
171
|
|
|
83
172
|
**Types:**
|
|
@@ -89,13 +178,66 @@ mycontext generate components
|
|
|
89
178
|
- `components` - Individual component generation
|
|
90
179
|
- `app-structure` - Application structure and routing
|
|
91
180
|
|
|
181
|
+
### Command Options
|
|
182
|
+
|
|
183
|
+
- `--yes` - Skip all prompts and use defaults
|
|
184
|
+
- `--verbose` - Show detailed output
|
|
185
|
+
- `--debug` - Enable debug logging
|
|
186
|
+
- `--temperature` - Set AI generation temperature (0.1-1.0)
|
|
187
|
+
- `--group` - Specify component group for generation
|
|
188
|
+
- `--prompt` - Custom enhancement prompt
|
|
189
|
+
- `--output` - Output directory for generated files
|
|
190
|
+
|
|
191
|
+
### `mycontext generate-components <target>`
|
|
192
|
+
|
|
193
|
+
Generate React components using AI.
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# Generate all components
|
|
197
|
+
mycontext generate-components all
|
|
198
|
+
|
|
199
|
+
# Generate specific component group
|
|
200
|
+
mycontext generate-components group --group "authentication"
|
|
201
|
+
|
|
202
|
+
# Generate single component
|
|
203
|
+
mycontext generate-components component --name "UserProfile" --description "User profile display component"
|
|
204
|
+
|
|
205
|
+
# Generate with custom temperature
|
|
206
|
+
mycontext generate-components all --temperature 0.7
|
|
207
|
+
```
|
|
208
|
+
|
|
92
209
|
**Options:**
|
|
93
210
|
|
|
94
|
-
- `--
|
|
95
|
-
- `--
|
|
211
|
+
- `--group <name>` - Generate specific component group
|
|
212
|
+
- `--all` - Generate all components
|
|
213
|
+
- `--output <path>` - Output directory
|
|
214
|
+
- `--template <name>` - Use specific template
|
|
96
215
|
- `--use-xai` - Use XAI (Grok) for generation
|
|
97
|
-
- `--
|
|
98
|
-
|
|
216
|
+
- `--yes` - Skip prompts
|
|
217
|
+
|
|
218
|
+
### `mycontext enhance <target>`
|
|
219
|
+
|
|
220
|
+
Enhance existing React components with AI-powered improvements.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Enhance specific component
|
|
224
|
+
mycontext enhance Button.tsx --prompt "Add loading states"
|
|
225
|
+
|
|
226
|
+
# Enhance all components
|
|
227
|
+
mycontext enhance components --prompt "Improve accessibility"
|
|
228
|
+
|
|
229
|
+
# Enhance with custom temperature
|
|
230
|
+
mycontext enhance components --prompt "Add error handling" --temperature 0.8
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Options:**
|
|
234
|
+
|
|
235
|
+
- `--prompt <text>` - Enhancement instructions
|
|
236
|
+
- `--use-xai` - Use XAI (Grok) for enhancement
|
|
237
|
+
- `--temperature <number>` - Generation temperature
|
|
238
|
+
- `--max-tokens <number>` - Maximum tokens
|
|
239
|
+
- `--credits <number>` - Credit limit
|
|
240
|
+
- `--yes` - Skip prompts
|
|
99
241
|
|
|
100
242
|
### `mycontext validate <target>`
|
|
101
243
|
|
|
@@ -159,56 +301,77 @@ mycontext auth --yes # Non-interactive mode
|
|
|
159
301
|
|
|
160
302
|
## ๐ Authentication & Security
|
|
161
303
|
|
|
162
|
-
###
|
|
304
|
+
### Local AI Model Management
|
|
163
305
|
|
|
164
|
-
MyContext CLI includes production-ready security features for managing
|
|
306
|
+
MyContext CLI includes production-ready security features for managing your local AI environment:
|
|
165
307
|
|
|
166
308
|
```bash
|
|
167
|
-
#
|
|
168
|
-
mycontext
|
|
309
|
+
# Set up local AI environment
|
|
310
|
+
mycontext setup
|
|
311
|
+
|
|
312
|
+
# Check model status
|
|
313
|
+
mycontext model status
|
|
314
|
+
|
|
315
|
+
# Test model generation
|
|
316
|
+
mycontext model test
|
|
317
|
+
|
|
318
|
+
# Update specialized model
|
|
319
|
+
mycontext model update
|
|
320
|
+
|
|
321
|
+
# View model statistics
|
|
322
|
+
mycontext model stats
|
|
323
|
+
```
|
|
169
324
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
325
|
+
**Security Features:**
|
|
326
|
+
|
|
327
|
+
- **Local AI Only** - Your code never leaves your machine
|
|
328
|
+
- **Specialized Models** - MyContext-optimized AI models for React/Shadcn
|
|
329
|
+
- **No API Keys Required** - Zero external dependencies
|
|
330
|
+
- **Complete Privacy** - All processing happens locally
|
|
331
|
+
- **Model Validation** - CLI validates model functionality and health
|
|
332
|
+
|
|
333
|
+
### Specialized MyContext Models
|
|
175
334
|
|
|
176
|
-
|
|
177
|
-
mycontext
|
|
335
|
+
- **mycontext-react** - Specialized for React component generation
|
|
336
|
+
- **mycontext-architect** - Specialized for project architecture and context
|
|
337
|
+
- **Custom Models** - Create your own specialized models for specific use cases
|
|
178
338
|
|
|
179
|
-
|
|
180
|
-
mycontext auth export --password "secure-password"
|
|
339
|
+
## ๐ค Local AI Models
|
|
181
340
|
|
|
182
|
-
|
|
183
|
-
mycontext auth import --file backup.json --password "secure-password"
|
|
341
|
+
### Ollama Integration
|
|
184
342
|
|
|
185
|
-
|
|
186
|
-
mycontext auth clear
|
|
343
|
+
MyContext CLI includes seamless integration with Ollama for local AI generation:
|
|
187
344
|
|
|
188
|
-
|
|
189
|
-
|
|
345
|
+
```bash
|
|
346
|
+
# Check if Ollama is available
|
|
347
|
+
mycontext model status
|
|
348
|
+
|
|
349
|
+
# Test local model generation
|
|
350
|
+
mycontext model test
|
|
190
351
|
|
|
191
|
-
#
|
|
192
|
-
mycontext
|
|
352
|
+
# Monitor model performance
|
|
353
|
+
mycontext model stats
|
|
193
354
|
```
|
|
194
355
|
|
|
195
|
-
**
|
|
356
|
+
**Benefits:**
|
|
196
357
|
|
|
197
|
-
- **
|
|
198
|
-
- **
|
|
199
|
-
- **
|
|
200
|
-
- **
|
|
201
|
-
- **Key Validation** - Tests API keys with provider endpoints
|
|
202
|
-
- **Rate Limiting Information** - Tracks usage and limits per provider
|
|
358
|
+
- **Zero API Costs** - Generate unlimited components locally
|
|
359
|
+
- **Instant Generation** - No network latency
|
|
360
|
+
- **Complete Privacy** - Your code never leaves your machine
|
|
361
|
+
- **Specialized Models** - Models trained specifically for MyContext patterns
|
|
203
362
|
|
|
204
|
-
###
|
|
363
|
+
### Model Management
|
|
205
364
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
365
|
+
```bash
|
|
366
|
+
# Update base model
|
|
367
|
+
mycontext model update
|
|
368
|
+
|
|
369
|
+
# Reset to clean state
|
|
370
|
+
mycontext model reset
|
|
371
|
+
|
|
372
|
+
# View detailed statistics
|
|
373
|
+
mycontext model stats --detailed
|
|
374
|
+
```
|
|
212
375
|
|
|
213
376
|
## ๐๏ธ Project Structure
|
|
214
377
|
|
|
@@ -218,15 +381,20 @@ When you initialize a project, MyContext creates this structure:
|
|
|
218
381
|
my-app/
|
|
219
382
|
โโโ .mycontext/
|
|
220
383
|
โ โโโ config.json # Project configuration
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
384
|
+
โโโ context/
|
|
385
|
+
โ โโโ prd.md # Product Requirements Document
|
|
386
|
+
โ โโโ 01_PRD.md # Generated PRD (v2)
|
|
387
|
+
โ โโโ 02_user_stories.md # User stories and workflows
|
|
388
|
+
โ โโโ 03_technical_specs.md # Technical specifications
|
|
389
|
+
โ โโโ types.ts # TypeScript type definitions
|
|
390
|
+
โ โโโ branding.md # Branding guidelines (generated)
|
|
391
|
+
โ โโโ component-list.json # Component planning (generated)
|
|
392
|
+
โ โโโ component-list.md # Component planning (markdown)
|
|
393
|
+
โโโ components/
|
|
394
|
+
โโโ generated/ # Generated React components
|
|
395
|
+
โโโ core-todo/ # Main app components
|
|
396
|
+
โโโ forms-input/ # Form components
|
|
397
|
+
โโโ layout-ui/ # Layout components
|
|
230
398
|
```
|
|
231
399
|
|
|
232
400
|
## ๐ Development Workflow
|
|
@@ -253,7 +421,7 @@ mycontext generate components-list
|
|
|
253
421
|
### Phase 3: Component Generation
|
|
254
422
|
|
|
255
423
|
```bash
|
|
256
|
-
mycontext generate
|
|
424
|
+
mycontext generate-components all
|
|
257
425
|
mycontext preview components
|
|
258
426
|
```
|
|
259
427
|
|
|
@@ -262,6 +430,7 @@ mycontext preview components
|
|
|
262
430
|
```bash
|
|
263
431
|
mycontext list components
|
|
264
432
|
mycontext status
|
|
433
|
+
mycontext enhance components
|
|
265
434
|
```
|
|
266
435
|
|
|
267
436
|
## ๐ฏ Features
|
|
@@ -269,11 +438,26 @@ mycontext status
|
|
|
269
438
|
### Enterprise-Grade Security & Authentication
|
|
270
439
|
|
|
271
440
|
- **Production-Ready API Key Management** - AES-256-CBC encryption with PBKDF2
|
|
272
|
-
- **Multi-Provider Support** - XAI, OpenAI, Anthropic, Google AI
|
|
273
441
|
- **Secure Local Storage** - Encrypted storage in `~/.mycontext/api-keys.json`
|
|
274
442
|
- **Password-Protected Backup/Restore** - Secure key export/import
|
|
275
443
|
- **Environment Variable Integration** - Seamless CI/CD integration
|
|
276
444
|
|
|
445
|
+
### Local AI Generation
|
|
446
|
+
|
|
447
|
+
- **Ollama Integration** - Seamless local AI model management
|
|
448
|
+
- **Specialized Models** - MyContext-optimized AI models
|
|
449
|
+
- **Zero API Costs** - Generate unlimited components locally
|
|
450
|
+
- **Complete Privacy** - Your code never leaves your machine
|
|
451
|
+
- **Performance Monitoring** - Track model performance and usage
|
|
452
|
+
|
|
453
|
+
### Business Model Benefits
|
|
454
|
+
|
|
455
|
+
- **Sustainable Pricing** - $1/$5/$10 plans because we have zero ongoing costs
|
|
456
|
+
- **Unlimited Usage** - No API rate limits or usage quotas
|
|
457
|
+
- **User Control** - Each developer manages their own AI infrastructure
|
|
458
|
+
- **Scalable Growth** - More users = more revenue, not more costs
|
|
459
|
+
- **Enterprise Ready** - Teams can run their own Ollama instances
|
|
460
|
+
|
|
277
461
|
### Context-First Development
|
|
278
462
|
|
|
279
463
|
- Start with deep understanding before generating code
|
|
@@ -283,11 +467,13 @@ mycontext status
|
|
|
283
467
|
### AI-Powered Generation
|
|
284
468
|
|
|
285
469
|
- **Production-Ready CLI** - Fully functional command-line interface
|
|
286
|
-
- **
|
|
470
|
+
- **Specialized Local AI Models** - MyContext-optimized models for specific tasks
|
|
471
|
+
- **Local AI Generation** - Ollama integration for cost-free generation
|
|
287
472
|
- **Dynamic app analysis** - Automatically detects app type and generates appropriate components
|
|
288
473
|
- **Brand-compliant component generation** - Components follow your design system
|
|
289
474
|
- **Type-safe TypeScript interfaces** - Full type safety throughout
|
|
290
475
|
- **Robust Error Handling** - Comprehensive error management and recovery
|
|
476
|
+
- **Component Enhancement** - AI-powered refinement of existing components
|
|
291
477
|
|
|
292
478
|
### Dynamic Component Generation
|
|
293
479
|
|
|
@@ -323,12 +509,14 @@ mycontext generate components-list
|
|
|
323
509
|
- **Enhanced Error Handling** - Structured error types with recovery suggestions
|
|
324
510
|
- **Interactive CLI Experience** - Modern prompts with progress feedback
|
|
325
511
|
- **Non-Interactive Mode** - Full automation support for CI/CD
|
|
512
|
+
- **Local AI Models** - Ollama integration for cost-free generation
|
|
326
513
|
|
|
327
514
|
### Project Management
|
|
328
515
|
|
|
329
516
|
- Status tracking through development phases
|
|
330
517
|
- File validation and health checks
|
|
331
518
|
- Resource discovery and listing
|
|
519
|
+
- Component enhancement and iteration
|
|
332
520
|
|
|
333
521
|
## ๐ง Configuration
|
|
334
522
|
|
|
@@ -341,22 +529,20 @@ mycontext generate components-list
|
|
|
341
529
|
### Environment Variables
|
|
342
530
|
|
|
343
531
|
```bash
|
|
344
|
-
#
|
|
345
|
-
export
|
|
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"
|
|
532
|
+
# Ollama configuration
|
|
533
|
+
export OLLAMA_BASE_URL="http://localhost:11434"
|
|
349
534
|
|
|
350
|
-
# Optional: Custom API endpoint
|
|
535
|
+
# Optional: Custom MyContext API endpoint (for enterprise features)
|
|
351
536
|
export MYCONTEXT_API_ENDPOINT="https://custom-endpoint.com"
|
|
352
537
|
```
|
|
353
538
|
|
|
354
539
|
## ๐งช Testing
|
|
355
540
|
|
|
356
541
|
```bash
|
|
357
|
-
# Test
|
|
358
|
-
mycontext
|
|
359
|
-
mycontext
|
|
542
|
+
# Test local setup
|
|
543
|
+
mycontext setup --yes
|
|
544
|
+
mycontext model status
|
|
545
|
+
mycontext model test
|
|
360
546
|
|
|
361
547
|
# Test project initialization
|
|
362
548
|
mycontext init test-app --description "Test application" --yes
|
|
@@ -371,13 +557,15 @@ mycontext validate prd --yes
|
|
|
371
557
|
# Test component list generation
|
|
372
558
|
mycontext generate components-list --yes
|
|
373
559
|
|
|
560
|
+
# Test component generation (requires Ollama)
|
|
561
|
+
mycontext generate-components all --yes
|
|
562
|
+
|
|
563
|
+
# Test component enhancement
|
|
564
|
+
mycontext enhance components --prompt "Add loading states" --yes
|
|
565
|
+
|
|
374
566
|
# Test status checking
|
|
375
567
|
mycontext status --detailed --yes
|
|
376
568
|
|
|
377
|
-
# Test authentication commands
|
|
378
|
-
mycontext auth:status
|
|
379
|
-
mycontext auth clear
|
|
380
|
-
|
|
381
569
|
# Clean up
|
|
382
570
|
cd ..
|
|
383
571
|
rm -rf test-app
|
|
@@ -386,8 +574,8 @@ rm -rf test-app
|
|
|
386
574
|
### Production Testing
|
|
387
575
|
|
|
388
576
|
```bash
|
|
389
|
-
# Test with
|
|
390
|
-
mycontext
|
|
577
|
+
# Test with Ollama installed
|
|
578
|
+
mycontext setup
|
|
391
579
|
mycontext init production-test --description "Production testing app"
|
|
392
580
|
cd production-test
|
|
393
581
|
|
|
@@ -396,10 +584,11 @@ mycontext generate context
|
|
|
396
584
|
mycontext validate prd
|
|
397
585
|
mycontext generate types
|
|
398
586
|
mycontext generate components-list
|
|
587
|
+
mycontext generate-components all
|
|
399
588
|
mycontext status --detailed
|
|
400
589
|
|
|
401
|
-
# Test component
|
|
402
|
-
mycontext
|
|
590
|
+
# Test component enhancement
|
|
591
|
+
mycontext enhance components --prompt "Improve accessibility"
|
|
403
592
|
```
|
|
404
593
|
|
|
405
594
|
## ๐ค Contributing
|
|
@@ -416,4 +605,8 @@ MIT License - see [LICENSE](LICENSE) for details.
|
|
|
416
605
|
|
|
417
606
|
---
|
|
418
607
|
|
|
419
|
-
**MyContext CLI**: Where AI-generated code becomes a valuable, reusable asset rather than technical debt.
|
|
608
|
+
**MyContext CLI**: The micro-tool that does heavy lifting. Where AI-generated code becomes a valuable, reusable asset rather than technical debt.
|
|
609
|
+
|
|
610
|
+
**Sustainable Pricing Model**: $1/$5/$10 plans because we have zero ongoing costs. You control your own AI infrastructure.
|
|
611
|
+
|
|
612
|
+
**Local AI Generation**: Generate unlimited components with zero API costs and complete privacy.
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
traits: string[];
|
|
14
|
+
llmProvider: string;
|
|
15
|
+
expertise: string[];
|
|
16
|
+
modelName: string;
|
|
17
|
+
temperature: number;
|
|
18
|
+
maxTokens: number;
|
|
19
|
+
systemPrompt: string;
|
|
20
|
+
constructor();
|
|
21
|
+
run(input: ComponentGenerationInput): Promise<ComponentGenerationOutput>;
|
|
22
|
+
validate(input: ComponentGenerationInput): Promise<boolean>;
|
|
23
|
+
getStatus(): Promise<{
|
|
24
|
+
name: string;
|
|
25
|
+
status: "idle" | "running" | "completed" | "error";
|
|
26
|
+
lastRun?: Date;
|
|
27
|
+
executionTime?: number;
|
|
28
|
+
errorCount: number;
|
|
29
|
+
successCount: number;
|
|
30
|
+
}>;
|
|
31
|
+
private generateProductionReadyComponent;
|
|
32
|
+
private getReactImportsForType;
|
|
33
|
+
private getShadcnImportsForType;
|
|
34
|
+
private getCustomImportsForType;
|
|
35
|
+
private generateTypeDefinitions;
|
|
36
|
+
private generateDetailedPropsForType;
|
|
37
|
+
private generateExampleProps;
|
|
38
|
+
private generateEnhancedPropsDestructuring;
|
|
39
|
+
private generateProductionComponentLogic;
|
|
40
|
+
private generateAccessibleComponentJSX;
|
|
41
|
+
private generateProductionActionFunctions;
|
|
42
|
+
private extractDependencies;
|
|
43
|
+
private extractShadcnComponents;
|
|
44
|
+
private calculateQualityScore;
|
|
45
|
+
private generateComponentName;
|
|
46
|
+
private generateWithOllama;
|
|
47
|
+
}
|
|
48
|
+
//# 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,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;;IAkBf,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;IAS9C,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,kBAAkB;CA0CjC"}
|