@loomweaver/cli 0.7.2

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 (3) hide show
  1. package/README.md +51 -0
  2. package/dist/main.mjs +2526 -0
  3. package/package.json +33 -0
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @loomweaver/cli
2
+
3
+ LoomWeaver's scaffolding as a command. It generates weavers, distributions and
4
+ integrations into **any** project — no Nx workspace, no LoomWeaver checkout, no AI assistant.
5
+
6
+ ```bash
7
+ npx @loomweaver/cli weaver --id notes --command --shortcut 'mod+shift+n' --out src/lib/notes
8
+ npx @loomweaver/cli list
9
+ npx @loomweaver/cli --help
10
+ ```
11
+
12
+ It also validates what the platform parses defensively, which is where mistakes go unreported:
13
+
14
+ ```bash
15
+ npx @loomweaver/cli validate-manifest --id notes --capabilities ui,contributions
16
+ npx @loomweaver/cli validate-i18n --dir src/lib/notes/src/lib/i18n --strict
17
+ npx @loomweaver/cli validate-catalog --file public/plugins/catalog.json --strict
18
+ ```
19
+
20
+ The generators are bundled in (`esbuild`, devkit inlined), so there is no transitive install, and the
21
+ version matches the platform packages — `loom --version` tells you which `@loomweaver/shell` the output
22
+ fits.
23
+
24
+ ## Why this exists next to `@loomweaver/mcp`
25
+
26
+ Both wrap the same pure core `generate(recipe, input) → FileMap`, so their output is identical. They
27
+ differ in who drives:
28
+
29
+ - **`@loomweaver/cli`** — you pass flags; the CLI writes the files. Scriptable, repeatable, usable in CI.
30
+ - **`@loomweaver/mcp`** — you describe what you want; your assistant picks the options and writes the files.
31
+
32
+ `@loomweaver/devkit` is the third adapter: an Nx generator collection. It is the only one that can change
33
+ files as well as write them (it registers the project and adds the tsconfig alias), because Nx hands
34
+ it a virtual tree of the workspace. See `docs/scaffolding.md`.
35
+
36
+ ## Guards
37
+
38
+ - An existing file **stops the run** and is named; `--force` overwrites.
39
+ - `--dry-run` lists what would be written — naming any that already exist — and writes nothing.
40
+ - A generated path that would escape `--out` is refused — this is the one place in the devkit that
41
+ turns data into files. A symlink inside `--out` is **replaced, never followed**, so `--force`
42
+ cannot write through it onto a file elsewhere.
43
+ - An unknown `--flag` fails the run and is named, so a typo cannot silently drop an option.
44
+ - Validation warnings report but exit 0; `--strict` makes them fail, for pipelines.
45
+
46
+ ## Build
47
+
48
+ ```bash
49
+ nx bundle cli # → dist/main.mjs (self-contained, executable)
50
+ nx test cli
51
+ ```