New command: spacetime dev#3469
Merged
Merged
Conversation
Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
…s/SpacetimeDB into drogus/spacetime-init
…s/SpacetimeDB into drogus/spacetime-init
cloutiertyler
approved these changes
Oct 30, 2025
Contributor
cloutiertyler
left a comment
There was a problem hiding this comment.
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 devdoesn't override your default (leads people to usespacetime devwith localhost most of the time) - local by default, and
spacetime devoverrides 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 devdoesn't override your default (just uses the defaultmaincloud), seems like the best case
We still have one important thing to do for dev after this merges as well:
- Implement
spacetime.tomlor some such other config file so that users can specify adatabase_namein some locally not checked in file, so that they don't end up creating a million databases if they just runspacetime deva 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.
bfops
pushed a commit
that referenced
this pull request
Nov 3, 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. --------- Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com> Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com> Co-authored-by: = <cloutiertyler@gmail.com> Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com> Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com> Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
This PR implements a new command for the CLI:
spacetime dev. If run from outside of a project directory, it will callinitin 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:spacetimedbdirectory and automatically publish to SpacetimeDBOne caveat is that instead of reusing the
logscode 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.