Templates
Working with templates is a great way to kickstart your projects. Templates are SPAI projects that are pre-configured with a specific set of features and functionality. You can use templates to create new projects or add features to existing projects.
Discover the available templates in the SPAI HUB. You can deploy a template directly from the HUB or clone it to your local machine.
Clone a template
Clone a template with
spai clone "template-name"
This command will clone the template to your current working directory. To choose a different directory
spai clone "template-name" -p "directory"
See all options with
spai clone --help
If you already have a project with the same name, it will not clone the template. In order to overwrite the existing project, use
spai clone "template-name" -f
Once the template is cloned, you can run it locally or deploy it to the cloud.
Before running a template locally, make sure to install the dependencies with
spai install
.
Run a template
You can clone and run a template with a single command
spai run -t "template-name"
which is compatible with the rest of the command options. For example, the following command will clone and run a template to a specified directory, installing the required dependencies.
spai run -t "template-name" -p "path-to-project" -f -i
Deploy a template
In a similar way, you can deploy a template with
spai deploy -t "template-name"
This command will NOT clone the template locally, and deploy it directly to the cloud.
Troubleshooting
If you encounter any issues during the installation of SPAI, please get in touch with use through our Discord server.
Back to top