Files
supabase/web/spec/cli.yml
2021-12-10 03:00:04 +08:00

210 lines
5.0 KiB
YAML

openref: 0.1
info:
id: reference/cli
title: About
description: |
The Supabase CLI can be found in our [CLI](https://github.com/supabase/cli) repository.
- [x] Running Supabase locally
- [x] Managing database migrations
- [x] Pushing your local changes to production
- [ ] Manage your Supabase Account
- [ ] Manage your Supabase Projects
- [ ] Generating types directly from your database schema
- [ ] Generating API and validation schemas from your database
## Installing the CLI
Installation instructions can be found [here](https://github.com/supabase/cli#install-the-cli).
## Support
Report issues to our [issue tracker](https://github.com/supabase/cli/issues).
definition: spec/combined.json
libraries:
- name: "sh"
id: "sh"
version: "0.0.1"
docs:
path: reference/cli/
sidebar:
- name: "About"
items:
- index
- name: "Command reference"
items:
- supabase help
- supabase init
- supabase start
- supabase db branch list
- supabase db branch create
- supabase db branch delete
- supabase db switch
- supabase db changes
- supabase db commit
- supabase db reset
- supabase db remote set
- supabase db remote commit
- supabase db push
- supabase migration new
- name: "Config reference"
items:
- Config reference
pages:
supabase help:
description: |
```
Help provides help for any command in the application.
Simply type supabase help [path to command] for full details.
Usage:
supabase help [command]
```
supabase init:
description: |
```
Initialize a project to use Supabase CLI.
Usage:
supabase init
```
supabase start:
description: |
```
Start the Supabase local development setup.
Usage:
supabase start
```
supabase db branch list:
description: |
```
List branches.
Usage:
supabase db branch list
```
supabase db branch create:
description: |
```
Create a branch.
Usage:
supabase db branch create <branch name>
```
supabase db branch delete:
description: |
```
Delete a branch.
Usage:
supabase db branch delete <branch name>
```
supabase db switch:
description: |
```
Switch branches.
Usage:
supabase db switch <branch name>
```
supabase db changes:
description: |
```
Diffs the local database with current migrations, then print the diff to standard output.
Usage:
supabase db changes
```
supabase db commit:
description: |
```
Diffs the local database with current migrations, writing it as a new migration.
Usage:
supabase db commit <migration name>
```
supabase db reset:
description: |
```
Resets the local database to reflect current migrations. Any changes on the local database that is not committed will be lost.
Usage:
supabase db reset
```
supabase db remote set:
description: |
```
Set the remote database to push migrations to.
Usage:
supabase db remote set <remote database url>
```
supabase db remote commit:
description: |
```
Commit changes on the remote database since the last pushed migration.
Usage:
supabase db remote commit
```
supabase db push:
description: |
```
Push new migrations to the remote database.
Usage:
supabase db push
```
supabase migration new:
description: |
```
Create an empty migration.
Usage:
supabase migration new <migration name>
```
Config reference:
description: |
The config file resides in `supabase/config.json` after you run `supabase init`.
#### `projectId` (required)
A string used to distinguish different Supabase projects on the same host. Defaults to the working directory name when running `supabase init`.
#### `ports.api` (required)
Host port used for the API URL. Defaults to `54321`.
#### `ports.db` (required)
Host port used for the DB URL. Defaults to `54322`.
#### `ports.studio` (required)
Host port used for Supabase Studio. Defaults to `54323`.
#### `ports.inbucket` (optional)
Host port used for the web interface of Inbucket email testing server. When not specified, emails are automatically confirmed. When specified, emails are not sent to the recipient, but rather monitored and accessible via the web interface.
#### `dbVersion` (required)
Server version number used for the database. This needs to match the server version number of the remote database you intend to link to with `supabase db remote set`. You can retrieve it by running `SHOW server_version_num`.