Skip to content

upload ​

Compile your stream/aggregation and realm definitions and upload them directly to a running iwentsourcing API.

Usage ​

bash
iwentsourcing upload <src...> [options]
ArgumentDescription
<src...>One or more source entry files that export your stream/aggregation definitions

Options ​

FlagDefaultDescription
--host <url>http://localhost:3333API host URL
-t, --tenant <tenant>defaultTenant to upload to
-v, --variable <name...>—Process only the specified named export(s). By default, all exports are processed.

What It Does ​

  1. Compiles your source files using esbuild
  2. Builds a manifesto in memory by resolving all stream/aggregation definitions
  3. Sends the manifesto to the API, which checks for breaking schema changes and rejects the upload if any are detected
  4. Registers the new definitions — existing stream instances running a previous version are not removed

Unlike build, upload does not write a manifesto file to disk. The manifesto is built and sent in a single step. Use build when you need to inspect or store the manifesto separately.

Examples ​

bash
# Upload to local dev server
iwentsourcing upload src/state/export.ts

# Upload to production
iwentsourcing upload src/state/export.ts --host https://api.iwentsourcing.com --tenant production

# Upload specific exports only
iwentsourcing upload src/state/export.ts --variable todoStream personalTodoAggregation