@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,506 @@
1
+ ---
2
+ name: lt-cli-reference
3
+ version: 1.0.0
4
+ description: Quick reference for Git operations and Fullstack initialization commands
5
+ ---
6
+
7
+ # LT CLI Quick Reference
8
+
9
+ ⚠️ **Note**: For NestJS server command reference (modules, objects, properties), see the **nest-server-generator skill** instead.
10
+
11
+ This reference covers:
12
+ - Git operations (`lt git get`, `lt git reset`)
13
+ - Fullstack initialization (`lt fullstack init`)
14
+
15
+ ---
16
+
17
+ ## Command Cheat Sheet
18
+
19
+ ### Git Commands
20
+
21
+ #### Get Branch (Checkout/Create)
22
+ ```bash
23
+ # Interactive (prompts for branch name)
24
+ lt git get
25
+ lt git g
26
+
27
+ # Non-interactive
28
+ lt git get <branch-name>
29
+ lt git g <branch-name>
30
+ ```
31
+
32
+ **Parameters:**
33
+ - `<branch-name>`: Branch name to checkout/create
34
+
35
+ **What it does:**
36
+ 1. Checks if branch exists locally → switches to it
37
+ 2. If not local, checks remote → checks out and tracks
38
+ 3. If neither exists → creates new branch from current
39
+
40
+ **Examples:**
41
+ ```bash
42
+ lt git get DEV-123
43
+ lt git get feature/new-auth
44
+ lt git g main
45
+ ```
46
+
47
+ #### Reset to Remote
48
+ ```bash
49
+ # Interactive (prompts for confirmation)
50
+ lt git reset
51
+
52
+ # Prompts: "Reset current branch to origin/<branch>? (y/N)"
53
+ ```
54
+
55
+ **What it does:**
56
+ 1. Fetches latest from remote
57
+ 2. Resets current branch to `origin/<current-branch>`
58
+ 3. Discards ALL local changes and commits
59
+
60
+ **⚠️ WARNING**: Destructive operation - cannot be undone!
61
+
62
+ ---
63
+
64
+ ### Fullstack Commands
65
+
66
+ #### Initialize Fullstack Workspace
67
+ ```bash
68
+ # Interactive (prompts for all options)
69
+ lt fullstack init
70
+ lt full init
71
+
72
+ # Non-interactive
73
+ lt fullstack init \
74
+ --name <WorkspaceName> \
75
+ --frontend <angular|nuxt> \
76
+ --git <true|false> \
77
+ [--git-link <GitURL>]
78
+ ```
79
+
80
+ **Required Parameters:**
81
+ - `--name`: Workspace/project name (PascalCase recommended)
82
+ - `--frontend`: Frontend framework (`angular` or `nuxt`)
83
+ - `--git`: Initialize git repository (`true` or `false`)
84
+
85
+ **Optional Parameters:**
86
+ - `--git-link`: Git repository URL (only when `--git true`)
87
+
88
+ **Examples:**
89
+ ```bash
90
+ # With git and remote
91
+ lt fullstack init \
92
+ --name MyApp \
93
+ --frontend angular \
94
+ --git true \
95
+ --git-link https://github.com/user/myapp.git
96
+
97
+ # Without git
98
+ lt fullstack init \
99
+ --name TestProject \
100
+ --frontend nuxt \
101
+ --git false
102
+
103
+ # With git but no remote (add later)
104
+ lt fullstack init \
105
+ --name LocalProject \
106
+ --frontend angular \
107
+ --git true
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Git Commands Reference
113
+
114
+ ### lt git get
115
+
116
+ **Syntax:**
117
+ ```bash
118
+ lt git get [branch-name]
119
+ ```
120
+
121
+ **Aliases:**
122
+ - `lt git g`
123
+
124
+ **Behavior:**
125
+
126
+ | Scenario | Action |
127
+ |----------|--------|
128
+ | Branch exists locally | Switches to branch |
129
+ | Branch exists on remote only | Checks out and tracks remote branch |
130
+ | Branch doesn't exist anywhere | Creates new branch from current |
131
+
132
+ **Common Usage:**
133
+ ```bash
134
+ # Start new feature
135
+ lt git get DEV-456 # Creates if doesn't exist
136
+
137
+ # Switch to existing branch
138
+ lt git get main # Switches to main
139
+
140
+ # Checkout teammate's branch
141
+ lt git get feature/auth # Checks out from remote if exists
142
+
143
+ # Short alias
144
+ lt git g DEV-789 # Same as "lt git get DEV-789"
145
+ ```
146
+
147
+ **Equivalent Standard Git:**
148
+ ```bash
149
+ # lt git get DEV-123 does:
150
+ git checkout DEV-123 2>/dev/null || \
151
+ git checkout -b DEV-123 --track origin/DEV-123 2>/dev/null || \
152
+ git checkout -b DEV-123
153
+ ```
154
+
155
+ ---
156
+
157
+ ### lt git reset
158
+
159
+ **Syntax:**
160
+ ```bash
161
+ lt git reset
162
+ ```
163
+
164
+ **No parameters accepted** - always operates on current branch.
165
+
166
+ **Interactive Prompt:**
167
+ ```
168
+ Reset current branch to origin/<branch>?
169
+ This will discard all local changes. (y/N)
170
+ ```
171
+
172
+ **What Gets Discarded:**
173
+ - All uncommitted changes (staged and unstaged)
174
+ - All local commits not pushed to remote
175
+ - All untracked files (if any were added)
176
+
177
+ **When to Use:**
178
+ - Experimental work failed, want clean slate
179
+ - Merge conflicts too complex
180
+ - Accidentally committed to wrong branch
181
+ - Local branch corrupted
182
+
183
+ **When NOT to Use:**
184
+ - You want to keep any local changes
185
+ - You haven't pushed but commits are valuable
186
+ - Branch has no remote tracking
187
+
188
+ **Equivalent Standard Git:**
189
+ ```bash
190
+ # lt git reset does:
191
+ git fetch origin
192
+ git reset --hard origin/<current-branch>
193
+ ```
194
+
195
+ **Recovery (if you made a mistake):**
196
+ ```bash
197
+ # IMMEDIATELY after reset, if you change your mind:
198
+ git reflog # Find commit before reset
199
+ git reset --hard HEAD@{1} # Restore to that commit
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Fullstack Commands Reference
205
+
206
+ ### lt fullstack init
207
+
208
+ **Syntax:**
209
+ ```bash
210
+ lt fullstack init \
211
+ --name <WorkspaceName> \
212
+ --frontend <angular|nuxt> \
213
+ --git <true|false> \
214
+ [--git-link <GitURL>]
215
+ ```
216
+
217
+ **Aliases:**
218
+ - `lt full init`
219
+
220
+ **Parameters:**
221
+
222
+ | Parameter | Type | Required | Options | Description |
223
+ |-----------|------|----------|---------|-------------|
224
+ | `--name` | string | Yes | - | Project name (PascalCase) |
225
+ | `--frontend` | string | Yes | `angular`, `nuxt` | Frontend framework |
226
+ | `--git` | boolean | Yes | `true`, `false` | Initialize git |
227
+ | `--git-link` | string | No | URL | Git repository URL |
228
+
229
+ **Created Structure:**
230
+ ```
231
+ <workspace-name>/
232
+ ├── frontend/ # Angular or Nuxt app
233
+ │ ├── src/ # (Angular) or pages/ (Nuxt)
234
+ │ ├── package.json
235
+ │ └── ...
236
+ ├── projects/
237
+ │ └── api/ # NestJS backend (@lenne.tech/nest-server)
238
+ │ ├── src/
239
+ │ │ └── server/
240
+ │ │ ├── modules/
241
+ │ │ └── common/
242
+ │ ├── package.json
243
+ │ └── ...
244
+ ├── package.json # Root workspace config
245
+ ├── .gitignore # (if --git true)
246
+ └── .git/ # (if --git true)
247
+ ```
248
+
249
+ **Post-Creation Setup:**
250
+ ```bash
251
+ cd <workspace-name>
252
+ npm install # Install dependencies
253
+
254
+ # Terminal 1: Start backend
255
+ cd projects/api && npm start # Runs on port 3000
256
+
257
+ # Terminal 2: Start frontend
258
+ cd frontend && npm start # Angular: 4200, Nuxt: 3000/3001
259
+ ```
260
+
261
+ **Git Remote Configuration:**
262
+
263
+ With `--git-link`:
264
+ ```bash
265
+ # Remote automatically configured
266
+ git remote -v
267
+ # origin https://github.com/user/repo.git (fetch)
268
+ # origin https://github.com/user/repo.git (push)
269
+ ```
270
+
271
+ Without `--git-link` (add later):
272
+ ```bash
273
+ cd <workspace-name>
274
+ git remote add origin https://github.com/user/repo.git
275
+ git push -u origin main
276
+ ```
277
+
278
+ ---
279
+
280
+ ## Common Patterns
281
+
282
+ ### Git Workflows
283
+
284
+ #### Feature Development
285
+ ```bash
286
+ # Start new feature
287
+ git checkout main
288
+ git pull
289
+ lt git get DEV-123
290
+
291
+ # Work...
292
+ git add .
293
+ git commit -m "Implement feature"
294
+ git push -u origin DEV-123
295
+ ```
296
+
297
+ #### Switch Between Branches
298
+ ```bash
299
+ # Save current work
300
+ git stash
301
+
302
+ # Switch branch
303
+ lt git get DEV-456
304
+
305
+ # Do urgent work...
306
+
307
+ # Return to original work
308
+ lt git get DEV-123
309
+ git stash pop
310
+ ```
311
+
312
+ #### Discard Failed Work
313
+ ```bash
314
+ # Work didn't go well
315
+ git status # See mess
316
+
317
+ # Start over from remote
318
+ lt git reset # Clean slate
319
+ ```
320
+
321
+ ### Fullstack Initialization
322
+
323
+ #### Production Project
324
+ ```bash
325
+ lt fullstack init \
326
+ --name ProductionApp \
327
+ --frontend angular \
328
+ --git true \
329
+ --git-link https://github.com/company/production-app.git
330
+
331
+ cd ProductionApp
332
+ npm install
333
+ # ... setup, create modules, commit, push
334
+ ```
335
+
336
+ #### Local Development
337
+ ```bash
338
+ lt fullstack init \
339
+ --name LocalTest \
340
+ --frontend nuxt \
341
+ --git false
342
+
343
+ cd LocalTest
344
+ npm install
345
+ # ... quick testing without git overhead
346
+ ```
347
+
348
+ ---
349
+
350
+ ## Troubleshooting
351
+
352
+ ### Git Commands
353
+
354
+ #### "Branch not found" Error
355
+ ```bash
356
+ # Problem: Typo in branch name
357
+ lt git get DEV-12345
358
+ # Error: Branch not found
359
+
360
+ # Solution: Check available branches
361
+ git branch -a # List all branches
362
+ lt git get DEV-123 # Correct name
363
+ ```
364
+
365
+ #### "Cannot reset" Error
366
+ ```bash
367
+ # Problem: No remote tracking
368
+ lt git reset
369
+ # Error: No remote tracking branch
370
+
371
+ # Solution: Set up tracking
372
+ git branch -u origin/main # Or appropriate branch
373
+ git fetch origin
374
+ lt git reset
375
+ ```
376
+
377
+ #### Uncommitted Changes Block Switch
378
+ ```bash
379
+ # Problem: Changes prevent switching
380
+ lt git get DEV-456
381
+ # Error: Your local changes... would be overwritten
382
+
383
+ # Solution 1: Stash
384
+ git stash
385
+ lt git get DEV-456
386
+ git stash pop
387
+
388
+ # Solution 2: Commit
389
+ git add .
390
+ git commit -m "WIP"
391
+ lt git get DEV-456
392
+ ```
393
+
394
+ ### Fullstack Init
395
+
396
+ #### Permission Denied
397
+ ```bash
398
+ # Problem: No write permissions
399
+ lt fullstack init --name MyApp --frontend angular --git false
400
+ # Error: Permission denied
401
+
402
+ # Solution: Use writable directory
403
+ cd ~/projects
404
+ lt fullstack init --name MyApp --frontend angular --git false
405
+ ```
406
+
407
+ #### Directory Already Exists
408
+ ```bash
409
+ # Problem: Project name already used
410
+ lt fullstack init --name MyApp --frontend angular --git false
411
+ # Error: Directory already exists
412
+
413
+ # Solution: Use different name or remove directory
414
+ rm -rf MyApp
415
+ lt fullstack init --name MyApp --frontend angular --git false
416
+ ```
417
+
418
+ #### Git Link Invalid
419
+ ```bash
420
+ # Problem: Invalid git URL
421
+ lt fullstack init \
422
+ --name MyApp \
423
+ --frontend angular \
424
+ --git true \
425
+ --git-link invalid-url
426
+
427
+ # Solution: Use valid HTTPS or SSH URL
428
+ lt fullstack init \
429
+ --name MyApp \
430
+ --frontend angular \
431
+ --git true \
432
+ --git-link https://github.com/user/repo.git
433
+ ```
434
+
435
+ ---
436
+
437
+ ## Best Practices
438
+
439
+ ### Git Operations
440
+
441
+ **Branch Management:**
442
+ - ✅ Always run `git status` before switching branches
443
+ - ✅ Commit or stash changes before switching
444
+ - ✅ Use meaningful branch names (DEV-123, feature/xyz)
445
+ - ✅ Pull latest before creating feature branches
446
+ - ❌ Don't leave uncommitted changes when switching
447
+
448
+ **Reset Operations:**
449
+ - ✅ Verify what will be discarded with `git status` first
450
+ - ✅ Only reset when you're certain you want to discard everything
451
+ - ✅ Know that reset is irreversible (unless using reflog immediately)
452
+ - ❌ Don't reset if you have valuable local commits
453
+ - ❌ Don't reset without checking remote exists
454
+
455
+ ### Fullstack Initialization
456
+
457
+ **Project Setup:**
458
+ - ✅ Use PascalCase for project names (MyProject, not my-project)
459
+ - ✅ Enable git for all real projects (`--git true`)
460
+ - ✅ Add git remote URL immediately with `--git-link`
461
+ - ✅ Run `npm install` right after creation
462
+ - ✅ Choose Angular for enterprise, Nuxt for flexibility
463
+ - ❌ Don't use git for quick throwaway tests
464
+ - ❌ Don't use spaces in project names
465
+
466
+ **Post-Creation:**
467
+ - ✅ Read generated README.md files
468
+ - ✅ Commit initial setup before making changes
469
+ - ✅ Set up CI/CD early
470
+ - ✅ Configure environment variables
471
+ - ❌ Don't commit .env files
472
+ - ❌ Don't modify generated structure without understanding it
473
+
474
+ ---
475
+
476
+ ## Quick Tips
477
+
478
+ 1. **Use aliases**: `lt git g` instead of `lt git get`
479
+ 2. **Stash is your friend**: `git stash` before branch switches
480
+ 3. **Check status often**: `git status` before any git operation
481
+ 4. **Reset is destructive**: Only use when certain
482
+ 5. **PascalCase names**: `MyProject`, not `my_project` or `myproject`
483
+ 6. **Git from start**: Use `--git true` for all real projects
484
+ 7. **Track branches**: Let `lt git get` handle remote tracking
485
+ 8. **Install immediately**: Run `npm install` after init
486
+ 9. **Commit often**: Save work after each logical step
487
+ 10. **Read READMEs**: Each generated project has setup instructions
488
+
489
+ ---
490
+
491
+ ## Related Commands
492
+
493
+ For NestJS server development commands, use the **nest-server-generator skill**:
494
+ - `lt server module` - Create modules
495
+ - `lt server object` - Create objects
496
+ - `lt server addProp` - Add properties
497
+
498
+ ---
499
+
500
+ ## References
501
+
502
+ - [lenne.tech CLI Documentation](https://github.com/lenneTech/cli)
503
+ - [Git Documentation](https://git-scm.com/doc)
504
+ - [NestJS Documentation](https://docs.nestjs.com)
505
+ - [Angular Documentation](https://angular.io/docs)
506
+ - [Nuxt Documentation](https://nuxt.com/docs)