Home

Supra CLI

The Supra CLI provides tools to develop your project locally and deploy to the Supra Platform.

You can use the Supra CLI to run the entire Supra stack locally on your machine, simply by running supra init (to create a new local project) and then supra start.

The Supra CLI provides tools to develop your project locally, deploy to the Supra Platform, handle database migrations, and generate types directly from your database schema.

Installing the Supra CLI#

Install the CLI as dev dependency via npm:


_10
npm install supra --save-dev

Run the CLI by prefixing each command with npx (only applicable when installing through npm):


_10
npx supra <command>

Updating the Supra CLI#

When a new version is released, you can update the CLI using the same methods.


_10
npm update supra --save-dev

If you have any Supra containers running locally, remember to restart them after upgrading to use the new features.


_10
supra stop --no-backup
_10
supra start

Running Supra locally#

The Supra CLI uses Docker containers to manage the local development stack. To get started,

Inside the folder where you want to create your project, run:


_10
supra init

This will create a new supra folder. It's safe to commit this folder to your version control system.

Now, to start the Supra stack, run:


_10
supra start

This takes time on your first run because the CLI needs to download the Docker images to your local machine. The CLI includes the entire Supra toolset, and a few additional images that are useful for local development (like a local SMTP server and a database diff tool).

The local development environment includes Supra Studio, a graphical interface for working with your database, running by default on localhost:54323.

Local Studio

Stopping local services#

When you are finished working on your Supra project, you can stop the stack with:


_10
supra stop

Full command reference#

The CLI provides a number of commands to help you develop your project locally and deploy to the Supra Platform. You can find all commands inside the CLI Reference docs, including: