@lenne.tech/cli 0.0.124 → 1.0.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.
Files changed (30) hide show
  1. package/bin/lt +145 -14
  2. package/build/commands/claude/claude.js +25 -0
  3. package/build/commands/claude/install-skills.js +622 -0
  4. package/build/commands/config/config.js +25 -0
  5. package/build/commands/config/help.js +167 -0
  6. package/build/commands/config/init.js +143 -0
  7. package/build/commands/config/show.js +68 -0
  8. package/build/commands/fullstack/init.js +38 -16
  9. package/build/commands/server/add-property.js +199 -36
  10. package/build/commands/server/create.js +66 -4
  11. package/build/commands/server/module.js +150 -27
  12. package/build/commands/server/object.js +38 -22
  13. package/build/extensions/config.js +157 -0
  14. package/build/extensions/parse-properties.js +119 -0
  15. package/build/extensions/server.js +82 -47
  16. package/build/interfaces/lt-config.interface.js +3 -0
  17. package/build/templates/claude-skills/lt-cli/SKILL.md +272 -0
  18. package/build/templates/claude-skills/lt-cli/examples.md +542 -0
  19. package/build/templates/claude-skills/lt-cli/reference.md +506 -0
  20. package/build/templates/claude-skills/nest-server-generator/SKILL.md +2833 -0
  21. package/build/templates/claude-skills/nest-server-generator/examples.md +760 -0
  22. package/build/templates/claude-skills/nest-server-generator/reference.md +417 -0
  23. package/build/templates/nest-server-module/inputs/template-create.input.ts.ejs +1 -3
  24. package/build/templates/nest-server-module/inputs/template.input.ts.ejs +1 -1
  25. package/build/templates/nest-server-module/template.controller.ts.ejs +24 -13
  26. package/build/templates/nest-server-module/template.model.ts.ejs +2 -2
  27. package/build/templates/nest-server-module/template.module.ts.ejs +4 -0
  28. package/build/templates/nest-server-module/template.service.ts.ejs +6 -6
  29. package/build/templates/nest-server-object/template.object.ts.ejs +2 -2
  30. package/package.json +13 -11
@@ -0,0 +1,542 @@
1
+ ---
2
+ name: lt-cli-examples
3
+ version: 1.0.0
4
+ description: Real-world examples for Git operations and Fullstack initialization with lenne.tech CLI
5
+ ---
6
+
7
+ # LT CLI Examples
8
+
9
+ ⚠️ **Note**: For NestJS server examples (modules, objects, properties), see the **nest-server-generator skill** instead.
10
+
11
+ This file contains examples for:
12
+ - Git operations (`lt git get`, `lt git reset`)
13
+ - Fullstack initialization (`lt fullstack init`)
14
+
15
+ ---
16
+
17
+ ## Git Operations
18
+
19
+ ### 1. Branch Management
20
+
21
+ #### Switching to Existing Branch
22
+ ```bash
23
+ # Switch to existing branch DEV-123
24
+ lt git get DEV-123
25
+ ```
26
+
27
+ **What happens:**
28
+ 1. Checks if `DEV-123` exists locally
29
+ 2. Switches to branch `DEV-123`
30
+
31
+ #### Creating New Branch
32
+ ```bash
33
+ # Create and switch to new branch feature/new-authentication
34
+ lt git get feature/new-authentication
35
+ ```
36
+
37
+ **What happens:**
38
+ 1. Checks if `feature/new-authentication` exists locally (not found)
39
+ 2. Checks if it exists on remote (not found)
40
+ 3. Creates new branch `feature/new-authentication` from current branch
41
+ 4. Switches to the new branch
42
+
43
+ #### Checking Out Remote Branch
44
+ ```bash
45
+ # Checkout branch that exists on remote but not locally
46
+ lt git get DEV-456
47
+ ```
48
+
49
+ **What happens:**
50
+ 1. Checks if `DEV-456` exists locally (not found)
51
+ 2. Checks if it exists on remote (found!)
52
+ 3. Checks out `DEV-456` and sets up tracking to `origin/DEV-456`
53
+ 4. Switches to the branch
54
+
55
+ #### Using Alias
56
+ ```bash
57
+ # Same as "lt git get" but shorter
58
+ lt git g DEV-789
59
+ ```
60
+
61
+ ---
62
+
63
+ ### 2. Workflow Scenarios
64
+
65
+ #### Start New Feature Development
66
+ ```bash
67
+ # You're on main branch, start working on new ticket
68
+ git status # Verify clean working tree
69
+ lt git get DEV-234 # Create and switch to new feature branch
70
+
71
+ # Do your work...
72
+ git add .
73
+ git commit -m "Implement feature"
74
+ git push -u origin DEV-234
75
+ ```
76
+
77
+ #### Switch Between Tickets
78
+ ```bash
79
+ # Working on DEV-123, need to switch to urgent DEV-456
80
+ git status # Check for uncommitted changes
81
+ git stash # Save work in progress
82
+ lt git get DEV-456 # Switch to urgent ticket
83
+
84
+ # Fix urgent issue...
85
+ git add .
86
+ git commit -m "Fix urgent bug"
87
+ git push
88
+
89
+ # Return to original work
90
+ lt git get DEV-123
91
+ git stash pop # Restore work in progress
92
+ ```
93
+
94
+ #### Sync with Remote Branch
95
+ ```bash
96
+ # Someone else created branch DEV-789 on remote
97
+ lt git get DEV-789 # Automatically checks out and tracks remote branch
98
+
99
+ # Verify tracking
100
+ git status
101
+ # Output: "Your branch is up to date with 'origin/DEV-789'"
102
+ ```
103
+
104
+ ---
105
+
106
+ ### 3. Reset Operations
107
+
108
+ #### Discard All Local Changes
109
+ ```bash
110
+ # Your local changes are broken, start fresh from remote
111
+ git status # See what will be discarded
112
+
113
+ lt git reset
114
+ # Prompts: "Reset current branch to origin/<branch>? This will discard all local changes. (y/N)"
115
+ # Type: y
116
+
117
+ # Your branch now matches remote exactly
118
+ ```
119
+
120
+ **⚠️ WARNING**: This is destructive! All local commits and changes are permanently lost.
121
+
122
+ #### When to Use Reset
123
+
124
+ **Use Case 1**: Experimental work failed
125
+ ```bash
126
+ # You tried something, it didn't work, want clean slate
127
+ git status # Shows many broken changes
128
+ lt git reset # Start over from remote
129
+ ```
130
+
131
+ **Use Case 2**: Merge conflict too complex
132
+ ```bash
133
+ # Merge created complex conflicts, easier to start over
134
+ git merge main # Conflict!
135
+ # ... attempt to resolve, too complicated
136
+ git merge --abort
137
+ lt git reset # Get clean state
138
+ # Now merge again or use different approach
139
+ ```
140
+
141
+ **Use Case 3**: Accidental commits on wrong branch
142
+ ```bash
143
+ # Made commits on main instead of feature branch
144
+ git log # See unwanted commits
145
+ lt git reset # Discard commits, return to clean main
146
+ lt git get DEV-123 # Switch to correct branch
147
+ # Re-do work properly
148
+ ```
149
+
150
+ ---
151
+
152
+ ### 4. Common Patterns
153
+
154
+ #### Daily Development Workflow
155
+ ```bash
156
+ # Morning: Start work on ticket
157
+ lt git get main # Switch to main
158
+ git pull # Get latest changes
159
+ lt git get DEV-567 # Create/switch to ticket branch
160
+
161
+ # During day: Regular commits
162
+ git add .
163
+ git commit -m "Progress on feature"
164
+ git push -u origin DEV-567 # First push sets upstream
165
+
166
+ # End of day: Push progress
167
+ git add .
168
+ git commit -m "WIP: End of day checkpoint"
169
+ git push
170
+ ```
171
+
172
+ #### Handling Mistakes
173
+ ```bash
174
+ # Scenario: Committed to wrong branch
175
+ git log -1 # See the wrong commit
176
+ git stash # Stash any uncommitted work
177
+ lt git reset # Reset to clean state
178
+ lt git get DEV-999 # Switch to correct branch
179
+ git stash pop # Restore work
180
+ # Now commit on correct branch
181
+ ```
182
+
183
+ #### Code Review Feedback
184
+ ```bash
185
+ # Reviewer asked for changes on PR branch
186
+ lt git get DEV-333 # Switch to PR branch
187
+ git pull # Get latest
188
+ # Make requested changes
189
+ git add .
190
+ git commit -m "Address PR feedback"
191
+ git push
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Fullstack Project Initialization
197
+
198
+ ### 1. Angular Projects
199
+
200
+ #### Production Angular App with Git
201
+ ```bash
202
+ lt fullstack init \
203
+ --name MyAngularApp \
204
+ --frontend angular \
205
+ --git true \
206
+ --git-link https://github.com/myorg/my-angular-app.git
207
+ ```
208
+
209
+ **Creates:**
210
+ ```
211
+ MyAngularApp/
212
+ ├── frontend/ # Angular 18+ application
213
+ │ ├── src/
214
+ │ ├── angular.json
215
+ │ └── package.json
216
+ ├── projects/
217
+ │ └── api/ # NestJS backend (@lenne.tech/nest-server)
218
+ │ ├── src/
219
+ │ │ └── server/
220
+ │ │ ├── modules/
221
+ │ │ └── common/
222
+ │ └── package.json
223
+ ├── package.json # Root workspace config
224
+ ├── .gitignore
225
+ └── .git/ # Initialized with remote
226
+ ```
227
+
228
+ **Next steps:**
229
+ ```bash
230
+ cd MyAngularApp
231
+ npm install # Install all dependencies
232
+ cd projects/api && npm start # Start backend (port 3000)
233
+ # In another terminal:
234
+ cd frontend && npm start # Start frontend (port 4200)
235
+ ```
236
+
237
+ #### Local Development Angular App
238
+ ```bash
239
+ lt fullstack init \
240
+ --name LocalDevApp \
241
+ --frontend angular \
242
+ --git false
243
+ ```
244
+
245
+ **Use case:** Quick prototyping, learning, no version control needed
246
+
247
+ ---
248
+
249
+ ### 2. Nuxt Projects
250
+
251
+ #### Production Nuxt App with Git
252
+ ```bash
253
+ lt fullstack init \
254
+ --name MyNuxtApp \
255
+ --frontend nuxt \
256
+ --git true \
257
+ --git-link https://github.com/myorg/my-nuxt-app.git
258
+ ```
259
+
260
+ **Creates:**
261
+ ```
262
+ MyNuxtApp/
263
+ ├── frontend/ # Nuxt 3 application
264
+ │ ├── pages/
265
+ │ ├── components/
266
+ │ ├── nuxt.config.ts
267
+ │ └── package.json
268
+ ├── projects/
269
+ │ └── api/ # NestJS backend
270
+ │ └── ...
271
+ ├── package.json
272
+ ├── .gitignore
273
+ └── .git/
274
+ ```
275
+
276
+ #### Nuxt App without Remote
277
+ ```bash
278
+ lt fullstack init \
279
+ --name MyNuxtProject \
280
+ --frontend nuxt \
281
+ --git true
282
+ # No --git-link, git initialized but no remote
283
+ ```
284
+
285
+ **Use case:** Start project locally, add remote later
286
+
287
+ **Add remote later:**
288
+ ```bash
289
+ cd MyNuxtProject
290
+ git remote add origin https://github.com/myorg/my-nuxt-project.git
291
+ git push -u origin main
292
+ ```
293
+
294
+ ---
295
+
296
+ ### 3. Project Types
297
+
298
+ #### Client Project (Angular + NestJS)
299
+ ```bash
300
+ lt fullstack init \
301
+ --name ClientPortal \
302
+ --frontend angular \
303
+ --git true \
304
+ --git-link https://github.com/client/portal.git
305
+
306
+ # After creation:
307
+ cd ClientPortal/projects/api
308
+
309
+ # Add authentication module
310
+ lt server module --name User --controller Both \
311
+ --prop-name-0 email --prop-type-0 string \
312
+ --prop-name-1 password --prop-type-1 string
313
+
314
+ # Add business logic modules
315
+ # ... (use nest-server-generator skill for this)
316
+ ```
317
+
318
+ #### Internal Tool (Nuxt + NestJS)
319
+ ```bash
320
+ lt fullstack init \
321
+ --name InternalDashboard \
322
+ --frontend nuxt \
323
+ --git true \
324
+ --git-link https://github.com/company/internal-dashboard.git
325
+
326
+ # Quick setup for internal tools with Nuxt's flexibility
327
+ ```
328
+
329
+ #### Learning/Tutorial Project
330
+ ```bash
331
+ lt fullstack init \
332
+ --name LearningFullstack \
333
+ --frontend angular \
334
+ --git false
335
+
336
+ # No git overhead, just focus on learning
337
+ ```
338
+
339
+ ---
340
+
341
+ ### 4. Post-Creation Workflows
342
+
343
+ #### After Angular Fullstack Init
344
+ ```bash
345
+ cd MyAngularApp
346
+ npm install
347
+
348
+ # Terminal 1: Start backend
349
+ cd projects/api
350
+ npm start
351
+ # API runs on http://localhost:3000
352
+
353
+ # Terminal 2: Start frontend
354
+ cd frontend
355
+ npm start
356
+ # Frontend runs on http://localhost:4200
357
+ # Auto-proxies API calls to backend
358
+
359
+ # Terminal 3: Development
360
+ cd projects/api
361
+ # Generate server modules using nest-server-generator skill
362
+ ```
363
+
364
+ #### After Nuxt Fullstack Init
365
+ ```bash
366
+ cd MyNuxtApp
367
+ npm install
368
+
369
+ # Terminal 1: Start backend
370
+ cd projects/api
371
+ npm start
372
+ # API runs on http://localhost:3000
373
+
374
+ # Terminal 2: Start frontend
375
+ cd frontend
376
+ npm run dev
377
+ # Frontend runs on http://localhost:3000 (or 3001 if 3000 taken)
378
+
379
+ # Configure proxy in nuxt.config.ts if needed
380
+ ```
381
+
382
+ ---
383
+
384
+ ### 5. Common Initialization Patterns
385
+
386
+ #### Team Project Setup
387
+ ```bash
388
+ # Lead developer initializes project
389
+ lt fullstack init \
390
+ --name TeamProject \
391
+ --frontend angular \
392
+ --git true \
393
+ --git-link https://github.com/team/team-project.git
394
+
395
+ cd TeamProject
396
+ npm install
397
+ # ... initial setup, create base modules
398
+ git add .
399
+ git commit -m "Initial project setup"
400
+ git push -u origin main
401
+
402
+ # Team members clone
403
+ # git clone https://github.com/team/team-project.git
404
+ # cd team-project
405
+ # npm install
406
+ ```
407
+
408
+ #### Monorepo with Multiple Projects
409
+ ```bash
410
+ # Create first project
411
+ lt fullstack init --name ProjectA --frontend angular --git true
412
+
413
+ # Create second project
414
+ lt fullstack init --name ProjectB --frontend nuxt --git true
415
+
416
+ # Each has its own git repository, npm workspace, and backend
417
+ ```
418
+
419
+ #### Migration from Existing Backend
420
+ ```bash
421
+ # Create fullstack project
422
+ lt fullstack init \
423
+ --name MigratedApp \
424
+ --frontend angular \
425
+ --git true
426
+
427
+ cd MigratedApp/projects
428
+
429
+ # Remove generated api
430
+ rm -rf api
431
+
432
+ # Clone existing backend
433
+ git clone https://github.com/company/existing-api.git api
434
+
435
+ # Update root package.json workspace paths if needed
436
+ ```
437
+
438
+ ---
439
+
440
+ ## Troubleshooting Examples
441
+
442
+ ### Git Branch Issues
443
+
444
+ #### Branch Exists But Can't Switch
445
+ ```bash
446
+ # Problem: Uncommitted changes
447
+ git status
448
+ # Output: "Changes not staged for commit..."
449
+
450
+ # Solution 1: Stash changes
451
+ git stash
452
+ lt git get DEV-123
453
+ git stash pop
454
+
455
+ # Solution 2: Commit changes
456
+ git add .
457
+ git commit -m "WIP: Save progress"
458
+ lt git get DEV-123
459
+ ```
460
+
461
+ #### Reset Fails
462
+ ```bash
463
+ # Problem: No remote branch
464
+ lt git reset
465
+ # Error: "Remote branch not found"
466
+
467
+ # Solution: Check remote
468
+ git branch -r # List remote branches
469
+ git remote -v # Verify remote URL
470
+
471
+ # If remote missing, add it
472
+ git remote add origin https://github.com/user/repo.git
473
+ git fetch origin
474
+ lt git reset # Try again
475
+ ```
476
+
477
+ ### Fullstack Init Issues
478
+
479
+ #### Permission Denied
480
+ ```bash
481
+ # Problem: Can't create directory
482
+ lt fullstack init --name MyApp --frontend angular --git false
483
+ # Error: "Permission denied"
484
+
485
+ # Solution: Check permissions
486
+ ls -la .
487
+ # Create in home directory or with sudo
488
+ cd ~
489
+ lt fullstack init --name MyApp --frontend angular --git false
490
+ ```
491
+
492
+ #### Git Remote Already Exists
493
+ ```bash
494
+ # Problem: Directory already has .git
495
+ lt fullstack init --name ExistingDir --frontend nuxt --git true
496
+ # Error: "Directory already initialized with git"
497
+
498
+ # Solution: Use different directory or remove .git
499
+ rm -rf ExistingDir/.git
500
+ lt fullstack init --name ExistingDir --frontend nuxt --git true
501
+ ```
502
+
503
+ ---
504
+
505
+ ## Using Alias Commands
506
+
507
+ All commands have shorter aliases:
508
+
509
+ ```bash
510
+ # Full commands
511
+ lt git get DEV-123
512
+ lt fullstack init --name MyApp --frontend angular --git true
513
+
514
+ # With aliases
515
+ lt git g DEV-123
516
+ lt full init --name MyApp --frontend angular --git true
517
+ ```
518
+
519
+ ---
520
+
521
+ ## Best Practices
522
+
523
+ ### Git Operations
524
+ 1. **Always check status first**: `git status` before switching branches
525
+ 2. **Save work before switching**: Commit or stash uncommitted changes
526
+ 3. **Be cautious with reset**: It's destructive and irreversible
527
+ 4. **Use meaningful branch names**: Follow team conventions (DEV-123, feature/xyz)
528
+
529
+ ### Fullstack Initialization
530
+ 1. **Choose frontend wisely**: Angular for enterprise, Nuxt for flexibility
531
+ 2. **Enable git from start**: Use `--git true` for all real projects
532
+ 3. **Follow naming conventions**: PascalCase for project names
533
+ 4. **Read generated READMEs**: Each project has setup instructions
534
+ 5. **Install dependencies immediately**: Run `npm install` after creation
535
+
536
+ ---
537
+
538
+ ## Reference
539
+
540
+ For detailed command syntax and all available options, see [reference.md](reference.md).
541
+
542
+ For NestJS server development examples, use the **nest-server-generator skill**.