mycontext-cli 2.0.1 โ 2.0.2
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/dist/README.md +388 -0
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/dist/README.md
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
# MyContext CLI
|
|
2
|
+
|
|
3
|
+
**๐ง AI-Powered Full-Stack App Generation with Production-Ready Guarantees**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/mycontext-cli)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
|
+
|
|
9
|
+
Generate complete Next.js applications from natural language with **guaranteed zero linter/build errors** through AI-powered validation gates and automatic build checking.
|
|
10
|
+
|
|
11
|
+
## ๐ Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Install globally
|
|
15
|
+
npm install -g mycontext-cli
|
|
16
|
+
|
|
17
|
+
# Build a complete app in one command
|
|
18
|
+
mycontext build-app --description "Your app idea" --interactive
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## ๐ก Philosophy: "LLM as Compiler"
|
|
22
|
+
|
|
23
|
+
MyContext treats AI as a **compiler** that transforms requirements into production-ready code:
|
|
24
|
+
- **You write the spec** โ PRD with user approval gates
|
|
25
|
+
- **AI compiles it** โ Generates components with validation
|
|
26
|
+
- **System validates** โ TypeScript, ESLint, build checks
|
|
27
|
+
- **You approve** โ 12+ validation checkpoints
|
|
28
|
+
|
|
29
|
+
**Result:** Production-ready code with 0 errors guaranteed.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## ๐ Examples
|
|
34
|
+
|
|
35
|
+
### Tic-Tac-Toe Game
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
mycontext build-app \
|
|
39
|
+
--description "Tic-tac-toe with AI opponent, score tracking, and responsive design" \
|
|
40
|
+
--interactive \
|
|
41
|
+
--with-tests
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Generated:**
|
|
45
|
+
- Game board component
|
|
46
|
+
- AI opponent (minimax algorithm)
|
|
47
|
+
- Score tracking system
|
|
48
|
+
- Reset functionality
|
|
49
|
+
- Responsive Tailwind design
|
|
50
|
+
- Unit tests
|
|
51
|
+
|
|
52
|
+
### E-Commerce Platform
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
mycontext build-app \
|
|
56
|
+
--description "E-commerce with product catalog, shopping cart, checkout, and admin dashboard" \
|
|
57
|
+
--interactive \
|
|
58
|
+
--complete-architecture
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Generated:**
|
|
62
|
+
- Product listing & detail pages
|
|
63
|
+
- Shopping cart with persistence
|
|
64
|
+
- Checkout flow
|
|
65
|
+
- Admin dashboard
|
|
66
|
+
- Server actions for CRUD
|
|
67
|
+
- Next.js App Router routes
|
|
68
|
+
- Full TypeScript types
|
|
69
|
+
|
|
70
|
+
### Todo App with Auth
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
mycontext build-app \
|
|
74
|
+
--description "Todo app with user auth, categories, due dates, and dark mode" \
|
|
75
|
+
--interactive \
|
|
76
|
+
--with-tests
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## ๐ฏ Features
|
|
82
|
+
|
|
83
|
+
### โ
230-Step Validated Workflow
|
|
84
|
+
|
|
85
|
+
Every app goes through **12 validation gates** where you approve:
|
|
86
|
+
1. Features specification
|
|
87
|
+
2. User flows
|
|
88
|
+
3. Edge cases
|
|
89
|
+
4. Technical specs
|
|
90
|
+
5. **PRD (must read entire document)**
|
|
91
|
+
6. TypeScript types
|
|
92
|
+
7. Branding & design system
|
|
93
|
+
8. Build strategy
|
|
94
|
+
9. Component list
|
|
95
|
+
10. Server actions (if full-stack)
|
|
96
|
+
11. Routes (if full-stack)
|
|
97
|
+
12. Final build validation
|
|
98
|
+
|
|
99
|
+
### ๐จ Automatic Build Validation
|
|
100
|
+
|
|
101
|
+
**Every component** automatically passes through:
|
|
102
|
+
- โ
TypeScript check (`tsc --noEmit`)
|
|
103
|
+
- โ
ESLint validation
|
|
104
|
+
- โ
Build check (`npm run build`)
|
|
105
|
+
- โ
Unit tests (if `--with-tests`)
|
|
106
|
+
|
|
107
|
+
**Failed components retry automatically** with error context (max 3 attempts).
|
|
108
|
+
|
|
109
|
+
### ๐ Real-Time Progress Tracking
|
|
110
|
+
|
|
111
|
+
Track build progress via JSON files in `.mycontext/progress/`:
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"currentPhase": "component_generation",
|
|
115
|
+
"currentStep": 95,
|
|
116
|
+
"totalSteps": 230,
|
|
117
|
+
"percentComplete": 41.3
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Perfect for VS Code extensions & dashboards.**
|
|
122
|
+
|
|
123
|
+
### ๐๏ธ Complete Architecture Generation
|
|
124
|
+
|
|
125
|
+
Generate full-stack apps with `--complete-architecture`:
|
|
126
|
+
- Next.js 15 App Router routes
|
|
127
|
+
- Server actions with validation
|
|
128
|
+
- Self-documenting components
|
|
129
|
+
- Type-safe throughout
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## ๐ Commands
|
|
134
|
+
|
|
135
|
+
### Build Complete App (Recommended)
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
mycontext build-app --description "Your app" --interactive
|
|
139
|
+
|
|
140
|
+
# Options:
|
|
141
|
+
--output <dir> # Output directory (default: mycontext-app)
|
|
142
|
+
--interactive # Interactive mode with validation prompts
|
|
143
|
+
--with-tests # Generate unit tests
|
|
144
|
+
--complete-architecture # Generate server actions + routes
|
|
145
|
+
--architecture-type # nextjs-app-router | nextjs-pages | react-spa
|
|
146
|
+
--max-retries 3 # Max retry attempts
|
|
147
|
+
--verbose # Show detailed output
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Step-by-Step Workflow
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# 1. Initialize project
|
|
154
|
+
mycontext init my-app
|
|
155
|
+
|
|
156
|
+
# 2. Generate context files (with validation gates)
|
|
157
|
+
mycontext generate-context-files --description "Your app"
|
|
158
|
+
|
|
159
|
+
# 3. Compile PRD (requires approval)
|
|
160
|
+
mycontext compile-prd
|
|
161
|
+
|
|
162
|
+
# 4. Generate components (with build validation)
|
|
163
|
+
mycontext generate-components all --with-tests
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Other Commands
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
mycontext setup # Configure AI providers
|
|
170
|
+
mycontext build-strategy # Interactive strategy selection
|
|
171
|
+
mycontext analyze # Analyze existing project
|
|
172
|
+
mycontext list [type] # List components/projects
|
|
173
|
+
mycontext preview <type> # Preview components
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## โ๏ธ Configuration
|
|
179
|
+
|
|
180
|
+
### API Keys (BYOK Model)
|
|
181
|
+
|
|
182
|
+
MyContext uses **your own API keys** - no billing from us.
|
|
183
|
+
|
|
184
|
+
**Recommended providers:**
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Claude (best for complex reasoning)
|
|
188
|
+
echo 'MYCONTEXT_CLAUDE_API_KEY=sk-ant-xxx' > .mycontext/.env
|
|
189
|
+
|
|
190
|
+
# X.AI Grok (best for code generation)
|
|
191
|
+
echo 'MYCONTEXT_XAI_API_KEY=xai-xxx' > .mycontext/.env
|
|
192
|
+
|
|
193
|
+
# OpenAI (most versatile)
|
|
194
|
+
echo 'MYCONTEXT_OPENAI_API_KEY=sk-xxx' > .mycontext/.env
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Free tier:**
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# Qwen3 (free via OpenRouter)
|
|
201
|
+
echo 'MYCONTEXT_QWEN_API_KEY=sk-or-xxx' > .mycontext/.env
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Project Structure
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
my-app/
|
|
208
|
+
โโโ .mycontext/
|
|
209
|
+
โ โโโ 01-prd.md # Product Requirements
|
|
210
|
+
โ โโโ 02-a-features.md # Features
|
|
211
|
+
โ โโโ 02-b-user-flows.md # User flows
|
|
212
|
+
โ โโโ 02-c-edge-cases.md # Edge cases
|
|
213
|
+
โ โโโ 02-d-technical-specs.md # Tech specs
|
|
214
|
+
โ โโโ 03-types.ts # TypeScript types
|
|
215
|
+
โ โโโ 04-branding.md # Branding
|
|
216
|
+
โ โโโ 05-component-list.json # Component list
|
|
217
|
+
โ โโโ progress/ # Progress tracking
|
|
218
|
+
โ โ โโโ master.json # Master progress
|
|
219
|
+
โ โ โโโ 07-components/ # Per-component progress
|
|
220
|
+
โ โโโ .env # API keys
|
|
221
|
+
โโโ components/ # Generated components
|
|
222
|
+
โโโ actions/ # Server actions (--complete-architecture)
|
|
223
|
+
โโโ app/ # Routes (--complete-architecture)
|
|
224
|
+
โโโ package.json
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## ๐ How It Works
|
|
230
|
+
|
|
231
|
+
### 1. Context Generation
|
|
232
|
+
AI generates detailed context files based on your description. **You approve each one.**
|
|
233
|
+
|
|
234
|
+
### 2. PRD Compilation
|
|
235
|
+
Context files are compiled into a comprehensive PRD. **You must read and approve.**
|
|
236
|
+
|
|
237
|
+
### 3. Component Generation
|
|
238
|
+
Components are generated from PRD. **Each component automatically validated:**
|
|
239
|
+
```
|
|
240
|
+
๐จ Generating: LoginForm
|
|
241
|
+
โ
Code Generated
|
|
242
|
+
โ
TypeScript Check Passed
|
|
243
|
+
โ
ESLint Passed
|
|
244
|
+
โ
Build Passed
|
|
245
|
+
โ
Tests Passed
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### 4. Error Recovery
|
|
249
|
+
Failed components retry with error context:
|
|
250
|
+
```
|
|
251
|
+
โ TypeScript check failed (3 errors)
|
|
252
|
+
- LoginForm.tsx:12:5 - TS2322: Type 'string' not assignable to 'number'
|
|
253
|
+
|
|
254
|
+
๐ Retry 1/3 (with error context)
|
|
255
|
+
โ
Fixed and validated
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### 5. Production Deploy
|
|
259
|
+
```bash
|
|
260
|
+
cd my-app
|
|
261
|
+
npm run build # โ
Zero errors guaranteed
|
|
262
|
+
vercel deploy # ๐ Deploy
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## ๐ง Advanced Usage
|
|
268
|
+
|
|
269
|
+
### Build Strategy Selection
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
mycontext build-strategy --recommend
|
|
273
|
+
|
|
274
|
+
# AI asks about:
|
|
275
|
+
- Project type (client work, personal, MVP, etc.)
|
|
276
|
+
- Complexity (simple, medium, complex)
|
|
277
|
+
- Timeline (urgent, moderate, flexible)
|
|
278
|
+
- Team size (solo, small, large)
|
|
279
|
+
|
|
280
|
+
# Recommends best approach:
|
|
281
|
+
๐ฏ Vertical Slice - Build complete features end-to-end
|
|
282
|
+
โฐ Time to first demo: 2-3 weeks
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Complete Architecture
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
mycontext build-app \
|
|
289
|
+
--description "Blog platform" \
|
|
290
|
+
--complete-architecture \
|
|
291
|
+
--architecture-type nextjs-app-router
|
|
292
|
+
|
|
293
|
+
# Generates:
|
|
294
|
+
# - app/blog/[slug]/page.tsx
|
|
295
|
+
# - actions/createPost.ts
|
|
296
|
+
# - actions/updatePost.ts
|
|
297
|
+
# - components/BlogPost.tsx
|
|
298
|
+
# - Full type system
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Existing Project Migration
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
mycontext analyze # Analyze existing project
|
|
305
|
+
mycontext migrate --all # Migrate to MyContext structure
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## ๐ Build Metrics
|
|
311
|
+
|
|
312
|
+
After successful build:
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
๐ Workflow Complete!
|
|
316
|
+
|
|
317
|
+
๐ Summary:
|
|
318
|
+
Duration: 12m 34s
|
|
319
|
+
Total Steps: 230/230
|
|
320
|
+
User Approvals: 12
|
|
321
|
+
Retries: 3
|
|
322
|
+
|
|
323
|
+
โ
Build Checks:
|
|
324
|
+
TypeScript: 30 passed, 0 failed
|
|
325
|
+
ESLint: 30 passed, 0 failed
|
|
326
|
+
Build: 30 passed, 0 failed
|
|
327
|
+
Tests: 28 passed, 0 failed
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**Zero failures = Production-ready**
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## ๐ MyContext vs Others
|
|
335
|
+
|
|
336
|
+
| Feature | MyContext | Lovable | v0.dev |
|
|
337
|
+
|---------|-----------|---------|--------|
|
|
338
|
+
| **Code Location** | Your machine | Cloud | Cloud |
|
|
339
|
+
| **Validation Gates** | 12+ checkpoints | None | None |
|
|
340
|
+
| **Build Validation** | Every component | None | None |
|
|
341
|
+
| **TypeScript Guarantee** | 100% | No | No |
|
|
342
|
+
| **Pricing** | BYOK ($0-20/mo) | $20-200/mo | Usage-based |
|
|
343
|
+
| **Deployment** | Anywhere | Limited | Vercel only |
|
|
344
|
+
| **Progress Tracking** | JSON files | None | None |
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## ๐ Documentation
|
|
349
|
+
|
|
350
|
+
- [Complete Workflow](https://github.com/farajabien/mycontext-monorepo/blob/main/docs/BUILD_APP_PROCESS.md) - 230-step process
|
|
351
|
+
- [Integration Guide](https://github.com/farajabien/mycontext-monorepo/blob/main/docs/IMPLEMENTATION_SUMMARY.md) - VS Code integration
|
|
352
|
+
- [Quick Start](https://github.com/farajabien/mycontext-monorepo/blob/main/docs/QUICK_START_BUILD_APP.md) - User guide
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## ๐ Troubleshooting
|
|
357
|
+
|
|
358
|
+
**"PRD Validation Failed"**
|
|
359
|
+
```bash
|
|
360
|
+
# Provide feedback and regenerate
|
|
361
|
+
mycontext compile-prd --force
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
**"Component Build Failed"**
|
|
365
|
+
```bash
|
|
366
|
+
# Automatic retry with error context (max 3 attempts)
|
|
367
|
+
# Check .mycontext/progress/07-components/<component>.json
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**"Progress Not Tracking"**
|
|
371
|
+
```bash
|
|
372
|
+
# Verify progress directory exists
|
|
373
|
+
ls -la .mycontext/progress/
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## ๐ค Contributing
|
|
379
|
+
|
|
380
|
+
See [CONTRIBUTING.md](https://github.com/farajabien/mycontext-monorepo/blob/main/CONTRIBUTING.md)
|
|
381
|
+
|
|
382
|
+
## ๐ License
|
|
383
|
+
|
|
384
|
+
MIT ยฉ MyContext
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
**Built by developers, for developers. Your code stays on your machine.** ๐
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mycontext-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "MyContext CLI - AI-powered full-stack application generator with complete architecture generation, server actions, Next.js 15 App Router, and self-documenting components",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"build": "npm run build:clean && npm run build:compile && npm run build:copy",
|
|
12
12
|
"build:clean": "rm -rf dist && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐งน Cleaned build directory')",
|
|
13
13
|
"build:compile": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐จ Compiling TypeScript...') && tsc --noEmitOnError false",
|
|
14
|
-
"build:copy": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐ Copying config files...') && cp -r src/config dist/ && cp package.json dist/ && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo 'โ
Build complete')",
|
|
14
|
+
"build:copy": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐ Copying config files...') && cp -r src/config dist/ && cp package.json dist/ && cp README.md dist/ && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo 'โ
Build complete')",
|
|
15
15
|
"dev": "ts-node src/cli.ts",
|
|
16
16
|
"start": "node dist/cli.js",
|
|
17
17
|
"watch": "tsc --watch --pretty",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mycontext-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "MyContext CLI - AI-powered full-stack application generator with complete architecture generation, server actions, Next.js 15 App Router, and self-documenting components",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"build": "npm run build:clean && npm run build:compile && npm run build:copy",
|
|
12
12
|
"build:clean": "rm -rf dist && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐งน Cleaned build directory')",
|
|
13
13
|
"build:compile": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐จ Compiling TypeScript...') && tsc --noEmitOnError false",
|
|
14
|
-
"build:copy": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐ Copying config files...') && cp -r src/config dist/ && cp package.json dist/ && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo 'โ
Build complete')",
|
|
14
|
+
"build:copy": "([ \"$npm_config_loglevel\" = \"silent\" ] || echo '๐ Copying config files...') && cp -r src/config dist/ && cp package.json dist/ && cp README.md dist/ && ([ \"$npm_config_loglevel\" = \"silent\" ] || echo 'โ
Build complete')",
|
|
15
15
|
"dev": "ts-node src/cli.ts",
|
|
16
16
|
"start": "node dist/cli.js",
|
|
17
17
|
"watch": "tsc --watch --pretty",
|