Using the Platform SDK locally
spatial CLI ships with a local API service. This runs as a background daemon on your machine, and allows you to use the Platform SDK to develop tools for local deployments.
You can use the
spatial commands to interact with the local API service.
Starting the local API service
To start an instance of the local API service, navigate to your project’s root directory and run
spatial service start.
To start a local API service instance from outside your project’s directory structure, or if your main configuration file (usually called
spatialos.json) isn’t in the project root, you can specify it by passing the
# Will run on port 9876 and attempt to find a spatialos.json file in this directory. spatial service start # Will run on port 1234, using the project configuration at the provided path. spatial service start --port 1234 --main_config path/to/project/spatialos.json
Checking the status of the service
You can get information on the running local API service instance, if it exists, using
spatial service status.
You can run this command from anywhere - you don’t need to be in a project directory.
Stopping the service
To shut down the running local API service instance, run
spatial service stop.
Stopping the local API service also shuts down any locally running deployment that was started with the local API service.