You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Supabase CLI can be found in our [CLI](https://github.com/supabase/cli) repository.
9
8
10
-
The CLI is still under heavy development, but it will contain all the functionality for working with Supabase projects and the Supabase platform.
11
-
12
9
- [x] Running Supabase locally
13
-
- [x] Self-hosting
14
-
- [ ] Managing database migrations (in progress)
15
-
- [ ] Pushing your local changes to production
10
+
- [x] Managing database migrations
11
+
- [x] Pushing your local changes to production
16
12
- [ ] Manage your Supabase Account
17
13
- [ ] Manage your Supabase Projects
18
14
- [ ] Generating types directly from your database schema
19
15
- [ ] Generating API and validation schemas from your database
20
16
21
17
## Installing the CLI
22
18
23
-
```bash
24
-
npm install supabase -g
25
-
```
19
+
Installation instructions can be found [here](https://github.com/supabase/cli#install-the-cli).
26
20
27
-
There may be additional steps that you need to follow to setup the CLI. Located [here](https://supabase.com/docs/guides/local-development).
21
+
## Support
28
22
23
+
Report issues to our [issue tracker](https://github.com/supabase/cli/issues).
29
24
definition: spec/combined.json
30
25
libraries:
31
-
- name: 'sh'
32
-
id: 'sh'
33
-
version: '0.0.1'
26
+
- name: "sh"
27
+
id: "sh"
28
+
version: "0.0.1"
34
29
docs:
35
30
path: reference/cli/
36
31
sidebar:
37
-
- name: 'About'
32
+
- name: "About"
38
33
items:
39
34
- index
40
-
- supabase init
41
-
- name: 'Local Development'
35
+
- name: "Command reference"
42
36
items:
37
+
- supabase help
38
+
- supabase init
43
39
- supabase start
44
-
- supabase stop
45
-
- supabase eject
40
+
- supabase db branch list
41
+
- supabase db branch create
42
+
- supabase db branch delete
43
+
- supabase db switch
44
+
- supabase db changes
45
+
- supabase db commit
46
+
- supabase db reset
47
+
- supabase db remote set
48
+
- supabase db remote commit
49
+
- supabase db push
50
+
- supabase migration new
51
+
- name: "Config reference"
52
+
items:
53
+
- Config reference
46
54
47
55
pages:
56
+
supabase help:
57
+
description: |
58
+
```
59
+
Help provides help for any command in the application.
60
+
Simply type supabase help [path to command] for full details.
61
+
62
+
Usage:
63
+
supabase help [command]
64
+
```
65
+
48
66
supabase init:
49
67
description: |
50
-
```bash
51
-
supabase init
52
68
```
69
+
Initialize a project to use Supabase CLI.
53
70
54
-
This command will create a .supabase folder which holds all the configurations for developing your project locally. You don't need to check this into version control.
71
+
Usage:
72
+
supabase init
73
+
```
55
74
56
-
After you run `supabase init` you will be guided through a series of questions, and if everything goes well, you will see an output similar to this:
Diffs the local database with current migrations, then print the diff to standard output.
74
124
75
-
This command uses Docker Compose to start all the open source [services](/docs/#how-it-works) of Supabase. This command will take a while to run, there are a lot of services to build.
125
+
Usage:
126
+
supabase db changes
127
+
```
128
+
129
+
supabase db commit:
130
+
description: |
131
+
```
132
+
Diffs the local database with current migrations, writing it as a new migration.
133
+
134
+
Usage:
135
+
supabase db commit <migration name>
136
+
```
137
+
138
+
supabase db reset:
139
+
description: |
140
+
```
141
+
Resets the local database to reflect current migrations. Any changes on the local database that is not committed will be lost.
76
142
77
-
Once this is running, you will see the health services in Docker Dashboard:
143
+
Usage:
144
+
supabase db reset
145
+
```
146
+
147
+
supabase db remote set:
148
+
description: |
149
+
```
150
+
Set the remote database to push migrations to.
151
+
152
+
Usage:
153
+
supabase db remote set <remote database url>
154
+
```
155
+
156
+
supabase db remote commit:
157
+
description: |
158
+
```
159
+
Commit changes on the remote database since the last pushed migration.
78
160
79
-

161
+
Usage:
162
+
supabase db remote commit
163
+
```
80
164
81
-
supabase stop:
165
+
supabase db push:
82
166
description: |
83
-
```bash
84
-
supabase stop
85
167
```
168
+
Push new migrations to the remote database.
86
169
87
-
When you are finished with Supabase, run `supabase stop` to stop the Docker services.
170
+
Usage:
171
+
supabase db push
172
+
```
88
173
89
-
supabase eject:
174
+
supabase migration new:
90
175
description: |
91
-
```bash
92
-
supabase eject
93
176
```
177
+
Create an empty migration.
178
+
179
+
Usage:
180
+
supabase migration new <migration name>
181
+
```
182
+
183
+
Config reference:
184
+
description: |
185
+
The config file resides in `supabase/config.json` after you run `supabase init`.
186
+
187
+
#### `projectId` (required)
188
+
189
+
A string used to distinguish different Supabase projects on the same host. Defaults to the working directory name when running `supabase init`.
190
+
191
+
#### `ports.api` (required)
192
+
193
+
Host port used for the API URL. Defaults to `54321`.
194
+
195
+
#### `ports.db` (required)
196
+
197
+
Host port used for the DB URL. Defaults to `54322`.
198
+
199
+
#### `ports.studio` (required)
200
+
201
+
Host port used for Supabase Studio. Defaults to `54323`.
202
+
203
+
#### `ports.inbucket` (optional)
204
+
205
+
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.
94
206
95
-
Run in any folder to create a `docker` folder with a `docker-compose.yml`. This is useful for self-hosting or adding custom configuration.
207
+
#### `dbVersion` (required)
96
208
97
-
See our [Self Hosting](/docs/guides/hosting/overview) docs for more details.
209
+
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`.
0 commit comments