This document defines the alpha command structure for the new Supabase CLI.
For alpha, we will design the command surface from supabase dev outward. The goal is not to mirror the old CLI or the Management API. The goal is to give both humans and LLMs one command set that feels obvious, consistent, and reusable.
supabase dev is the primary human entry point. The subcommands underneath it are the reusable building blocks that dev, push, and pull orchestrate directly. In alpha, push and pull are platform sync workflows, while local database mutation uses apply.
For alpha, the command structure is optimized for:
- one intuitive command set for humans and LLMs
- workflow-first naming
- a consistent local versus remote mental model
- reusable subcommands under
dev,push, andpull
Older docs may still use different names. This document is the source of truth for the alpha command structure.
For alpha, we will use schema as the user-facing command group for database shape changes.
schema is clearer than migrations because it matches the user intent. Users are usually trying to evolve the database shape, inspect changes, or sync those changes. Migration files are an implementation detail of that workflow.
For alpha, the declarative schema workflow comes first. schema is the default path we will teach, document, and optimize for.
schema generate means "turn my declared schema intent into migration files without applying them yet."
schema apply means "apply my declared schema intent to the local database." Under the hood, that may derive or update migration files before applying them, but the public workflow stays schema-first.
schema push means "sync my declared schema intent to the platform." In practice, that can include deriving or updating migrations and then pushing that result to the platform as one schema-first workflow. It is a platform-sync command, not a local database mutation command.
schema pull means "pull schema state from the platform into the local schema representation." It is the reverse platform-sync command.
For alpha, we will also support a lower-level migrations command group for users who want direct file-level control.
migrations is not the primary onboarding surface. It exists for users who need to inspect, author, apply, or push raw migration files directly.
migrations should stay unaware of the declarative schema workflow. It is the lower-level primitive layer, not the place where schema generation logic lives.
For alpha, push and pull mean sync with the platform only.
That rule applies across:
schema push/schema pullfunctions push/functions pullconfig push/config pullenv push/env pull- top-level
push/pull
Using push and pull only for platform sync keeps the directionality obvious. Users do not need to guess whether a command is going to touch the platform or mutate a live local database.
For alpha, apply is the verb for mutating a live local database.
That rule applies to:
schema applymigrations apply
Using apply here is clearer than overloading push, because it signals direct local database side effects rather than platform synchronization.
apply does not replace migrations push. migrations apply is local database mutation, while migrations push is the explicit low-level platform sync path for users working directly with migration files.
For alpha, we will use push and pull for platform Edge Function sync.
This keeps the command language consistent across platform-sync asset types:
schema pushfunctions pushconfig pushenv push
The same rule applies to pull. A user should not need to memorize a special verb just because the asset type is Functions.
For alpha, we will use local as the public command group for local runtime lifecycle.
stack is technically accurate, but local is easier to understand. It describes the execution context directly, which makes the local versus remote model easier to learn.
For alpha, we will use branches as the public group name.
The plural form reads more naturally alongside the rest of the command tree and makes the overall grouping feel more consistent next to functions and local.
For alpha, we will use new when the command creates something in the repo or local workspace.
Examples:
functions newmigrations new
This establishes a simple rule: new is for starting local work.
For alpha, we will use create when the command provisions something on the platform.
Examples:
branches create
This gives new and create a clean semantic split:
new= local authoring and scaffoldingcreate= remote resource creation
The public command surface for alpha is:
- Workflows
supabase devsupabase pushsupabase pull
- Schema
supabase schema diffsupabase schema generatesupabase schema applysupabase schema pushsupabase schema pull
- Migrations
supabase migrations newsupabase migrations listsupabase migrations applysupabase migrations pushsupabase migrations pull
- Functions
supabase functions newsupabase functions listsupabase functions devsupabase functions pushsupabase functions pull
- Environment (future, when environment management will be implemented in the API)
supabase env listsupabase env setsupabase env unsetsupabase env pullsupabase env pushsupabase env seed
- Config
supabase config diffsupabase config pullsupabase config push
- Branches
supabase branches listsupabase branches createsupabase branches switch
- Local
supabase local startsupabase local stopsupabase local statussupabase local logs
- Setup and auth
supabase initsupabase linksupabase unlinksupabase loginsupabase logout
This structure follows a simple mental model:
- top-level workflows for the big jobs:
dev,push,pull - asset groups for focused sync and authoring:
schema,migrations,functions,env,config - context groups for runtime and branch selection:
local,branches - setup and auth commands kept top-level:
init,link,login
For alpha, dev will be an orchestrator over the command tree above. It will not be a separate logic silo.
dev --target local will orchestrate the local development workflow by composing the lower-level commands:
local startto bring up local servicesschema applyto apply local database changesmigrations applyfor direct migration-file workflowsfunctions devto run a Functions-only local development loop- local env and config resolution to keep the local runtime aligned with project inputs
In alpha, dev should watch both declarative schema inputs and direct migration files under supabase/migrations. Declarative schema remains the primary workflow, but users who need more control should still be able to work at the migrations layer without fighting dev.
The local workflow should feel like a single command, but it should still be built from the same subcommands a user or agent can run directly.
dev --target remote will orchestrate the remote development workflow against a linked non-production branch.
At a high level, it will coordinate:
schema pushfunctions push- remote config sync
The remote workflow should use the same asset groups and the same command vocabulary as the local workflow. The difference is target and orchestration, not a separate command language.
When users edit migration files directly, dev should reconcile through the same migration-backed database sync pipeline rather than introducing a second competing path.
For alpha, push will be the global sync workflow across:
schemafunctionsenvconfig
push is the command for syncing local intent outward using the same lower-level asset commands.
For database changes, top-level push runs the schema-first remote sync path.
Advanced users can still use migrations push when they want explicit low-level control over what gets synchronized to the platform.
For alpha, pull will be the global sync workflow across:
schemafunctionsenvconfig
pull is the command for refreshing local state from the remote source of truth using the same lower-level asset commands.
pull does not apply local database changes. It refreshes local project state from the platform.
Before dev feels coherent in alpha, the following command families must exist:
schemamigrationsfunctionsenvconfigbranchesessentialslocallifecycle commands- top-level
pushandpull
The alpha should feel complete enough that dev can orchestrate a believable end-to-end workflow rather than stand on placeholders.
- the public naming of command groups and verbs
- the high-level command tree
- the relationship between
devand the supporting subcommands - the workflow role of
pushandpull
- compatibility aliases
- parity with the old CLI
- implementation details of watchers, transport, or API wiring
- detailed handler boundaries or runtime architecture
schema describes what the user is trying to change. migrations describes one mechanism used to represent those changes. The command surface should privilege user intent over implementation terms.
schema is the declarative workflow layer. It is responsible for diffing, generation, and high-level sync because those operations start from declared schema intent.
migrations is the lower-level execution layer. It should only manage concrete migration files and their application history. Keeping that boundary clean prevents the lower-level command group from becoming aware of higher-level declarative concepts.
That lower-level layer can still expose both local mutation and platform sync commands. The important boundary is that migrations does not need to understand declarative schema generation.
Some users will need more control than the high-level schema workflow provides. A dedicated migrations group gives them a direct path for working with raw migration files without forcing that mental model onto everyone else.
Using push and pull only for platform sync creates one directional vocabulary for the entire CLI. Once a user understands schema push, it is natural to understand functions push, config push, env push, and then top-level push without wondering whether the command will mutate a local database.
apply communicates a direct change to a live local database. That is a different action from synchronizing project state with the platform, so it deserves a different verb. Keeping migrations push alongside migrations apply preserves this distinction cleanly: apply is local mutation, push is platform sync.
local tells the user exactly which world they are operating in. It makes commands like local start and local logs immediately understandable and reinforces the local versus remote model.
The alpha should optimize for clarity, not familiarity with older names. A consistent verb system makes the CLI easier to learn, easier to document, and easier for LLMs to compose correctly.
For alpha, we will use a command structure centered on dev, with reusable supporting commands grouped by workflow and asset type.
The public command surface is:
- workflow-first
- consistent across local and remote development
- based on
schema,migrations,functions,env,config,branches, andlocal - unified around
pushandpullas the platform sync verbs
For database changes specifically, the alpha model is:
schemafor declarative authoring, diffing, generation, local apply, and schema-first platform syncmigrationsfor direct file-level control, explicit local application, and explicit migration-level platform sync
dev will orchestrate this command tree rather than replace it.
