@idealyst/cli 1.0.83 → 1.0.84

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,514 +0,0 @@
1
- # Idealyst Framework CLI - LLM Reference Guide
2
-
3
- This is a comprehensive reference for LLMs to understand and use the Idealyst Framework CLI to create full-stack TypeScript projects.
4
-
5
- ## Overview
6
-
7
- The Idealyst Framework CLI is a powerful tool for generating TypeScript monorepo projects with React Native, React Web, API servers, database layers, and shared libraries. All projects are type-safe and follow modern development practices.
8
-
9
- ## CLI Installation & Usage
10
-
11
- ```bash
12
- # Install globally
13
- npm install -g @idealyst/cli
14
-
15
- # Or use via npx
16
- npx @idealyst/cli [command] [options]
17
- ```
18
-
19
- ⚠️ **IMPORTANT FOR LLMs**: Always provide ALL required arguments to avoid interactive prompts that can hang automated processes.
20
-
21
- ## 🚨 Critical LLM Requirements
22
-
23
- ### Commands That Will Hang LLMs
24
- ```bash
25
- # ❌ These commands will hang waiting for user input:
26
- idealyst init # Missing workspace name
27
- idealyst create my-app # Missing --type
28
- idealyst create my-app --type native # Missing --app-name
29
- idealyst create my-app --type web # Missing tRPC preference
30
- idealyst create my-app --type native --app-name "App" # Missing tRPC preference
31
- ```
32
-
33
- ### LLM-Safe Command Templates
34
- ```bash
35
- # ✅ Always use these exact patterns:
36
- idealyst init <workspace-name> # Always provide name
37
- idealyst create <name> --type database # Database: no extra args needed
38
- idealyst create <name> --type api # API: no extra args needed
39
- idealyst create <name> --type shared # Shared: no extra args needed
40
- idealyst create <name> --type native --app-name "Name" --with-trpc # Native: both required
41
- idealyst create <name> --type native --app-name "Name" --no-trpc # Native: both required
42
- idealyst create <name> --type web --with-trpc # Web: tRPC choice required
43
- idealyst create <name> --type web --no-trpc # Web: tRPC choice required
44
- ```
45
-
46
- ## Core Commands
47
-
48
- ### 1. Initialize Workspace
49
- **Purpose**: Create a new monorepo workspace that can contain multiple related projects.
50
-
51
- ```bash
52
- # Create a new workspace (ALWAYS provide project name)
53
- idealyst init <workspace-name> [options]
54
-
55
- # Options:
56
- # -d, --directory <dir> Output directory (default: .)
57
- # --skip-install Skip installing dependencies
58
-
59
- # ✅ LLM-Safe Examples:
60
- idealyst init my-workspace
61
- idealyst init ecommerce-platform --directory ./projects
62
- idealyst init my-app --skip-install
63
- ```
64
-
65
- **⚠️ LLM Warning**: Never run `idealyst init` without a project name - it will prompt interactively and hang.
66
-
67
- **What it creates:**
68
- - Yarn workspace configuration
69
- - TypeScript configuration
70
- - Build scripts and tooling
71
- - Package management setup
72
- - Version management scripts
73
- - Base Idealyst packages (theme, components, navigation)
74
-
75
- ### 2. Create Projects
76
- **Purpose**: Create individual projects within a workspace.
77
-
78
- ```bash
79
- # General syntax (ALWAYS provide project name AND type)
80
- idealyst create <project-name> --type <type> [options]
81
-
82
- # Options:
83
- # -t, --type <type> Project type: native, web, shared, api, or database
84
- # -d, --directory <dir> Output directory (default: .)
85
- # -a, --app-name <name> Display name for native apps (REQUIRED for native)
86
- # --with-trpc Include tRPC boilerplate (for web/native)
87
- # --no-trpc Explicitly disable tRPC (for web/native)
88
- # --skip-install Skip installing dependencies
89
-
90
- # ✅ LLM-Safe Examples:
91
- idealyst create my-api --type api
92
- idealyst create user-database --type database
93
- idealyst create mobile-app --type native --app-name "Mobile App"
94
- idealyst create web-app --type web --with-trpc
95
- idealyst create utils --type shared
96
- ```
97
-
98
- **⚠️ LLM Critical Rules**:
99
- 1. **Always provide `<project-name>`** - CLI will prompt if missing
100
- 2. **Always provide `--type <type>`** - CLI will prompt if missing
101
- 3. **For native projects**: Always provide `--app-name "Display Name"` - CLI will prompt if missing
102
- 4. **For web/native projects**: Always specify `--with-trpc` or `--no-trpc` - CLI will prompt if missing
103
-
104
- ## Project Types
105
-
106
- ### 1. Native (React Native)
107
- **Purpose**: Cross-platform mobile applications
108
-
109
- ```bash
110
- # ✅ LLM-Safe Command (always include --app-name)
111
- idealyst create my-mobile-app --type native --app-name "My Mobile App"
112
-
113
- # With tRPC integration
114
- idealyst create mobile-app --type native --app-name "Mobile App" --with-trpc
115
-
116
- # Without tRPC integration (explicit)
117
- idealyst create mobile-app --type native --app-name "Mobile App" --no-trpc
118
- ```
119
-
120
- **⚠️ LLM Required**: `--app-name` is REQUIRED for native projects to avoid interactive prompts.
121
-
122
- **Includes:**
123
- - React Native setup with TypeScript
124
- - Idealyst UI components
125
- - Navigation system
126
- - Platform-specific configurations (iOS/Android)
127
- - Jest testing setup
128
- - Optional tRPC integration
129
-
130
- **Key files:**
131
- - `src/App.tsx` - Main application component
132
- - `android/` - Android-specific code
133
- - `ios/` - iOS-specific code
134
- - `jest.config.js` - Testing configuration
135
-
136
- ### 2. Web (React Web)
137
- **Purpose**: Web applications using React
138
-
139
- ```bash
140
- # ✅ LLM-Safe Commands (always specify tRPC preference)
141
- idealyst create my-web-app --type web --with-trpc
142
- idealyst create my-web-app --type web --no-trpc
143
-
144
- # With additional options
145
- idealyst create web-dashboard --type web --with-trpc --skip-install
146
- ```
147
-
148
- **⚠️ LLM Required**: Always specify `--with-trpc` or `--no-trpc` to avoid interactive prompts.
149
-
150
- **Includes:**
151
- - React with TypeScript and Vite
152
- - Idealyst UI components (web-compatible)
153
- - Unistyles for styling
154
- - Jest testing setup
155
- - Optional tRPC integration
156
-
157
- **Key files:**
158
- - `src/App.tsx` - Main application component
159
- - `src/main.tsx` - Entry point
160
- - `vite.config.ts` - Vite configuration
161
- - `index.html` - HTML template
162
-
163
- ### 3. API Server
164
- **Purpose**: Backend API servers with tRPC
165
-
166
- ```bash
167
- # ✅ LLM-Safe Command
168
- idealyst create my-api --type api
169
-
170
- # With additional options
171
- idealyst create user-api --type api --skip-install
172
- ```
173
-
174
- **Includes:**
175
- - tRPC for type-safe APIs
176
- - Express.js server
177
- - Zod schema validation
178
- - TypeScript configuration
179
- - Middleware system (auth, CORS, etc.)
180
- - Controller pattern
181
- - Jest testing setup
182
-
183
- **Key files:**
184
- - `src/server.ts` - Express server setup
185
- - `src/index.ts` - Main exports
186
- - `src/context.ts` - tRPC context
187
- - `src/router/index.ts` - Route definitions
188
- - `src/controllers/` - API controllers
189
- - `src/middleware/` - Custom middleware
190
-
191
- **Note**: API projects no longer include database functionality (see Database type below).
192
-
193
- ### 4. Database
194
- **Purpose**: Shared database layer with Prisma
195
-
196
- ```bash
197
- # ✅ LLM-Safe Command
198
- idealyst create my-database --type database
199
-
200
- # With additional options
201
- idealyst create user-database --type database --skip-install
202
- ```
203
-
204
- **Includes:**
205
- - Prisma ORM setup
206
- - TypeScript configuration
207
- - Zod schemas for validation
208
- - Database client singleton
209
- - Migration scripts
210
- - Seed scripts
211
- - Jest testing setup
212
-
213
- **Key files:**
214
- - `src/index.ts` - Main exports (db, schemas, types)
215
- - `src/client.ts` - Prisma client singleton
216
- - `src/schemas.ts` - Zod validation schemas
217
- - `prisma/schema.prisma` - Database schema
218
- - `prisma/seed.ts` - Database seeding
219
-
220
- **Exports for consumption:**
221
- ```typescript
222
- // Import in other packages
223
- import { db, schemas, PrismaClient } from '@workspace/my-database';
224
- import type { User, Post } from '@workspace/my-database';
225
-
226
- // Use the database
227
- const users = await db.user.findMany();
228
- const validData = schemas.createUser.parse(input);
229
- ```
230
-
231
- ### 5. Shared Library
232
- **Purpose**: Reusable code shared across projects
233
-
234
- ```bash
235
- # ✅ LLM-Safe Command
236
- idealyst create my-shared-lib --type shared
237
-
238
- # With additional options
239
- idealyst create utils --type shared --skip-install
240
- ```
241
-
242
- **Includes:**
243
- - TypeScript library setup
244
- - Rollup build configuration
245
- - Jest testing setup
246
- - NPM package structure
247
-
248
- **Key files:**
249
- - `src/index.ts` - Main exports
250
- - `rollup.config.js` - Build configuration
251
-
252
- ## Project Architecture Patterns
253
-
254
- ### Monorepo Structure
255
- ```
256
- my-workspace/
257
- ├── package.json # Workspace root
258
- ├── packages/
259
- │ ├── mobile-app/ # React Native app
260
- │ ├── web-app/ # React web app
261
- │ ├── api-server/ # tRPC API server
262
- │ ├── user-database/ # Database layer
263
- │ └── shared-utils/ # Shared library
264
- └── node_modules/
265
- ```
266
-
267
- ### Database + API Pattern
268
- **Recommended approach for full-stack applications:**
269
-
270
- 1. **Create database package first:**
271
- ```bash
272
- idealyst create user-database --type database
273
- ```
274
-
275
- 2. **Create API server:**
276
- ```bash
277
- idealyst create api-server --type api
278
- ```
279
-
280
- 3. **Connect them in API:**
281
- ```typescript
282
- // In api-server/src/controllers/UserController.ts
283
- import { db } from '@workspace/user-database';
284
- import type { User } from '@workspace/user-database';
285
-
286
- export class UserController {
287
- async getUsers() {
288
- return await db.user.findMany();
289
- }
290
- }
291
- ```
292
-
293
- ### Client + API Pattern
294
- **For frontend applications with backend:**
295
-
296
- 1. **Create API first:**
297
- ```bash
298
- idealyst create api-server --type api
299
- idealyst create user-database --type database
300
- ```
301
-
302
- 2. **Create client apps:**
303
- ```bash
304
- idealyst create mobile-app --type native --with-trpc
305
- idealyst create web-app --type web --with-trpc
306
- ```
307
-
308
- 3. **Connect with tRPC:**
309
- ```typescript
310
- // In client app
311
- import { createTRPCProxyClient } from '@trpc/client';
312
- import type { AppRouter } from '@workspace/api-server';
313
-
314
- const api = createTRPCProxyClient<AppRouter>({
315
- links: [httpBatchLink({ url: 'http://localhost:3000/trpc' })]
316
- });
317
- ```
318
-
319
- ## Development Workflow
320
-
321
- ### 1. Initial Setup
322
- ```bash
323
- # Create workspace (provide name to avoid prompts)
324
- idealyst init my-project
325
-
326
- cd my-project
327
-
328
- # Create database layer (no additional args needed)
329
- idealyst create database --type database
330
-
331
- # Create API server (no additional args needed)
332
- idealyst create api --type api
333
-
334
- # Create client apps (specify tRPC and app-name to avoid prompts)
335
- idealyst create mobile --type native --app-name "Mobile App" --with-trpc
336
- idealyst create web --type web --with-trpc
337
- ```
338
-
339
- ### 2. Database Development
340
- ```bash
341
- cd packages/database
342
-
343
- # Edit prisma/schema.prisma
344
- # Add your models
345
-
346
- # Generate client
347
- yarn db:generate
348
-
349
- # Push to database
350
- yarn db:push
351
-
352
- # Build for consumption
353
- yarn build
354
- ```
355
-
356
- ### 3. API Development
357
- ```bash
358
- cd packages/api
359
-
360
- # Import database
361
- # Edit src/controllers/ files
362
- # Add your endpoints
363
-
364
- # Start development server
365
- yarn dev
366
- ```
367
-
368
- ### 4. Client Development
369
- ```bash
370
- # Mobile
371
- cd packages/mobile
372
- yarn android # or yarn ios
373
-
374
- # Web
375
- cd packages/web
376
- yarn dev
377
- ```
378
-
379
- ## Best Practices for LLMs
380
-
381
- ### 1. Always Start with Workspace
382
- Never create individual projects without a workspace:
383
- ```bash
384
- # ❌ Wrong - will fail
385
- idealyst create my-app --type native --app-name "My App"
386
-
387
- # ✅ Correct - always init workspace first
388
- idealyst init my-workspace
389
- cd my-workspace
390
- idealyst create my-app --type native --app-name "My App" --with-trpc
391
- ```
392
-
393
- ### 2. Always Provide ALL Required Arguments
394
- ```bash
395
- # ❌ Wrong - will hang on prompts
396
- idealyst init
397
- idealyst create --type native
398
- idealyst create mobile-app
399
-
400
- # ✅ Correct - full arguments prevent prompts
401
- idealyst init my-project
402
- idealyst create mobile-app --type native --app-name "Mobile App" --with-trpc
403
- idealyst create web-app --type web --no-trpc
404
- ```
405
-
406
- ### 3. Use --skip-install for Speed
407
- ```bash
408
- # ✅ For faster iteration/testing
409
- idealyst init my-project --skip-install
410
- idealyst create api --type api --skip-install
411
- ```
412
-
413
- ### 2. Database-First for Full-Stack
414
- For applications needing persistence:
415
- ```bash
416
- # 1. Create workspace (provide name)
417
- idealyst init e-commerce-app
418
-
419
- # 2. Create database first (no prompts)
420
- idealyst create database --type database
421
-
422
- # 3. Create API (no prompts)
423
- idealyst create api --type api
424
-
425
- # 4. Create clients (specify all args)
426
- idealyst create mobile --type native --app-name "E-Commerce Mobile" --with-trpc
427
- idealyst create admin --type web --with-trpc
428
- ```
429
-
430
- ### 3. Use Descriptive Names (No Prompts)
431
- ```bash
432
- # ✅ Good names with full arguments
433
- idealyst create user-database --type database
434
- idealyst create product-api --type api
435
- idealyst create customer-mobile --type native --app-name "Customer Mobile" --with-trpc
436
-
437
- # ❌ Avoid generic names and missing arguments
438
- idealyst create db --type database
439
- idealyst create api --type api
440
- idealyst create app # Missing --type, will prompt
441
- ```
442
-
443
- ### 4. Leverage Type Safety
444
- The framework provides end-to-end type safety:
445
- - Database types from Prisma
446
- - API types from tRPC
447
- - Component types from TypeScript React
448
-
449
- ### 5. Follow the Separation of Concerns
450
- - **Database packages**: Only data models and database access
451
- - **API packages**: Only business logic and endpoints
452
- - **Client packages**: Only UI and user interaction
453
- - **Shared packages**: Only reusable utilities
454
-
455
- ## Example Project Setups
456
-
457
- ### E-commerce Platform
458
- ```bash
459
- idealyst init ecommerce-platform
460
- cd ecommerce-platform
461
-
462
- # Core data layer
463
- idealyst create product-database --type database
464
-
465
- # Backend services
466
- idealyst create product-api --type api
467
- idealyst create payment-api --type api
468
-
469
- # Client applications
470
- idealyst create customer-mobile --type native --with-trpc
471
- idealyst create admin-web --type web --with-trpc
472
-
473
- # Shared utilities
474
- idealyst create shared-utils --type shared
475
- ```
476
-
477
- ### SaaS Application
478
- ```bash
479
- idealyst init saas-app
480
- cd saas-app
481
-
482
- # Data layer
483
- idealyst create user-database --type database
484
-
485
- # Backend
486
- idealyst create auth-api --type api
487
- idealyst create main-api --type api
488
-
489
- # Clients
490
- idealyst create mobile-app --type native --with-trpc
491
- idealyst create web-dashboard --type web --with-trpc
492
-
493
- # Shared
494
- idealyst create common-types --type shared
495
- ```
496
-
497
- ## Error Handling
498
-
499
- ### Common Issues:
500
- 1. **"Individual projects can only be created within a workspace"**
501
- - Solution: Run `idealyst init` first
502
-
503
- 2. **"Invalid project name"**
504
- - Solution: Use lowercase, no spaces, valid npm package names
505
-
506
- 3. **"Invalid project type"**
507
- - Solution: Use one of: native, web, shared, api, database
508
-
509
- ### Debugging:
510
- - Use `--skip-install` for faster iteration
511
- - Check generated package.json files
512
- - Verify workspace structure
513
-
514
- This reference should enable LLMs to effectively use the Idealyst Framework CLI to create comprehensive, type-safe, full-stack TypeScript applications.