From ad7b511ca57466f3389e87b7e204fd7f67466b4c Mon Sep 17 00:00:00 2001
From: "Alex C. Huber" <91097647+alexchuber@users.noreply.github.com>
Date: Wed, 16 Sep 2026 23:50:59 -0400
Subject: [PATCH 1/6] feat: add pipeline CLI
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---
CONTRIBUTING.md | 20 ++-
README.md | 4 +
docs/usage.md | 53 +++++++
eslint.config.mjs | 2 +-
package.json | 8 +-
packages/cli/LICENSE | 201 +++++++++++++++++++++++++
packages/cli/README.md | 46 ++++++
packages/cli/bin/node-assets.cjs | 10 ++
packages/cli/package.json | 35 +++++
packages/cli/src/cli.ts | 77 ++++++++++
packages/cli/src/pipeline.ts | 76 ++++++++++
packages/cli/vite.config.ts | 21 +++
pnpm-lock.yaml | 6 +
pnpm-workspace.yaml | 3 +
tests/e2e/cli.test.ts | 243 +++++++++++++++++++++++++++++++
tests/helpers/cli.ts | 54 +++++++
tsconfig.json | 5 +-
17 files changed, 858 insertions(+), 6 deletions(-)
create mode 100644 packages/cli/LICENSE
create mode 100644 packages/cli/README.md
create mode 100755 packages/cli/bin/node-assets.cjs
create mode 100644 packages/cli/package.json
create mode 100644 packages/cli/src/cli.ts
create mode 100644 packages/cli/src/pipeline.ts
create mode 100644 packages/cli/vite.config.ts
create mode 100644 tests/e2e/cli.test.ts
create mode 100644 tests/helpers/cli.ts
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f088fd2..cf7a41f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -14,6 +14,15 @@ pnpm install
pnpm build
```
+The library remains at the repository root; `packages/cli` is a separate pnpm
+workspace package that depends on it. Build both packages before running the
+local CLI:
+
+```sh
+pnpm cli pipeline input.gltf ktx2 draco output.glb
+pnpm cli --help
+```
+
## Scripts
```sh
@@ -22,8 +31,17 @@ pnpm lint:fix # ESLint autofix
pnpm format # Write Prettier formatting
pnpm test # Run Vitest
pnpm test:watch # Run Vitest in watch mode
-pnpm build # Build with Vite and emit dist/
+pnpm build # Build the library, then the CLI
+pnpm build:library # Build only the library into dist/
+pnpm cli # Run the built CLI (append pipeline arguments)
pnpm typedocs # Generate the TypeDoc API reference
```
+The shared lint, format, and typecheck commands cover both packages. CLI tests
+live in `tests/e2e/cli.test.ts` and build isolated package fixtures:
+
+```sh
+pnpm test tests/e2e/cli.test.ts
+```
+
Make sure you've run `pnpm lint`, `pnpm test`, and `pnpm build` before opening a pull request.
diff --git a/README.md b/README.md
index 794406d..ec0f3ca 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,10 @@ A graph-based system for preparing 3D assets for the web.
> **⚠️ Notice:** This package is experimental. API is subject to change and not intended for production use.
+Use the [library or command-line pipelines](docs/usage.md) to process assets.
+The separate [CLI package](packages/cli/README.md) builds a pipeline from file
+extensions and optional transform names.
+
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md).
diff --git a/docs/usage.md b/docs/usage.md
index e2c0206..2458b9d 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -1,3 +1,56 @@
+# Command-line pipelines
+
+The separate `@babylonjs/node-assets-cli` package provides the `node-assets` command:
+
+```sh
+node-assets pipeline input.gltf output.glb
+node-assets pipeline input.glb ktx2 draco output.glb
+```
+
+The syntax is `node-assets pipeline [...blocks]