github clockworklabs/SpacetimeDB v1.7.0
Release v1.7.0 - `spacetime dev`

one day ago

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:

  1. Generates types for your client (spacetime generate)
  2. Builds your application (spacetime build)
  3. Publishes your module (spacetime publish)
  4. Subscribes to your module logs (spacetime logs)
  5. 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 / logic

With 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
  None

If 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 initialized

In 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:

  1. You now specify a project name when creating a project
  2. 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

New Contributors

Full Changelog: v1.6.1...v1.7.0

Don't miss a new SpacetimeDB release

NewReleases is sending notifications on new releases.