From 85f2196916ce4baba4431bf733dec756cca02aa7 Mon Sep 17 00:00:00 2001 From: clockwork-labs-bot Date: Fri, 23 Oct 2026 03:40:58 -0400 Subject: [PATCH 1/4] docs: document IDC receiver binding CLI preparation --- .../plugins/spacetimedb/skills/cli/SKILL.md | 8 ++ .../00100-databases/00200-spacetime-dev.md | 6 ++ .../00100-cli-reference.md | 10 ++- .../00300-spacetime-json.md | 85 +++++++++++++++++-- skills/cli/SKILL.md | 8 ++ 5 files changed, 108 insertions(+), 9 deletions(-) diff --git a/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md b/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md index e7a51487fc1..75cc9f9b00f 100644 --- a/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md +++ b/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md @@ -50,6 +50,14 @@ spacetime generate --lang typescript|csharp|rust --out-dir ./bindings --module-p spacetime generate --lang unrealcpp --uproject-dir ./MyGame --module-path ./server --unreal-module-name MyGame ``` +### Receiver Bindings (IDC CLI Preparation) + +`spacetime generate --bindings client` is the default. `--bindings module` prepares module-side receiver generation, but every receiver generator currently fails with “receiver binding generation is not implemented yet”; do not present this as a working workflow. `cpp` is module-only; `unrealcpp` is client-only. + +In `spacetime.json`, each sender's non-inherited `dependencies` array requires sender `module-path` and dependency `name` plus receiver `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit sender build settings. `generate ` selects that sender's generate entries and dependencies. Language defaults come from the sender module; output defaults are `/src/remote_bindings` (Rust/TypeScript) or `/remote_bindings` (C#/C++). Explicit config `out-dir` is config-relative. + +`dev` attempts only root dependencies before building, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples and current limitations. + ### Publishing & Deployment ```bash diff --git a/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md b/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md index f8384e5bc6e..7f30e042d22 100644 --- a/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md +++ b/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md @@ -100,6 +100,12 @@ After completing setup, `spacetime dev`: Your database will be available at `https://maincloud.spacetimedb.com`. +### Receiver dependencies + +When the root database in `spacetime.json` declares `dependencies`, `dev` attempts receiver binding generation **before** building the sender, including on rebuilds. It watches receiver sources as well as published module sources, even when the receivers are outside the sender directory. Child targets may provide receiver source settings, but their own dependency arrays are not processed by `dev`. + +Receiver code generators are not implemented yet, so this step currently fails. `--skip-generate` skips both receiver and client binding generation and removes receiver-only watch paths; it does not supply missing bindings. `--skip-publish` does not skip generation. See the [receiver dependency reference](/cli-reference/spacetime-json#receiver-dependencies) for configuration and current limitations. + ### Client Development Server `spacetime dev` can automatically run your client's development server alongside the SpacetimeDB module. This is configured via the `spacetime.json` file in your project root: diff --git a/docs/docs/00300-resources/00100-cli-reference/00100-cli-reference.md b/docs/docs/00300-resources/00100-cli-reference/00100-cli-reference.md index c57833c115c..3508e40ca8f 100644 --- a/docs/docs/00300-resources/00100-cli-reference/00100-cli-reference.md +++ b/docs/docs/00300-resources/00100-cli-reference/00100-cli-reference.md @@ -345,7 +345,7 @@ Start development mode with auto-regenerate client module bindings, auto-rebuild * `--module-path ` — Path to the SpacetimeDB server module, relative to current directory. Defaults to `/spacetimedb`. * `--client-lang ` — The programming language for the generated client module bindings (e.g., typescript, csharp, rust, unrealcpp). If not specified, it will be detected from the project. - Possible values: `csharp`, `typescript`, `rust`, `unrealcpp` + Possible values: `csharp`, `typescript`, `rust`, `cpp`, `unrealcpp` * `-s`, `--server ` — The nickname, host name or URL of the server to publish to * `-y`, `--yes` — Run non-interactively wherever possible. This will answer "yes" to almost all prompts, but will sometimes answer "no" to preserve non-interactivity (e.g. when prompting whether to log in with spacetimedb.com). @@ -468,7 +468,13 @@ Run `spacetime help generate` for more detailed information. * `-l`, `--lang ` — The language to generate - Possible values: `csharp`, `typescript`, `rust`, `unrealcpp` + Possible values: `csharp`, `typescript`, `rust`, `cpp`, `unrealcpp` + +* `--bindings ` — The kind of bindings to generate (module bindings are not implemented yet) + + Default value: `client` + + Possible values: `client`, `module` * `--build-options ` — Options to pass to the build command, for example --build-options='--lint-dir=' diff --git a/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md b/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md index ea874b05979..b893c0fc807 100644 --- a/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md +++ b/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md @@ -40,6 +40,7 @@ These fields can appear at any level (root or child): | `num-replicas` | number | Yes | Number of database replicas | | `anonymous` | boolean | Yes | Use anonymous identity | | `organization` | string | Yes | Organization name or identity | +| `dependencies` | array | No | Receiver binding inputs for this sender (see [Receiver dependencies](#receiver-dependencies)) | | `generate` | array | No | Generate targets (see [Generate configuration](#generate-configuration)) | | `children` | array | No | Child database entities (see [Children and inheritance](#children-and-inheritance)) | | `dev` | object | No | Dev server configuration, root-level only (see [`spacetime dev` configuration](#spacetime-dev-configuration)) | @@ -52,7 +53,8 @@ The `generate` key is an array of objects. Each object configures bindings gener | Field | Type | Description | |-------|------|-------------| -| `language` | string | Target language: `typescript`, `csharp`, `rust`, `unrealcpp` (required) | +| `language` | string | Target language: `typescript`, `csharp`, `rust`, `unrealcpp`; `cpp` is reserved for module bindings | +| `bindings` | string | `client` (default) or `module`; module binding generation is not implemented yet | | `out-dir` | string | Output directory for generated files | | `namespace` | string | C# namespace (`csharp` only) | | `unreal-module-name` | string | Unreal module name (`unrealcpp` only) | @@ -80,6 +82,73 @@ When `spacetime generate` runs, it deduplicates by module path. If multiple data } ``` +## Receiver dependencies + +Receiver bindings are module-side bindings for asynchronous inter-database communication (IDC), distinct from the client bindings used by an application connecting to a database. Declare their inputs in the sender database's `dependencies` array. + +:::caution Receiver code generation is not implemented yet +The CLI accepts receiver dependencies and `--bindings module`, resolves their inputs, and selects a generator, but receiver code generation currently fails with a language-specific “receiver binding generation is not implemented yet” error. This configuration does not yet provide a working IDC binding-generation workflow. Ordinary client bindings remain the default. +::: + +Each sender with dependencies must define `module-path`. Dependencies are not inherited by children. + +| Field | Required | Description | +|-------|----------|-------------| +| `name` | Yes | Local dependency name passed to receiver binding generation; not the receiver's database name | +| `module-path` | One source required | Receiver source directory; takes precedence over `database` when both are set | +| `database` | One source required | Exact name of another target in the same config, used to look up its local module source; not a live-schema fetch | +| `out-dir` | No | Output directory, relative to the config directory | +| `build-options` | No | Receiver build options when using a direct `module-path` | +| `dotnet-version` | No | Receiver .NET SDK version when using a direct `module-path` | + +### Receiver source without a publish target + +A direct receiver source does not need its own database target: + +```json +{ + "database": "lobby", + "module-path": "./lobby", + "dependencies": [ + { + "name": "game_world", + "module-path": "./game_world", + "out-dir": "./lobby/src/remote_bindings" + } + ] +} +``` + +Declaring a dependency does not publish the receiver. To make it a publish target too, define it under `children` and reference its `database`: + +```json +{ + "database": "lobby", + "module-path": "./lobby", + "dependencies": [ + { "name": "game_world", "database": "game-world" } + ], + "children": [ + { "database": "game-world", "module-path": "./game_world" } + ] +} +``` + +A `database` reference uses the target's `module-path`, `bin-path`, or `js-path`, and its resolved receiver build options and .NET SDK version. It fails if no matching target or module source exists. A dependency does not inherit the sender's build options or .NET SDK version. + +`spacetime generate lobby` selects the sender's regular `generate` entries and dependencies; without a database filter, generation includes all targets' entries. The receiver binding language is inferred from the sender module, not the client project. Prepared output defaults are `/src/remote_bindings` for Rust/TypeScript and `/remote_bindings` for C#/C++. These are output defaults, not a claim that those generators are implemented. + +### Explicit module-binding request + +The equivalent CLI mode can be selected explicitly. Here `--module-path` identifies the **receiver**, while `--out-dir` explicitly places output in the sender project: + +```bash +spacetime generate --no-config --bindings module --lang rust \ + --module-path ./game_world --out-dir ./lobby/src/remote_bindings +``` + +This request currently reaches the unimplemented receiver generator. `--bindings client` remains the default; `unrealcpp` is client-only, while `cpp` is accepted only with `--bindings module`. + ## Children and inheritance The `children` array defines additional database targets. Each child inherits most fields from the root by default. @@ -91,6 +160,7 @@ All fields listed in the [Fields reference](#fields-reference) with "Yes" in the The following fields are never inherited: - `database`: each child must define its own. +- `dependencies`: receiver binding inputs belong to each sender. - `generate`: tied to a specific module and output location. Inheriting generate targets is redundant when the child shares the parent's module (deduplication already handles it) and dangerous when the child uses a different module (two modules would write bindings into the same output directory). - `children`: structural, not a database property. - `dev`: root-level only. @@ -162,13 +232,14 @@ The `--run` CLI flag overrides `dev.run`. When running `spacetime dev`: -1. Build all modules defined in the config. -2. Generate bindings for all databases. -3. Publish all databases. -4. Run the client dev server specified by `dev.run`. -5. Watch for changes and repeat steps 1-4. +1. Attempt receiver binding generation for the root database's `dependencies`, before compiling the sender. +2. Build the sender and publish the selected database targets. +3. Process the root's configured `generate` entries (client bindings by default). +4. Run the client dev server specified by `dev.run` and watch for changes, repeating the build/publish/generate cycle on edits. + +Receiver dependency sources are watched even when they are outside the sender directory or not selected for publishing. Child targets can supply receiver sources for lookup, but `dev` does not process their own `dependencies` arrays. -The `--server` flag overrides the server for all databases. The `--skip-publish` flag skips step 3, and `--skip-generate` skips step 2. +The `--server` flag overrides the server for all databases. `--skip-publish` skips publishing, not receiver generation. `--skip-generate` skips both receiver and client binding generation and excludes receiver-only sources from watching. It does not create any bindings the sender needs to compile. Until receiver generators are implemented, root dependencies cause `dev` to fail at step 1 unless generation is skipped. ### Config auto-generation diff --git a/skills/cli/SKILL.md b/skills/cli/SKILL.md index e7a51487fc1..75cc9f9b00f 100644 --- a/skills/cli/SKILL.md +++ b/skills/cli/SKILL.md @@ -50,6 +50,14 @@ spacetime generate --lang typescript|csharp|rust --out-dir ./bindings --module-p spacetime generate --lang unrealcpp --uproject-dir ./MyGame --module-path ./server --unreal-module-name MyGame ``` +### Receiver Bindings (IDC CLI Preparation) + +`spacetime generate --bindings client` is the default. `--bindings module` prepares module-side receiver generation, but every receiver generator currently fails with “receiver binding generation is not implemented yet”; do not present this as a working workflow. `cpp` is module-only; `unrealcpp` is client-only. + +In `spacetime.json`, each sender's non-inherited `dependencies` array requires sender `module-path` and dependency `name` plus receiver `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit sender build settings. `generate ` selects that sender's generate entries and dependencies. Language defaults come from the sender module; output defaults are `/src/remote_bindings` (Rust/TypeScript) or `/remote_bindings` (C#/C++). Explicit config `out-dir` is config-relative. + +`dev` attempts only root dependencies before building, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples and current limitations. + ### Publishing & Deployment ```bash From 2ec3446729f007565063708d0540df27f9bd90c3 Mon Sep 17 00:00:00 2001 From: clockwork-labs-bot Date: Fri, 23 Oct 2026 04:02:17 -0400 Subject: [PATCH 2/4] docs: address receiver binding review feedback --- .../plugins/spacetimedb/skills/cli/SKILL.md | 8 ++-- crates/cli/src/subcommands/generate.rs | 2 +- .../00100-databases/00200-spacetime-dev.md | 6 ++- .../00100-cli-reference.md | 2 +- .../00300-spacetime-json.md | 44 +++++++++++-------- skills/cli/SKILL.md | 8 ++-- 6 files changed, 40 insertions(+), 30 deletions(-) diff --git a/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md b/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md index 75cc9f9b00f..d2cdc91a993 100644 --- a/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md +++ b/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md @@ -50,13 +50,13 @@ spacetime generate --lang typescript|csharp|rust --out-dir ./bindings --module-p spacetime generate --lang unrealcpp --uproject-dir ./MyGame --module-path ./server --unreal-module-name MyGame ``` -### Receiver Bindings (IDC CLI Preparation) +### Client and Module Bindings -`spacetime generate --bindings client` is the default. `--bindings module` prepares module-side receiver generation, but every receiver generator currently fails with “receiver binding generation is not implemented yet”; do not present this as a working workflow. `cpp` is module-only; `unrealcpp` is client-only. +`spacetime generate --bindings client` (default) generates bindings for an external application connecting to a database. `--bindings module` generates receiver bindings used inside a **calling database module** to call reducers in another **receiving database** through asynchronous IDC. Rust and TypeScript module bindings are supported; C#/C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode. -In `spacetime.json`, each sender's non-inherited `dependencies` array requires sender `module-path` and dependency `name` plus receiver `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit sender build settings. `generate ` selects that sender's generate entries and dependencies. Language defaults come from the sender module; output defaults are `/src/remote_bindings` (Rust/TypeScript) or `/remote_bindings` (C#/C++). Explicit config `out-dir` is config-relative. +In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit the calling module's build settings. `generate ` selects that database's generate entries and dependencies. Module binding language defaults to the calling module's language; Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. -`dev` attempts only root dependencies before building, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples and current limitations. +`dev` generates only root dependencies before building the calling module, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples. ### Publishing & Deployment diff --git a/crates/cli/src/subcommands/generate.rs b/crates/cli/src/subcommands/generate.rs index 65cba4e893d..a92f4bb1ff0 100644 --- a/crates/cli/src/subcommands/generate.rs +++ b/crates/cli/src/subcommands/generate.rs @@ -371,7 +371,7 @@ pub fn cli() -> clap::Command { .long("bindings") .value_parser(clap::value_parser!(BindingKind)) .default_value("client") - .help("The kind of bindings to generate (module bindings are not implemented yet)"), + .help("The kind of bindings to generate (client applications or inter-database module calls)"), ) .arg( Arg::new("build_options") diff --git a/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md b/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md index 7f30e042d22..e1672d0bd92 100644 --- a/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md +++ b/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md @@ -102,9 +102,11 @@ Your database will be available at `https://maincloud.spacetimedb.com`. ### Receiver dependencies -When the root database in `spacetime.json` declares `dependencies`, `dev` attempts receiver binding generation **before** building the sender, including on rebuilds. It watches receiver sources as well as published module sources, even when the receivers are outside the sender directory. Child targets may provide receiver source settings, but their own dependency arrays are not processed by `dev`. +For inter-database calls, the **calling database** needs module bindings for the **receiving database** whose reducers it calls. These are distinct from the client bindings used by an external application. Rust and TypeScript modules support receiver bindings. -Receiver code generators are not implemented yet, so this step currently fails. `--skip-generate` skips both receiver and client binding generation and removes receiver-only watch paths; it does not supply missing bindings. `--skip-publish` does not skip generation. See the [receiver dependency reference](/cli-reference/spacetime-json#receiver-dependencies) for configuration and current limitations. +When the root database in `spacetime.json` declares `dependencies`, `dev` generates those receiver bindings **before** building the calling module, including on rebuilds. It watches receiver sources as well as published module sources, even when the receivers are outside the calling module directory. Child targets may provide receiver source settings, but their own dependency arrays are not processed by `dev`. + +`--skip-generate` skips both receiver and client binding generation and removes receiver-only watch paths; it does not supply missing bindings. `--skip-publish` does not skip generation. See the [receiver dependency reference](/cli-reference/spacetime-json#receiver-dependencies) for configuration and language support. ### Client Development Server diff --git a/docs/docs/00300-resources/00100-cli-reference/00100-cli-reference.md b/docs/docs/00300-resources/00100-cli-reference/00100-cli-reference.md index 3508e40ca8f..8d80ab4d0c0 100644 --- a/docs/docs/00300-resources/00100-cli-reference/00100-cli-reference.md +++ b/docs/docs/00300-resources/00100-cli-reference/00100-cli-reference.md @@ -470,7 +470,7 @@ Run `spacetime help generate` for more detailed information. Possible values: `csharp`, `typescript`, `rust`, `cpp`, `unrealcpp` -* `--bindings ` — The kind of bindings to generate (module bindings are not implemented yet) +* `--bindings ` — The kind of bindings to generate (client applications or inter-database module calls) Default value: `client` diff --git a/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md b/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md index b893c0fc807..6ffa32173dd 100644 --- a/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md +++ b/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md @@ -40,7 +40,7 @@ These fields can appear at any level (root or child): | `num-replicas` | number | Yes | Number of database replicas | | `anonymous` | boolean | Yes | Use anonymous identity | | `organization` | string | Yes | Organization name or identity | -| `dependencies` | array | No | Receiver binding inputs for this sender (see [Receiver dependencies](#receiver-dependencies)) | +| `dependencies` | array | No | Receiver binding inputs for this calling database (see [Receiver dependencies](#receiver-dependencies)) | | `generate` | array | No | Generate targets (see [Generate configuration](#generate-configuration)) | | `children` | array | No | Child database entities (see [Children and inheritance](#children-and-inheritance)) | | `dev` | object | No | Dev server configuration, root-level only (see [`spacetime dev` configuration](#spacetime-dev-configuration)) | @@ -54,7 +54,7 @@ The `generate` key is an array of objects. Each object configures bindings gener | Field | Type | Description | |-------|------|-------------| | `language` | string | Target language: `typescript`, `csharp`, `rust`, `unrealcpp`; `cpp` is reserved for module bindings | -| `bindings` | string | `client` (default) or `module`; module binding generation is not implemented yet | +| `bindings` | string | `client` (default) for application clients, or `module` for inter-database calls | | `out-dir` | string | Output directory for generated files | | `namespace` | string | C# namespace (`csharp` only) | | `unreal-module-name` | string | Unreal module name (`unrealcpp` only) | @@ -84,13 +84,14 @@ When `spacetime generate` runs, it deduplicates by module path. If multiple data ## Receiver dependencies -Receiver bindings are module-side bindings for asynchronous inter-database communication (IDC), distinct from the client bindings used by an application connecting to a database. Declare their inputs in the sender database's `dependencies` array. +`spacetime generate` produces two kinds of bindings: -:::caution Receiver code generation is not implemented yet -The CLI accepts receiver dependencies and `--bindings module`, resolves their inputs, and selects a generator, but receiver code generation currently fails with a language-specific “receiver binding generation is not implemented yet” error. This configuration does not yet provide a working IDC binding-generation workflow. Ordinary client bindings remain the default. -::: +- **Client bindings** (`--bindings client`, the default) are used by an external application to connect to a database, subscribe to data, and call its reducers. +- **Module bindings** (`--bindings module`), also called **receiver bindings**, are used inside one database module to make asynchronous inter-database communication (IDC) calls to another database's reducers. Rust and TypeScript modules support these bindings; C# and C++ module bindings are not implemented yet. -Each sender with dependencies must define `module-path`. Dependencies are not inherited by children. +The **calling database** contains the code making the inter-database call. The **receiving database** contains the reducers being called. In the examples below, `lobby` is the calling database and `game-world` is the receiving database. Declare receiver binding inputs in the calling database's `dependencies` array. + +Each calling database with dependencies must define `module-path`. Dependencies are not inherited by children. | Field | Required | Description | |-------|----------|-------------| @@ -134,20 +135,20 @@ Declaring a dependency does not publish the receiver. To make it a publish targe } ``` -A `database` reference uses the target's `module-path`, `bin-path`, or `js-path`, and its resolved receiver build options and .NET SDK version. It fails if no matching target or module source exists. A dependency does not inherit the sender's build options or .NET SDK version. +A `database` reference uses the target's `module-path`, `bin-path`, or `js-path`, and its resolved receiver build options and .NET SDK version. It fails if no matching target or module source exists. A dependency does not inherit the calling module's build options or .NET SDK version. -`spacetime generate lobby` selects the sender's regular `generate` entries and dependencies; without a database filter, generation includes all targets' entries. The receiver binding language is inferred from the sender module, not the client project. Prepared output defaults are `/src/remote_bindings` for Rust/TypeScript and `/remote_bindings` for C#/C++. These are output defaults, not a claim that those generators are implemented. +`spacetime generate lobby` selects the calling database's regular `generate` entries and dependencies; without a database filter, generation includes all targets' entries. The module binding language is inferred from the calling module, not the external client project. Rust and TypeScript module bindings default to `/src/remote_bindings`. ### Explicit module-binding request -The equivalent CLI mode can be selected explicitly. Here `--module-path` identifies the **receiver**, while `--out-dir` explicitly places output in the sender project: +The equivalent CLI mode can be selected explicitly. Here `--module-path` identifies the **receiving module**, while `--out-dir` explicitly places output in the **calling module** project: ```bash spacetime generate --no-config --bindings module --lang rust \ --module-path ./game_world --out-dir ./lobby/src/remote_bindings ``` -This request currently reaches the unimplemented receiver generator. `--bindings client` remains the default; `unrealcpp` is client-only, while `cpp` is accepted only with `--bindings module`. +This generates Rust module bindings for `game_world` in the `lobby` module's source tree. Use `--lang typescript` for a TypeScript calling module. `unrealcpp` is client-only; the CLI accepts `cpp` only with `--bindings module`, but C++ module binding generation is not implemented yet. ## Children and inheritance @@ -160,7 +161,7 @@ All fields listed in the [Fields reference](#fields-reference) with "Yes" in the The following fields are never inherited: - `database`: each child must define its own. -- `dependencies`: receiver binding inputs belong to each sender. +- `dependencies`: receiver binding inputs belong to each calling database. - `generate`: tied to a specific module and output location. Inheriting generate targets is redundant when the child shares the parent's module (deduplication already handles it) and dangerous when the child uses a different module (two modules would write bindings into the same output directory). - `children`: structural, not a database property. - `dev`: root-level only. @@ -232,14 +233,21 @@ The `--run` CLI flag overrides `dev.run`. When running `spacetime dev`: -1. Attempt receiver binding generation for the root database's `dependencies`, before compiling the sender. -2. Build the sender and publish the selected database targets. -3. Process the root's configured `generate` entries (client bindings by default). -4. Run the client dev server specified by `dev.run` and watch for changes, repeating the build/publish/generate cycle on edits. +1. Build all modules defined in the config. +2. Generate bindings for all databases. +3. Publish all databases. +4. Run the client dev server specified by `dev.run`. +5. Watch for changes and repeat steps 1-4. + +The `--server` flag overrides the server for all databases. The `--skip-publish` flag skips step 3, and `--skip-generate` skips step 2. + +#### Additional behavior with receiver dependencies + +If the root database declares `dependencies`, `dev` generates its receiver bindings before building that database's module, both on startup and on rebuilds. This adds a pre-build step without changing the normal development workflow above. -Receiver dependency sources are watched even when they are outside the sender directory or not selected for publishing. Child targets can supply receiver sources for lookup, but `dev` does not process their own `dependencies` arrays. +Receiver dependency sources are watched even when they are outside the calling module directory or not selected for publishing. Child targets can supply receiving-module sources for lookup, but `dev` does not process their own `dependencies` arrays. -The `--server` flag overrides the server for all databases. `--skip-publish` skips publishing, not receiver generation. `--skip-generate` skips both receiver and client binding generation and excludes receiver-only sources from watching. It does not create any bindings the sender needs to compile. Until receiver generators are implemented, root dependencies cause `dev` to fail at step 1 unless generation is skipped. +`--skip-generate` skips both receiver and client binding generation and excludes receiver-only sources from watching. It does not create any bindings the calling module needs to compile. `--skip-publish` skips publishing, not binding generation. ### Config auto-generation diff --git a/skills/cli/SKILL.md b/skills/cli/SKILL.md index 75cc9f9b00f..d2cdc91a993 100644 --- a/skills/cli/SKILL.md +++ b/skills/cli/SKILL.md @@ -50,13 +50,13 @@ spacetime generate --lang typescript|csharp|rust --out-dir ./bindings --module-p spacetime generate --lang unrealcpp --uproject-dir ./MyGame --module-path ./server --unreal-module-name MyGame ``` -### Receiver Bindings (IDC CLI Preparation) +### Client and Module Bindings -`spacetime generate --bindings client` is the default. `--bindings module` prepares module-side receiver generation, but every receiver generator currently fails with “receiver binding generation is not implemented yet”; do not present this as a working workflow. `cpp` is module-only; `unrealcpp` is client-only. +`spacetime generate --bindings client` (default) generates bindings for an external application connecting to a database. `--bindings module` generates receiver bindings used inside a **calling database module** to call reducers in another **receiving database** through asynchronous IDC. Rust and TypeScript module bindings are supported; C#/C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode. -In `spacetime.json`, each sender's non-inherited `dependencies` array requires sender `module-path` and dependency `name` plus receiver `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit sender build settings. `generate ` selects that sender's generate entries and dependencies. Language defaults come from the sender module; output defaults are `/src/remote_bindings` (Rust/TypeScript) or `/remote_bindings` (C#/C++). Explicit config `out-dir` is config-relative. +In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit the calling module's build settings. `generate ` selects that database's generate entries and dependencies. Module binding language defaults to the calling module's language; Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. -`dev` attempts only root dependencies before building, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples and current limitations. +`dev` generates only root dependencies before building the calling module, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples. ### Publishing & Deployment From 3e7056dcb5046141130aa382a56a326e802e8f41 Mon Sep 17 00:00:00 2001 From: clockwork-labs-bot Date: Fri, 23 Oct 2026 04:10:38 -0400 Subject: [PATCH 3/4] docs: clarify configured binding selection and client terminology --- codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md | 4 ++-- .../00100-databases/00200-spacetime-dev.md | 2 +- .../00100-cli-reference/00300-spacetime-json.md | 8 +++++--- skills/cli/SKILL.md | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md b/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md index d2cdc91a993..af0a977cc6a 100644 --- a/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md +++ b/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md @@ -52,9 +52,9 @@ spacetime generate --lang unrealcpp --uproject-dir ./MyGame --module-path ./serv ### Client and Module Bindings -`spacetime generate --bindings client` (default) generates bindings for an external application connecting to a database. `--bindings module` generates receiver bindings used inside a **calling database module** to call reducers in another **receiving database** through asynchronous IDC. Rust and TypeScript module bindings are supported; C#/C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode. +`spacetime generate --bindings client` (default) generates bindings for clients connecting to a database. `--bindings module` generates receiver bindings used inside a **calling database module** to call reducers in another **receiving database** through asynchronous IDC. Rust and TypeScript module bindings are supported; C#/C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode. -In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit the calling module's build settings. `generate ` selects that database's generate entries and dependencies. Module binding language defaults to the calling module's language; Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. +In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit the calling module's build settings. `generate ` selects that database's generate entries and dependencies. Module binding language defaults to the calling module's language; Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. Dependencies automatically select module bindings; no `--bindings` flag is needed. Regular `generate` entries use `"bindings": "client"` by default or can set `"bindings": "module"`. The CLI `--bindings` override is allowed only when a single generation entry is selected. `dev` generates only root dependencies before building the calling module, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples. diff --git a/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md b/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md index e1672d0bd92..340a215cb88 100644 --- a/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md +++ b/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md @@ -102,7 +102,7 @@ Your database will be available at `https://maincloud.spacetimedb.com`. ### Receiver dependencies -For inter-database calls, the **calling database** needs module bindings for the **receiving database** whose reducers it calls. These are distinct from the client bindings used by an external application. Rust and TypeScript modules support receiver bindings. +For inter-database calls, the **calling database** needs module bindings for the **receiving database** whose reducers it calls. These are distinct from the client bindings used by clients. Rust and TypeScript modules support receiver bindings. When the root database in `spacetime.json` declares `dependencies`, `dev` generates those receiver bindings **before** building the calling module, including on rebuilds. It watches receiver sources as well as published module sources, even when the receivers are outside the calling module directory. Child targets may provide receiver source settings, but their own dependency arrays are not processed by `dev`. diff --git a/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md b/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md index 6ffa32173dd..9f4e0a967d7 100644 --- a/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md +++ b/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md @@ -86,8 +86,10 @@ When `spacetime generate` runs, it deduplicates by module path. If multiple data `spacetime generate` produces two kinds of bindings: -- **Client bindings** (`--bindings client`, the default) are used by an external application to connect to a database, subscribe to data, and call its reducers. -- **Module bindings** (`--bindings module`), also called **receiver bindings**, are used inside one database module to make asynchronous inter-database communication (IDC) calls to another database's reducers. Rust and TypeScript modules support these bindings; C# and C++ module bindings are not implemented yet. +- **Client bindings** are used by clients to connect to a database, subscribe to data, and call its reducers. +- **Module bindings**, also called **receiver bindings**, are used inside one database module to make asynchronous inter-database communication (IDC) calls to another database's reducers. Rust and TypeScript modules support these bindings; C# and C++ module bindings are not implemented yet. + +With `spacetime.json`, regular `generate` entries default to `"bindings": "client"`; set `"bindings": "module"` in an entry to select module bindings explicitly. Entries synthesized from `dependencies` automatically use module bindings, so no `--bindings` CLI flag is needed for receiver dependencies. The **calling database** contains the code making the inter-database call. The **receiving database** contains the reducers being called. In the examples below, `lobby` is the calling database and `game-world` is the receiving database. Declare receiver binding inputs in the calling database's `dependencies` array. @@ -141,7 +143,7 @@ A `database` reference uses the target's `module-path`, `bin-path`, or `js-path` ### Explicit module-binding request -The equivalent CLI mode can be selected explicitly. Here `--module-path` identifies the **receiving module**, while `--out-dir` explicitly places output in the **calling module** project: +Without configuration, select the binding kind with `--bindings client` (the default) or `--bindings module`. When using `spacetime.json`, `--bindings` can override the binding kind only if a single generation entry is selected; it is rejected when multiple entries are selected. Prefer the config fields described above for configured generation. Here `--module-path` identifies the **receiving module**, while `--out-dir` explicitly places output in the **calling module** project: ```bash spacetime generate --no-config --bindings module --lang rust \ diff --git a/skills/cli/SKILL.md b/skills/cli/SKILL.md index d2cdc91a993..af0a977cc6a 100644 --- a/skills/cli/SKILL.md +++ b/skills/cli/SKILL.md @@ -52,9 +52,9 @@ spacetime generate --lang unrealcpp --uproject-dir ./MyGame --module-path ./serv ### Client and Module Bindings -`spacetime generate --bindings client` (default) generates bindings for an external application connecting to a database. `--bindings module` generates receiver bindings used inside a **calling database module** to call reducers in another **receiving database** through asynchronous IDC. Rust and TypeScript module bindings are supported; C#/C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode. +`spacetime generate --bindings client` (default) generates bindings for clients connecting to a database. `--bindings module` generates receiver bindings used inside a **calling database module** to call reducers in another **receiving database** through asynchronous IDC. Rust and TypeScript module bindings are supported; C#/C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode. -In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit the calling module's build settings. `generate ` selects that database's generate entries and dependencies. Module binding language defaults to the calling module's language; Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. +In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit the calling module's build settings. `generate ` selects that database's generate entries and dependencies. Module binding language defaults to the calling module's language; Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. Dependencies automatically select module bindings; no `--bindings` flag is needed. Regular `generate` entries use `"bindings": "client"` by default or can set `"bindings": "module"`. The CLI `--bindings` override is allowed only when a single generation entry is selected. `dev` generates only root dependencies before building the calling module, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples. From 0b40baee1bc175d3eb0097b69b080b348f68da90 Mon Sep 17 00:00:00 2001 From: Shubham Mishra Date: Fri, 23 Oct 2026 15:25:12 +0530 Subject: [PATCH 4/4] consistency fixes --- codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md | 2 +- .../00100-databases/00200-spacetime-dev.md | 2 +- .../00100-cli-reference/00300-spacetime-json.md | 12 +++++++----- skills/cli/SKILL.md | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md b/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md index af0a977cc6a..6e7c140b7d6 100644 --- a/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md +++ b/codex-plugin/plugins/spacetimedb/skills/cli/SKILL.md @@ -54,7 +54,7 @@ spacetime generate --lang unrealcpp --uproject-dir ./MyGame --module-path ./serv `spacetime generate --bindings client` (default) generates bindings for clients connecting to a database. `--bindings module` generates receiver bindings used inside a **calling database module** to call reducers in another **receiving database** through asynchronous IDC. Rust and TypeScript module bindings are supported; C#/C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode. -In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit the calling module's build settings. `generate ` selects that database's generate entries and dependencies. Module binding language defaults to the calling module's language; Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. Dependencies automatically select module bindings; no `--bindings` flag is needed. Regular `generate` entries use `"bindings": "client"` by default or can set `"bindings": "module"`. The CLI `--bindings` override is allowed only when a single generation entry is selected. +In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. A direct receiving module source takes precedence. Dependencies do not themselves publish receiving databases or inherit the calling module's build settings. `generate ` processes both its regular `generate` entries (client bindings by default) and `dependencies` (module bindings automatically); no `--bindings` flag or second `generate` entry is needed for a dependency. For dependencies, module binding language defaults to the calling module's language and Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. A regular `generate` entry can select `"bindings": "module"`, but does not use dependency language or output defaults. The CLI `--bindings` override is allowed only when a single generation entry is selected. `dev` generates only root dependencies before building the calling module, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples. diff --git a/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md b/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md index 340a215cb88..9f2ea2533a5 100644 --- a/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md +++ b/docs/docs/00200-core-concepts/00100-databases/00200-spacetime-dev.md @@ -104,7 +104,7 @@ Your database will be available at `https://maincloud.spacetimedb.com`. For inter-database calls, the **calling database** needs module bindings for the **receiving database** whose reducers it calls. These are distinct from the client bindings used by clients. Rust and TypeScript modules support receiver bindings. -When the root database in `spacetime.json` declares `dependencies`, `dev` generates those receiver bindings **before** building the calling module, including on rebuilds. It watches receiver sources as well as published module sources, even when the receivers are outside the calling module directory. Child targets may provide receiver source settings, but their own dependency arrays are not processed by `dev`. +When the root database in `spacetime.json` declares `dependencies`, `dev` generates those receiver bindings **before** building the calling module, including on rebuilds. It watches receiving module source paths as well as published module sources, even when the receiving modules are outside the calling module directory. Child targets may provide receiving module source settings, but their own dependency arrays are not processed by `dev`. `--skip-generate` skips both receiver and client binding generation and removes receiver-only watch paths; it does not supply missing bindings. `--skip-publish` does not skip generation. See the [receiver dependency reference](/cli-reference/spacetime-json#receiver-dependencies) for configuration and language support. diff --git a/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md b/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md index 9f4e0a967d7..9db2160fbc8 100644 --- a/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md +++ b/docs/docs/00300-resources/00100-cli-reference/00300-spacetime-json.md @@ -61,7 +61,7 @@ The `generate` key is an array of objects. Each object configures bindings gener | `uproject-dir` | string | Unreal project directory (`unrealcpp` only) | | `include-private` | boolean | Include private tables in generated code | -Generate entries use the `module-path` (or `bin-path`/`js-path`) from their parent entity to determine which module to build and generate from. +By default, generate entries use the `module-path` (or `bin-path`/`js-path`) from their parent entity to determine which module to build and generate from. An entry can specify its own module source instead. When `spacetime generate` runs, it deduplicates by module path. If multiple databases share the same module and generate config (for example, via inheritance), bindings are generated once. @@ -89,7 +89,9 @@ When `spacetime generate` runs, it deduplicates by module path. If multiple data - **Client bindings** are used by clients to connect to a database, subscribe to data, and call its reducers. - **Module bindings**, also called **receiver bindings**, are used inside one database module to make asynchronous inter-database communication (IDC) calls to another database's reducers. Rust and TypeScript modules support these bindings; C# and C++ module bindings are not implemented yet. -With `spacetime.json`, regular `generate` entries default to `"bindings": "client"`; set `"bindings": "module"` in an entry to select module bindings explicitly. Entries synthesized from `dependencies` automatically use module bindings, so no `--bindings` CLI flag is needed for receiver dependencies. +With `spacetime.json`, put client bindings in `generate` and receiver bindings in `dependencies`. Running `spacetime generate` processes both arrays: regular `generate` entries default to client bindings, and dependencies automatically generate module bindings. No `--bindings` flag or second `generate` entry is needed for a dependency. + +A regular `generate` entry can also set `"bindings": "module"` explicitly. Unlike a dependency, it uses its parent target's module source unless overridden; if its language or output directory is omitted, those defaults are resolved from the config directory rather than the calling module. The **calling database** contains the code making the inter-database call. The **receiving database** contains the reducers being called. In the examples below, `lobby` is the calling database and `game-world` is the receiving database. Declare receiver binding inputs in the calling database's `dependencies` array. @@ -106,7 +108,7 @@ Each calling database with dependencies must define `module-path`. Dependencies ### Receiver source without a publish target -A direct receiver source does not need its own database target: +A receiving module source does not need its own database target: ```json { @@ -139,7 +141,7 @@ Declaring a dependency does not publish the receiver. To make it a publish targe A `database` reference uses the target's `module-path`, `bin-path`, or `js-path`, and its resolved receiver build options and .NET SDK version. It fails if no matching target or module source exists. A dependency does not inherit the calling module's build options or .NET SDK version. -`spacetime generate lobby` selects the calling database's regular `generate` entries and dependencies; without a database filter, generation includes all targets' entries. The module binding language is inferred from the calling module, not the external client project. Rust and TypeScript module bindings default to `/src/remote_bindings`. +`spacetime generate lobby` selects the calling database's regular `generate` entries and dependencies; without a database filter, generation includes all targets' entries. For `dependencies` entries, the module binding language is inferred from the calling module, not the external client project. Rust and TypeScript dependency bindings default to `/src/remote_bindings`. ### Explicit module-binding request @@ -247,7 +249,7 @@ The `--server` flag overrides the server for all databases. The `--skip-publish` If the root database declares `dependencies`, `dev` generates its receiver bindings before building that database's module, both on startup and on rebuilds. This adds a pre-build step without changing the normal development workflow above. -Receiver dependency sources are watched even when they are outside the calling module directory or not selected for publishing. Child targets can supply receiving-module sources for lookup, but `dev` does not process their own `dependencies` arrays. +Receiving module source paths are watched even when they are outside the calling module directory or not selected for publishing. Child targets can supply receiving module sources for lookup, but `dev` does not process their own `dependencies` arrays. `--skip-generate` skips both receiver and client binding generation and excludes receiver-only sources from watching. It does not create any bindings the calling module needs to compile. `--skip-publish` skips publishing, not binding generation. diff --git a/skills/cli/SKILL.md b/skills/cli/SKILL.md index af0a977cc6a..6e7c140b7d6 100644 --- a/skills/cli/SKILL.md +++ b/skills/cli/SKILL.md @@ -54,7 +54,7 @@ spacetime generate --lang unrealcpp --uproject-dir ./MyGame --module-path ./serv `spacetime generate --bindings client` (default) generates bindings for clients connecting to a database. `--bindings module` generates receiver bindings used inside a **calling database module** to call reducers in another **receiving database** through asynchronous IDC. Rust and TypeScript module bindings are supported; C#/C++ module bindings are not implemented yet. `unrealcpp` is client-only; `cpp` is accepted only in module mode. -In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. Direct receiver source takes precedence. Dependencies do not themselves publish receivers or inherit the calling module's build settings. `generate ` selects that database's generate entries and dependencies. Module binding language defaults to the calling module's language; Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. Dependencies automatically select module bindings; no `--bindings` flag is needed. Regular `generate` entries use `"bindings": "client"` by default or can set `"bindings": "module"`. The CLI `--bindings` override is allowed only when a single generation entry is selected. +In `spacetime.json`, each calling database's non-inherited `dependencies` array requires its own `module-path` and dependency `name` plus receiving-module `module-path` or `database`. A `database` reference resolves another target's local source/build settings in the same config; it does not fetch a running database's schema. A direct receiving module source takes precedence. Dependencies do not themselves publish receiving databases or inherit the calling module's build settings. `generate ` processes both its regular `generate` entries (client bindings by default) and `dependencies` (module bindings automatically); no `--bindings` flag or second `generate` entry is needed for a dependency. For dependencies, module binding language defaults to the calling module's language and Rust/TypeScript output defaults to `/src/remote_bindings`. Explicit config `out-dir` is config-relative. A regular `generate` entry can select `"bindings": "module"`, but does not use dependency language or output defaults. The CLI `--bindings` override is allowed only when a single generation entry is selected. `dev` generates only root dependencies before building the calling module, and watches their source paths. Child targets are available for source lookup, not recursive dependency generation. `--skip-generate` skips receiver/client generation and receiver-only watching; `--skip-publish` does not. See https://spacetimedb.com/docs/cli-reference/spacetime-json#receiver-dependencies for examples.