New CLI Command - spacetime dev
We are continuing the month of shipping with a new CLI command for you all, spacetime dev.
spacetime dev automates your development loop to make developing with SpacetimeDB much faster and easier. It does the following:
- Generates types for your client (
spacetime generate) - Builds your application (
spacetime build) - Publishes your module (
spacetime publish) - Subscribes to your module logs (
spacetime logs) - Watches your module files for changes and repeats the process
spacetime dev is 5 commands in one and it's a real game changer once you try it!
With the introduction of spacetime dev we're also introducing a canonical default project structure:
my-spacetimedb-project/
├── package.json
├── tsconfig.json
├── src/ # regular client app code
│ ├── main.ts
│ ├── App.tsx
│ └── components/
│
└── spacetimedb/ # SpacetimeDB module lives here
├── package.json # its own TypeScript package
├── tsconfig.json
└── src/
├── index.ts # entrypoint for the module
└── schema.ts # schema / logicWith this structure, you can just include a spacetimedb folder inside your client project and have spacetime dev automatically publish your modules for you while you're developing. This makes it super easy to develop apps with a single server and client.
Although convenient, this default project structure is not mandatory and can be customized and configured for more complex multi-client applications or in situations where you want to separate your client and server into different repositories.
Usage
If you run spacetime dev in a directory without a spacetimedb directory (and do not specify a module-project-path), spacetime dev will take you through the process of setting up a new project.
$ spacetime dev
No SpacetimeDB project found in current directory.
Would you like to initialize a new project? yes
WARNING: This command is UNSTABLE and subject to breaking changes.
✔ Project name · my-spacetime-app
✔ Project path · ./my-spacetime-app
? Select a client type for your project (you can add other clients later) ›
❯ React - React web app with TypeScript server
Use Template - Choose from a list of built-in template projects or clone an existing SpacetimeDB project from GitHub
NoneIf you run spacetime dev in a directory with an existing spacetimedb directory (or specify a module-project-path), spacetime dev will ask you to publish a new module or connect to an existing one.
$ spacetime dev
Found existing SpacetimeDB project.
Now we need to select a database to publish to.
Selected database: grumpy-lunchroom-2109
Tip: Use `--database grumpy-lunchroom-2109` to skip this question next time
Starting development mode...
Database: grumpy-lunchroom-2109
Watching for changes in: /Users/tylercloutier/Developer/SpacetimeDB/my-spacetime-app/spacetimedb
Press Ctrl+C to stop
Updating .env.local with database name grumpy-lunchroom-2109...
Building...
Build complete!
Generating module bindings...
Generate finished successfully.
Publishing...
Build finished successfully.
Uploading to local => http://127.0.0.1:3000
Checking for breaking changes...
Publishing module...
JavaScript / TypeScript support is currently in BETA.
There may be bugs. Please file issues if you encounter any.
<https://github.com/clockworklabs/SpacetimeDB/issues/new>
Created new database with name: grumpy-lunchroom-2109, identity: c20008053ab940eb968e981c506037220be5dba2a948f8f7e7a131ba156bf28f
Published successfully!
---
Watching for file changes...
2025-10-30T23:19:12.862606Z INFO: Creating table `person`
2025-10-30T23:19:12.863539Z INFO: Database initializedIn either case, spacetime dev will watch for changes in your module files, update your client generated code, build your module, and publish it automatically!
Updated spacetime init
The spacetime init subcommand has been completely reworked. There are a few major changes here:
- You now specify a project name when creating a project
- There is a new interactive mode for selecting project templates (see below)
SpacetimeDB Project Templates
A Template is a pre-made project configuration that you can quickly deploy via spacetime init. Now when you run spacetime init you'll see all of the built-in options ready to deploy immediately:
You are logged in to SpacetimeDB.
✔ Project name · my-spacetime-app
✔ Project path · ./my-spacetime-app
✔ Select a client type for your project (you can add other clients later) · Use Template - Choose from a list of built-in template projects or clone an existing SpacetimeDB project from GitHub
Available built-in templates:
basic-typescript - A basic TypeScript client and server template with only stubs for code
basic-c-sharp - A basic C# client and server template with only stubs for code
basic-rust - A basic Rust client and server template with only stubs for code
basic-react - React web app with TypeScript server
quickstart-chat-rust - Rust server/client implementing quickstart chat
quickstart-chat-c-sharp - C# server/client implementing quickstart chat
quickstart-chat-typescript - TypeScript server/client implementing quickstart chat
? Template ID or GitHub repository (owner/repo) or git URL ›As you can see you can also specify a Github URL here to deploy a custom template. This allows the community to build and share their own templates to be used by others.
Auth claims in modules
Client credentials are now exposed to your module code, so you can have more control over your authorization logic. For some examples of how to use it to secure your app, check out the docs.
Other changes
Docusaurus Migration
We recently migrated all of our documentation to docusaurus! You can view the newly updated documentation here: https://spacetimedb.com/docs .
Postgres Wire Protocol on Maincloud
The big update here is that we have re-enabled postgres wire protocol on Maincloud! You can see the full release notes for our Postgres Wire Protocol release here: https://github.com/clockworklabs/SpacetimeDB/releases/tag/v1.5.0 .
Default Server
The default server for newly installed CLI tools has been changed from local to maincloud. This only affects new users as existing users will already have a default server set in their spacetime CLI config.toml.
What's Changed
- Notify user in CLI that js/ts is beta quality by @Centril in #3415
- Fix windows linker errors by @coolreader18 in #3416
- ModuleDef and schema changes to support procedures by @gefjon in #3392
- Fixed a circular import that was not detected in the TypeScript SDK by @cloutiertyler in #3421
- Fix CLI package._json version by @bfops in #3423
- add system tables for views by @joshua-spacetime in #3419
- Add AuthCtx to ReducerContext for rust by @jsdt in #3288
- Initial TypeScript reference docs by @cloutiertyler in #3407
- Weaken minimum dotnet version by @bfops in #3418
- Add a nix flake by @gefjon in #3422
- Fixed the react router issue and added a new test app to test for it by @cloutiertyler in #3428
- Add module def types for views by @joshua-spacetime in #3427
- V8: prepare for JS workers by @Centril in #3395
- add rust-src to the toolchain and update trybuild test output by @joshua-spacetime in #3440
- CI - Remove previews on discord posts for merged PRs by @bfops in #3445
- Add bindings for csharp modules to use JWT claims by @jsdt in #3414
- gitignore
node_moduleseven when it's a symlink by @bfops in #3446 - CI - Move
Internal Teststo GitHub by @bfops in #3436 - feat: update pgwire to 0.34 and improve how we disable ssl by @sunng87 in #3432
- Add typescript bindings for auth claims. by @jsdt in #3442
- Remove unused docker-compose files by @bfops in #3455
- Add macro bindings for views by @joshua-spacetime in #3429
- [TS] Fix ctx.timestamp serialization by @coolreader18 in #3461
- V8: Let a worker thread own the isolate by @Centril in #3401
- fix migration which adds column and index together. by @Shubham8287 in #3450
util::jobs: add commentary + use.expect(..)by @Centril in #3468- Update to pgwire 0.34.2 by @coolreader18 in #3451
- Remove
connection_idfrom ViewContext by @joshua-spacetime in #3464 - CI - C# quickstart test properly uses nuget by @bfops in #3466
- Remove unused
release-fastprofile by @bfops in #3473 - core: Add more context to errors returned from host controller by @kim in #3449
- Rust module bindings and macros for defining procedures by @gefjon in #3444
- Docusaurus migration by @JulienLavocat in #3343
- Add
modules/benchmarks-tsby @Centril in #3408 - Add back llms.md by @JulienLavocat in #3479
- Make
namea required parameter ofviewmacro by @joshua-spacetime in #3480 spacetime-install.ps1installs Visual C++ Redistributable if needed by @iso8859 in #2356- Add a SpacetimeDBException to C# SDK to aid in debugging by @rekhoff in #3386
- Include
cargo-instain devShell in nix flake by @gefjon in #3470 - CI - Cancel runs on new pushes by @bfops in #3501
- Bump TypeScript versions to 1.6.2 by @bfops in #3424
- Included
dropped_table_idinto the error message in replay by @egormanga in #3481 - Improve spacetime-install.ps1 by @jdetter in #3505
- Auto-migration rules for views by @joshua-spacetime in #3484
- Improve
JwtClaims&AuthCtxdocs by @Centril in #3477 - V8: write to module logs on exception by @Centril in #3518
- Update the docs for postgres wire format changes in 1.6.0 by @mamcx in #3516
- CI - Skip Internal Tests and Unreal Tests on external PRs by @bfops in #3522
- Fix to Unreal tests to stop requesting infinite resources by @JasonAtClockwork in #3504
- Compute read sets for MutTxId via InstanceEnv by @joshua-spacetime in #3520
- commitlog: Improve error context by @kim in #3506
- Add query engine support for mutable transactions by @joshua-spacetime in #3524
- Added the Blackholio Unreal Blueprint Tutorial by @JasonAtClockwork in #3313
spacetime initrewrite by @drogus in #3366- WASM host execution for procedures by @gefjon in #3498
- Add system table for tracking view subscribers by @joshua-spacetime in #3482
- Fix TypeScript module quickstart by @jdetter in #3530
- New command:
spacetime devby @drogus in #3469 - Treat a missing aud claim as an empty list by @jsdt in #3542
- Add docs for using Auth claims within modules by @jsdt in #3545
- Index a view's metadata columns by @joshua-spacetime in #3540
- Reenabled github page edit link by @cloutiertyler in #3491
New Contributors
- @sunng87 made their first contribution in #3432
- @iso8859 made their first contribution in #2356
- @egormanga made their first contribution in #3481
Full Changelog: v1.6.1...v1.7.0