Skip to content

Conversation

@drogus
Copy link
Collaborator

@drogus drogus commented Oct 23, 2025

Description of Changes

This PR implements a new command for the CLI: spacetime dev. If run from outside of a project directory, it will call init in interactive mode to allow user to create a project. If run from a project directory, it will ask for a module to conect to and it will:

  • subscribe to logs
  • observe files in the spacetimedb directory and automatically publish to SpacetimeDB

One caveat is that instead of reusing the logs code I did some repetition cause currently the logs code acquires a lock that lives through await points. It is fixable, but due to limited time I decided to go with a bit of code duplication. It shouldn't be very hard to fix later, though.

Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now looks good to me. I've reworked some of the logic to handle some of the more subtle cases especially relating to the server name. One change I've made is that I've made it so that if you don't specify --server it uses your default server (not maincloud), but I've also made the change to make maincloud the default server. This was one of three options:

  • local by default, and spacetime dev doesn't override your default (leads people to use spacetime dev with localhost most of the time)
  • local by default, and spacetime dev overrides your default and sends you to maincloud anyway (could be very surprising and could even whoopsie someone's database accidentally)
  • maincloud by default, and spacetime dev doesn't override your default (just uses the default maincloud), seems like the best case

We still have one important thing to do for dev after this merges as well:

  • Implement spacetime.toml or some such other config file so that users can specify a database_name in some locally not checked in file, so that they don't end up creating a million databases if they just run spacetime dev a bunch of times against maincloud. I think we'll need to involve @aasoni in that one because it's relevant to projects and teams and stuff.

@cloutiertyler cloutiertyler changed the base branch from drogus/spacetime-init to master October 30, 2025 19:45
@cloutiertyler cloutiertyler added this pull request to the merge queue Oct 30, 2025
Merged via the queue into master with commit b2cee93 Oct 30, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants