@lenne.tech/cli 1.12.0 → 1.14.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
@@ -79,13 +79,16 @@ lt server create [name] [options]
79
79
  |--------|-------------|
80
80
  | `--description <text>` | Project description |
81
81
  | `--author <name>` | Author name |
82
+ | `--api-mode <Rest\|GraphQL\|Both>` | API mode (ignored with `--next`) |
83
+ | `--framework-mode <npm\|vendor>` | Framework consumption mode (ignored with `--next`) |
82
84
  | `--branch <branch>` / `-b` | Branch of nest-server-starter to use as template |
83
85
  | `--copy <path>` / `-c` | Copy from local template directory instead of cloning |
84
86
  | `--link <path>` | Symlink to local template directory (fastest, changes affect original) |
85
87
  | `--git` | Initialize git repository |
88
+ | `--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. |
86
89
  | `--noConfirm` | Skip confirmation prompts |
87
90
 
88
- **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.
91
+ **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.
89
92
 
90
93
  **Configuration:** `commands.server.create.*`, `defaults.author`, `defaults.noConfirm`
91
94
 
@@ -532,6 +535,7 @@ lt fullstack init [options]
532
535
  | `--framework-mode <mode>` | Backend framework consumption mode: `npm` (classic) or `vendor` (pilot, core copied to `src/core/`) |
533
536
  | `--framework-upstream-branch <ref>` | Upstream `nest-server` branch/tag to vendor from (only with `--framework-mode vendor`) |
534
537
  | `--frontend-framework-mode <mode>` | Frontend framework consumption mode: `npm` or `vendor` (nuxt-extensions copied to `app/core/`) |
538
+ | `--next` | **Experimental:** clone [`nest-base`](https://github.com/lenneTech/nest-base) (Bun + Prisma 7 + Postgres + Better-Auth) for the API instead of `nest-server-starter`. Forces `--api-mode Rest` and `--framework-mode npm`, skips workspace install (run `pnpm install` for app and `bun install` for api manually). |
535
539
  | `--dry-run` | Print the resolved plan without making any changes |
536
540
  | `--git` | Push initial commit to remote repository (git is always initialized) |
537
541
  | `--git-link <url>` | Git remote repository URL (required when `--git` is true) |
@@ -1409,6 +1413,58 @@ lt tools regex [pattern] [text]
1409
1413
 
1410
1414
  ---
1411
1415
 
1416
+ ### `lt tools crawl`
1417
+
1418
+ Crawls a website and stores each page as a Markdown file (with YAML frontmatter containing `source_url`, `download_date`, `first_downloaded`, `description`, language, word count, etc.) so it can be consumed as a Claude Code knowledge base. Optionally follows same-origin links up to a configurable depth, seeds the queue from `<origin>/sitemap.xml`, and downloads referenced images into a shared `images/` folder (deduplicated by content hash). Re-running the command against the same output directory updates existing pages while preserving their original `first_downloaded` timestamp.
1419
+
1420
+ **Alias:** `cr`
1421
+
1422
+ **Usage:**
1423
+ ```bash
1424
+ lt tools crawl <url> [options]
1425
+ ```
1426
+
1427
+ **Options:**
1428
+ - `--out <dir>` — Output directory (default: current directory). Single-page crawls write the `.md` directly here; multi-page crawls generate `<out>/README.md` plus `<out>/pages/` and `<out>/images/`.
1429
+ - `--depth <n|all>` — Link depth (default `0`). `0` = only the start page, `1` = start page + direct same-origin links, `2` = and their links, ... Use `--depth all` (or `--depth -1`, or the shortcut flag `--all`) to follow every same-origin link transitively; the crawl then stops when `--max-pages` is reached.
1430
+ - `--all` — Shortcut for `--depth all`.
1431
+ - `--render` / `--no-render` — Render each page through a headless browser before extraction (default **on**). Required for SPAs (Vue/Nuxt/React/Angular) whose content is client-rendered. Uses `playwright-core` with system Chrome / Edge first, then Playwright's bundled Chromium. Use `--no-render` for a plain HTTP fetch when you know the site is static (faster, no browser needed).
1432
+ - `--install-browser` — If `--render` finds no browser, auto-install Playwright's Chromium (one-time ~170 MB download).
1433
+ - `--prune` / `--no-prune` — After a multi-page crawl, remove any `.md` or image files inside `<out>/pages` and `<out>/images` that were not written by the current run (default **on**). Keeps the knowledge base aligned with the live site on update runs. Empty subdirectories are cleaned up too. Ignored in single-page mode. Use `--no-prune` to preserve old files.
1434
+ - `--no-images` — Disable image downloads.
1435
+ - `--no-sitemap` — Skip discovery via `<origin>/sitemap.xml`.
1436
+ - `--concurrency <n>` — Parallel HTTP requests (default `4`).
1437
+ - `--max-pages <n>` — Safety cap on total pages (default `200`).
1438
+ - `--selector <css>` — CSS selector scoping the main content (e.g. `article`, `main`).
1439
+ - `--timeout <ms>` — HTTP request timeout in ms (default `20000`).
1440
+ - `--noConfirm` — Skip confirmation prompts.
1441
+
1442
+ **Examples:**
1443
+ ```bash
1444
+ # Single page into the current directory
1445
+ lt tools crawl https://example.com/article --noConfirm
1446
+
1447
+ # Crawl start page + direct links into ./knowledge
1448
+ lt tools crawl https://example.com --out ./knowledge --depth 1 --noConfirm
1449
+
1450
+ # Full mini-site with sitemap seeding and images
1451
+ lt tools crawl https://example.com --out ./kb --depth 2 --max-pages 100 --noConfirm
1452
+
1453
+ # Crawl every reachable same-origin page (safety cap via --max-pages)
1454
+ lt tools crawl https://example.com --out ./kb --depth all --max-pages 500 --noConfirm
1455
+
1456
+ # Same, using the --all shortcut
1457
+ lt tools crawl https://example.com --out ./kb --all --max-pages 500 --noConfirm
1458
+
1459
+ # Full SPA-aware crawl (render + prune are on by default)
1460
+ lt tools crawl https://lenne.tech --all --noConfirm
1461
+
1462
+ # Opt-out: plain HTTP fetch for a known-static site, keep orphans
1463
+ lt tools crawl https://example.com --all --no-render --no-prune --noConfirm
1464
+ ```
1465
+
1466
+ ---
1467
+
1412
1468
  ## Configuration Priority
1413
1469
 
1414
1470
  All configurable commands follow this priority order (highest to lowest):
package/docs/lt.config.md CHANGED
@@ -923,6 +923,43 @@ Reinitializes npm packages.
923
923
  }
924
924
  ```
925
925
 
926
+ #### `lt tools crawl`
927
+
928
+ Crawls a website into Markdown files (knowledge base builder).
929
+
930
+ | Field | Type | Default | Description |
931
+ |-------|------|---------|-------------|
932
+ | `commands.tools.crawl.out` | `string` | `.` | Output directory |
933
+ | `commands.tools.crawl.depth` | `number \| "all"` | `0` | Link depth (0 = only start page, 1 = direct links, ..., `"all"` or `-1` = follow every same-origin link, bounded by `maxPages`) |
934
+ | `commands.tools.crawl.includeImages` | `boolean` | `true` | Download images and inline with local paths |
935
+ | `commands.tools.crawl.includeSitemap` | `boolean` | `true` | Also seed queue from `<origin>/sitemap.xml` |
936
+ | `commands.tools.crawl.concurrency` | `number` | `4` | Parallel HTTP requests |
937
+ | `commands.tools.crawl.maxPages` | `number` | `200` | Safety cap on total pages |
938
+ | `commands.tools.crawl.selector` | `string` | – | CSS selector for main content |
939
+ | `commands.tools.crawl.timeout` | `number` | `20000` | HTTP request timeout in ms |
940
+ | `commands.tools.crawl.renderJs` | `boolean` | `true` | Render pages through a headless browser (for SPAs). Uses playwright-core. Set to `false` for plain HTTP. |
941
+ | `commands.tools.crawl.prune` | `boolean` | `true` | Remove orphaned `.md` / image files after a multi-page crawl (update-in-place). Set to `false` to preserve old files. |
942
+ | `commands.tools.crawl.noConfirm` | `boolean` | `false` | Skip confirmation prompts |
943
+
944
+ **Example:**
945
+ ```json
946
+ {
947
+ "commands": {
948
+ "tools": {
949
+ "crawl": {
950
+ "out": "./knowledge",
951
+ "depth": 2,
952
+ "includeImages": true,
953
+ "includeSitemap": true,
954
+ "concurrency": 4,
955
+ "maxPages": 200,
956
+ "noConfirm": true
957
+ }
958
+ }
959
+ }
960
+ }
961
+ ```
962
+
926
963
  ---
927
964
 
928
965
  ### Metadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/cli",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "lenne.Tech CLI: lt",
5
5
  "keywords": [
6
6
  "lenne.Tech",
@@ -61,14 +61,19 @@
61
61
  "@lenne.tech/cli-plugin-helper": "0.0.14",
62
62
  "axios": "1.15.0",
63
63
  "bcrypt": "6.0.0",
64
+ "defuddle": "0.17.0",
64
65
  "glob": "13.0.6",
65
66
  "gluegun": "5.2.2",
66
67
  "js-sha256": "0.11.1",
67
68
  "js-yaml": "4.1.1",
69
+ "jsdom": "29.0.2",
68
70
  "lodash": "4.18.1",
69
71
  "open": "11.0.0",
72
+ "playwright-core": "1.59.1",
70
73
  "ts-morph": "28.0.0",
71
74
  "ts-node": "10.9.2",
75
+ "turndown": "7.2.4",
76
+ "turndown-plugin-gfm": "1.0.2",
72
77
  "typescript": "6.0.3"
73
78
  },
74
79
  "devDependencies": {
@@ -77,8 +82,10 @@
77
82
  "@types/ejs": "3.1.5",
78
83
  "@types/jest": "30.0.0",
79
84
  "@types/js-yaml": "4.0.9",
85
+ "@types/jsdom": "28.0.1",
80
86
  "@types/lodash": "4.17.24",
81
87
  "@types/node": "25.6.0",
88
+ "@types/turndown": "5.0.6",
82
89
  "@typescript-eslint/eslint-plugin": "8.58.2",
83
90
  "@typescript-eslint/parser": "8.58.2",
84
91
  "ejs": "5.0.2",