@lenne.tech/cli 1.18.0 → 1.20.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/docs/commands.md CHANGED
@@ -67,7 +67,7 @@ lt cli rename <new-name>
67
67
 
68
68
  ### `lt server create`
69
69
 
70
- Creates a new NestJS server project.
70
+ Creates a new standalone NestJS server project in a sibling directory. For an in-workspace API, prefer [`lt fullstack add-api`](#lt-fullstack-add-api).
71
71
 
72
72
  **Usage:**
73
73
  ```bash
@@ -77,17 +77,27 @@ lt server create [name] [options]
77
77
  **Options:**
78
78
  | Option | Description |
79
79
  |--------|-------------|
80
+ | `--name <name>` | Server name (preferred over the positional argument) |
80
81
  | `--description <text>` | Project description |
81
82
  | `--author <name>` | Author name |
82
83
  | `--api-mode <Rest\|GraphQL\|Both>` | API mode (ignored with `--next`) |
83
84
  | `--framework-mode <npm\|vendor>` | Framework consumption mode (ignored with `--next`) |
85
+ | `--framework-upstream-branch <ref>` | Upstream `nest-server` branch/tag/commit to vendor (only with `--framework-mode vendor`) |
84
86
  | `--branch <branch>` / `-b` | Branch of nest-server-starter to use as template |
85
87
  | `--copy <path>` / `-c` | Copy from local template directory instead of cloning |
86
88
  | `--link <path>` | Symlink to local template directory (fastest, changes affect original) |
87
89
  | `--git` | Initialize git repository |
88
90
  | `--next` | **Experimental:** clone [`nest-base`](https://github.com/lenneTech/nest-base) (Bun + Prisma 7 + Postgres + Better-Auth) instead of `nest-server-starter`. Skips API-mode / vendor-mode / install / lt.config.json processing. |
91
+ | `--dry-run` | Print the resolved plan and exit without making any changes |
92
+ | `--force` | Override the workspace-detection abort under `--noConfirm` |
89
93
  | `--noConfirm` | Skip confirmation prompts |
90
94
 
95
+ **Workspace-awareness:** When run inside a directory that already looks like a fullstack workspace (contains `pnpm-workspace.yaml` or `projects/`), the command behaves differently per mode:
96
+
97
+ - **interactive** → asks for confirmation before creating a stray standalone clone
98
+ - **`--noConfirm` without `--force`** → **refuses** with exit code 1 and points the caller to `lt fullstack add-api`. This is the default behaviour for AI agents and CI scripts: fail loud rather than produce a stray clone that pnpm-workspace.yaml does not pick up.
99
+ - **`--noConfirm --force`** → proceeds and logs a hint so the override is visible in CI logs.
100
+
91
101
  **CLAUDE.md Patching:** If the project contains a `CLAUDE.md`, the generic API mode description is replaced with the selected mode. In single-mode projects (`Rest` or `GraphQL`), the "API Mode System" documentation section is condensed to a brief note. Skipped when `--next` is used.
92
102
 
93
103
  **Configuration:** `commands.server.create.*`, `defaults.author`, `defaults.noConfirm`
@@ -558,6 +568,82 @@ Additionally, the API's `CLAUDE.md` is patched to reflect the selected API mode
558
568
 
559
569
  **Configuration:** `commands.fullstack.*`, `defaults.noConfirm`
560
570
 
571
+ **Auto-detection in existing workspaces:** When `lt fullstack init` runs without a name argument inside a directory that already looks like a fullstack workspace (contains `pnpm-workspace.yaml` or `projects/`), it inspects the layout and dispatches to the matching incremental command:
572
+
573
+ - both `projects/api` and `projects/app` exist → refuses with a hint to use `add-api` / `add-app` directly
574
+ - only `projects/app` exists → delegates to `lt fullstack add-api` (with all original flags forwarded)
575
+ - only `projects/api` exists → delegates to `lt fullstack add-app`
576
+ - neither exists → falls through to the regular new-workspace flow
577
+
578
+ To force a brand-new workspace from inside an existing one, pass `--name <slug>`.
579
+
580
+ ---
581
+
582
+ ### `lt fullstack add-api`
583
+
584
+ Add a NestJS API (`projects/api/`) to an existing fullstack workspace that currently only contains a frontend (`projects/app/`). Mirrors every API-related flag from `lt fullstack init` so configuration stays consistent across both flows.
585
+
586
+ **Usage:**
587
+ ```bash
588
+ lt fullstack add-api [options]
589
+ ```
590
+
591
+ **Options:**
592
+ | Option | Description |
593
+ |--------|-------------|
594
+ | `--api-mode <mode>` | API mode: `Rest`, `GraphQL`, or `Both` |
595
+ | `--framework-mode <mode>` | Backend framework consumption mode: `npm` (classic) or `vendor` (core copied to `src/core/`) |
596
+ | `--framework-upstream-branch <ref>` | Upstream `nest-server` branch/tag/commit to vendor (only with `--framework-mode vendor`) |
597
+ | `--api-branch <branch>` | Branch of `nest-server-starter` to clone |
598
+ | `--api-copy <path>` | Copy API from a local template directory |
599
+ | `--api-link <path>` | Symlink API to a local template directory (fastest, changes affect original) |
600
+ | `--next` | **Experimental:** clone [`nest-base`](https://github.com/lenneTech/nest-base) (Bun + Prisma 7 + Postgres + Better-Auth) instead of `nest-server-starter`. Forces `--api-mode Rest` and `--framework-mode npm`, runs `bun run rename` post-clone, skips workspace install. |
601
+ | `--workspace-dir <path>` | Workspace root. When omitted, defaults to cwd; if cwd is not a workspace, the command walks up until it finds one (so it works from inside `projects/api/src/`). |
602
+ | `--skip-install` | Skip `pnpm install` and the post-install format pass |
603
+ | `--dry-run` | Print the resolved plan without making any changes |
604
+ | `--noConfirm` | Skip all interactive prompts |
605
+
606
+ **Refusal cases:**
607
+ - `projects/api/` already exists → suggests `lt fullstack init` in a fresh directory
608
+ - no workspace detected at the target path → asks the user to run `lt fullstack init` first
609
+
610
+ **Side effects:** writes `projects/api/lt.config.json` with the resolved `apiMode` + `frameworkMode`, hoists workspace-scoped `pnpm.overrides` from sub-projects to the root, runs `pnpm install` + `oxfmt` on the new sub-project (unless `--skip-install` is set).
611
+
612
+ **Configuration:** Reads `commands.fullstack.*` (same keys as `lt fullstack init`).
613
+
614
+ ---
615
+
616
+ ### `lt fullstack add-app`
617
+
618
+ Add a frontend app (`projects/app/`) to an existing fullstack workspace that currently only contains an API (`projects/api/`). Mirrors every frontend-related flag from `lt fullstack init`.
619
+
620
+ **Usage:**
621
+ ```bash
622
+ lt fullstack add-app [options]
623
+ ```
624
+
625
+ **Options:**
626
+ | Option | Description |
627
+ |--------|-------------|
628
+ | `--frontend <type>` | Frontend framework: `nuxt` or `angular` |
629
+ | `--frontend-framework-mode <mode>` | Frontend framework consumption mode: `npm` or `vendor` (nuxt-extensions copied to `app/core/`) |
630
+ | `--frontend-branch <branch>` | Branch of the frontend starter to clone (`ng-base-starter` or `nuxt-base-starter`) |
631
+ | `--frontend-copy <path>` | Copy frontend from a local template directory |
632
+ | `--frontend-link <path>` | Symlink frontend to a local template directory (fastest, changes affect original) |
633
+ | `--next` | Default the nuxt-base-starter ref to the `next` branch (auth `basePath` aligned with the experimental `--next` API) |
634
+ | `--workspace-dir <path>` | Workspace root. When omitted, defaults to cwd; if cwd is not a workspace, the command walks up until it finds one (so it works from inside `projects/api/src/`). |
635
+ | `--skip-install` | Skip `pnpm install` and the post-install format pass |
636
+ | `--dry-run` | Print the resolved plan without making any changes |
637
+ | `--noConfirm` | Skip all interactive prompts |
638
+
639
+ **Refusal cases:**
640
+ - `projects/app/` already exists → suggests `lt fullstack init` in a fresh directory
641
+ - no workspace detected at the target path → asks the user to run `lt fullstack init` first
642
+
643
+ **Side effects:** patches `projects/app/.env` with a project-specific `NUXT_PUBLIC_STORAGE_PREFIX`, optionally vendorizes `nuxt-extensions` into `app/core/`, hoists workspace-scoped `pnpm.overrides`, runs `pnpm install` + `oxfmt` on the new sub-project (unless `--skip-install` is set).
644
+
645
+ **Configuration:** Reads `commands.fullstack.*` (same keys as `lt fullstack init`).
646
+
561
647
  ---
562
648
 
563
649
  ### `lt fullstack convert-mode`
@@ -689,7 +775,7 @@ lt npm update
689
775
 
690
776
  ### `lt frontend angular`
691
777
 
692
- Creates a new Angular workspace using ng-base-starter.
778
+ Creates a new standalone Angular workspace using ng-base-starter. For an in-workspace app, prefer [`lt fullstack add-app --frontend angular`](#lt-fullstack-add-app).
693
779
 
694
780
  **Usage:**
695
781
  ```bash
@@ -699,21 +785,26 @@ lt frontend angular [name] [options]
699
785
  **Options:**
700
786
  | Option | Description |
701
787
  |--------|-------------|
788
+ | `--name <name>` | Workspace name (preferred over the positional argument) |
702
789
  | `--branch <branch>` / `-b` | Branch of ng-base-starter to use as template |
703
790
  | `--copy <path>` / `-c` | Copy from local template directory instead of cloning |
704
791
  | `--link <path>` | Symlink to local template directory (fastest, changes affect original) |
705
792
  | `--localize` | Enable Angular localize |
706
793
  | `--noLocalize` | Disable Angular localize |
707
794
  | `--gitLink <url>` | Git repository URL to link |
795
+ | `--dry-run` | Print the resolved plan and exit without making any changes |
796
+ | `--force` | Override the workspace-detection abort under `--noConfirm` |
708
797
  | `--noConfirm` / `-y` | Skip confirmation prompts |
709
798
 
799
+ **Workspace-awareness:** Inside a fullstack workspace the command is interactive (confirm prompt), but under `--noConfirm` it **refuses** with exit code 1 and points the caller to `lt fullstack add-app --frontend angular`. Pass `--noConfirm --force` to override (rare).
800
+
710
801
  **Configuration:** `commands.frontend.angular.*`, `defaults.noConfirm`
711
802
 
712
803
  ---
713
804
 
714
805
  ### `lt frontend nuxt`
715
806
 
716
- Creates a new Nuxt workspace using nuxt-base-starter.
807
+ Creates a new standalone Nuxt workspace using nuxt-base-starter. For an in-workspace app, prefer [`lt fullstack add-app --frontend nuxt`](#lt-fullstack-add-app).
717
808
 
718
809
  **Usage:**
719
810
  ```bash
@@ -723,16 +814,24 @@ lt frontend nuxt [options]
723
814
  **Options:**
724
815
  | Option | Description |
725
816
  |--------|-------------|
817
+ | `--name <name>` | Workspace name |
726
818
  | `--branch <branch>` / `-b` | Branch of nuxt-base-starter to use (uses git clone instead of create-nuxt-base) |
727
819
  | `--copy <path>` / `-c` | Copy from local template directory instead of cloning |
728
820
  | `--link <path>` | Symlink to local template directory (fastest, changes affect original) |
821
+ | `--frontend-framework-mode <npm\|vendor>` | Frontend framework consumption mode (`vendor` copies `nuxt-extensions` into `app/core/`) |
822
+ | `--next` | Default branch to `nuxt-base-starter#next` (auth `basePath` aligned with the experimental `--next` API) |
823
+ | `--dry-run` | Print the resolved plan and exit without making any changes |
824
+ | `--force` | Override the workspace-detection abort under `--noConfirm` |
825
+ | `--noConfirm` | Skip confirmation prompts (requires `--name`) |
729
826
 
730
827
  **Note:** For `--copy` and `--link`, specify the path to the `nuxt-base-template/` subdirectory, not the repository root:
731
828
  ```bash
732
829
  lt frontend nuxt --copy /path/to/nuxt-base-starter/nuxt-base-template
733
830
  ```
734
831
 
735
- **Configuration:** `commands.frontend.nuxt.*`
832
+ **Workspace-awareness:** Inside a fullstack workspace the command is interactive (confirm prompt), but under `--noConfirm` it **refuses** with exit code 1 and points the caller to `lt fullstack add-app --frontend nuxt`. Pass `--noConfirm --force` to override (rare).
833
+
834
+ **Configuration:** `commands.frontend.nuxt.*`, `commands.fullstack.frontendFrameworkMode` (shared with `init` / `add-app`)
736
835
 
737
836
  ---
738
837
 
@@ -1463,6 +1562,53 @@ lt tools crawl https://lenne.tech --all --noConfirm
1463
1562
  lt tools crawl https://example.com --all --no-render --no-prune --noConfirm
1464
1563
  ```
1465
1564
 
1565
+ ### `lt tools ocr`
1566
+
1567
+ Converts PDFs to clean Markdown using [marker-pdf](https://github.com/datalab-to/marker) — a PyTorch-based, layout-aware OCR engine that produces real Markdown tables, headings and lists. On Apple Silicon (M-series) inference runs on the GPU via Metal Performance Shaders (MPS) and is typically 5–15× faster than CPU-only PDF text extractors. Marker is auto-installed into an isolated virtualenv at `~/.lt/marker/.venv/` on first use; subsequent runs reuse the cached environment and ~3 GB of model weights.
1568
+
1569
+ **Aliases:** `ocr`, `pdf2md`
1570
+
1571
+ **Usage:**
1572
+ ```bash
1573
+ lt tools ocr <file.pdf|directory> [options]
1574
+ lt tools ocr --status # Show installation status
1575
+ lt tools ocr --install # Install marker-pdf without converting anything
1576
+ ```
1577
+
1578
+ **Options:**
1579
+ - `--output-dir <dir>` — Output directory (default: `<input>-MD/` for batch, `<input>.md-out/` for single).
1580
+ - `--workers <n>` — Parallel worker processes for batch mode (default `3`).
1581
+ - `--device <auto|mps|cuda|cpu>` — Override `TORCH_DEVICE`. Default `auto` picks `mps` on Apple Silicon, `cpu` elsewhere. Set `cuda` if running on a Linux machine with an NVIDIA GPU and the appropriate PyTorch CUDA build.
1582
+ - `--skip-existing` / `--no-skip-existing` — Skip already-converted files in batch mode (default **on**).
1583
+ - `--keep-images` — Extract embedded images alongside the Markdown (default **off** — Markdown only).
1584
+ - `--format <markdown|json|html|chunks>` — Output format (default `markdown`).
1585
+
1586
+ **Setup notes:**
1587
+ - Requires `python3` (≥ 3.10) on PATH.
1588
+ - Uses `uv` if available (fastest install path); falls back to `python3 -m venv` + `pip` otherwise.
1589
+ - The first conversion is slower because the model weights download (~3 GB). Subsequent runs start instantly.
1590
+ - Apple Silicon: `device: mps` is auto-selected. Linux/CUDA: pass `--device cuda`.
1591
+
1592
+ **Examples:**
1593
+ ```bash
1594
+ # Inspect tooling status (python3, uv, venv path, auto-detected device)
1595
+ lt tools ocr --status
1596
+
1597
+ # One-time install (skip if you just want to convert and let auto-install handle it)
1598
+ lt tools ocr --install
1599
+
1600
+ # Convert a single PDF (creates ./report.pdf.md-out/report/report.md)
1601
+ lt tools ocr ./report.pdf
1602
+
1603
+ # Batch a directory with 4 parallel workers
1604
+ lt tools ocr ./pdfs --output-dir ./md --workers 4
1605
+
1606
+ # Force CPU mode (e.g. when MPS-related crashes occur on Sonoma)
1607
+ lt tools ocr ./report.pdf --device cpu
1608
+ ```
1609
+
1610
+ **When to reach for this command vs. the lt-knowledge ingest pipeline:** `lt tools ocr` is for **local developer workflows** — quick PDF → Markdown for research, demos, validation sets, sanity checks. For productive ingestion (Vector / Graph / Wiki layers, confidence-based fallback, Whisper for audio, archive-aware processing) use the lt-knowledge stack with its Docling + LightOnOCR sidecars. Marker is intentionally **not** added there because its MPS advantage doesn't apply in Linux containers and Docling already covers the same use cases with native confidence scoring (see `lt-knowledge/docs/OCR-COMPARISON-MARKER.md`).
1611
+
1466
1612
  ---
1467
1613
 
1468
1614
  ## Configuration Priority
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/cli",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "description": "lenne.Tech CLI: lt",
5
5
  "keywords": [
6
6
  "lenne.Tech",
@@ -31,6 +31,7 @@
31
31
  "coverage": "jest --coverage",
32
32
  "test:vendor-init": "bash scripts/test-vendor-init.sh",
33
33
  "test:frontend-vendor-init": "bash scripts/test-frontend-vendor-init.sh",
34
+ "test:incremental-fullstack": "bash scripts/test-incremental-fullstack.sh",
34
35
  "format": "prettier --write 'src/**/*.{js,ts,tsx,json}' '!src/templates/**/*'",
35
36
  "lint": "eslint './src/**/*.{ts,js,vue}'",
36
37
  "lint:fix": "eslint './src/**/*.{ts,js,vue}' --fix",