You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Description of Changes
This change addresses reviewer feedback on clockworklabs#4576.
As requested by `@cloutiertyler`, here are the changes:
- moved the persistent default listen address for `spacetime start` from
project `spacetime.json` to CLI `cli.toml`
- threaded the already-loaded CLI `Config` into `spacetime start`
instead of introducing a separate project-config lookup in that
subcommand
- preserved precedence so explicit `--listen-addr` / `-l` still wins
over config, and config still wins over the built-in standalone default
- documented the setting in the `spacetime start` CLI reference instead
of the standalone runtime-config page
Behavior precedence is now:
1. Explicit CLI flag, such as `spacetime start --listen-addr
127.0.0.1:5000`
2. `listen_addr` from `cli.toml`
3. Built-in standalone default `0.0.0.0:3000`
Example:
```toml
listen_addr = "0.0.0.0:4000"
```
With that config in place, `spacetime start` will bind to `0.0.0.0:4000`
unless the user passes `--listen-addr` explicitly.
Implementation details:
- added a top-level `listen_addr` field to the existing CLI config
parser and persistence path
- updated `spacetime start` to use the loaded CLI config rather than
reading project config directly
- added/kept focused tests for `--listen-addr` and `-l` detection so
config is only injected when the user did not provide an explicit listen
address
- updated the checked-in CLI reference text for `spacetime start`
Related:
- Follow-up to clockworklabs#4576
# API and ABI breaking changes
None.
This change does not modify any public API or ABI. It only changes where
the CLI reads an optional default value for an existing `spacetime
start` flag.
# Expected complexity level and risk
Complexity: 2/5
This is a small, localized CLI behavior change.
The main interaction point is precedence between forwarded CLI args and
persisted CLI config. Risk is low because this change:
- preserves the existing standalone default when `listen_addr` is absent
- preserves explicit CLI `--listen-addr` and `-l` precedence
- reuses the existing `cli.toml` loading path instead of adding another
config system
# Testing
Completed:
- [x] `cargo fmt --all --check`
- [x] `cargo check -p spacetimedb-cli`
- [x] `cargo clippy -p spacetimedb-cli --all-targets`
- [x] `cargo test -p spacetimedb-cli config::tests --lib`
- [x] `cargo test -p spacetimedb-cli subcommands::start::tests --lib`
Reviewer checks:
- [ ] Run `spacetime start` without `listen_addr` in `cli.toml` and
confirm it still binds to `0.0.0.0:3000`
- [ ] Add `listen_addr = "0.0.0.0:4000"` to `cli.toml`, run `spacetime
start`, and confirm it binds to `0.0.0.0:4000`
- [ ] Run `spacetime start --listen-addr 127.0.0.1:5000` with config
present and confirm the CLI flag still wins
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
0 commit comments