
Supabase CLI
CLISupabase 官方命令行,在本地启动含 Postgres、Auth、Storage、Edge Functions 的完整后端栈,管理数据库迁移、生成类型并部署函数。本地栈依赖 Docker。
Develop locally and deploy to the Supabase Platform from your terminal.
Supabase CLI brings the Supabase Platform to your terminal. Run the full local stack, manage database migrations, deploy Edge Functions, generate types, and automate project workflows.
Installation
# YOLO
curl -fsSL https://raw.githubusercontent.com/supabase/cli/main/install | bash
# npm
npm install -D supabase # or bun/pnpm/yarn add -D supabase
npm install -D supabase@beta # beta channel
# macOS and Linux
brew install supabase/tap/supabase # always up to date
brew install supabase # official formula, may be delayed
brew install supabase/tap/supabase-beta # beta channel
# Windows
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
scoop install supabase
scoop install supabase-beta # beta channel
# Linux packages
# Download .apk, .deb, .rpm, or .pkg.tar.zst from GitHub Releases.
Linux packages are available from Releases. Community-maintained packages are also available through pkgx and Nixpkgs.
Start Local Development
Create a Supabase workspace and start the local stack:
supabase init
supabase start
supabase status
The local stack includes Postgres, Auth, Realtime, Storage, Edge Functions, and the Supabase APIs.
Start from a template:
supabase bootstrap
Link A Project
Connect your local workspace to a hosted Supabase project:
supabase login
supabase link
Manage Your Database
Create migrations, compare schemas, and apply changes locally or to your linked project:
supabase migration new create_profiles
supabase db diff
supabase db push
supabase db reset
Deploy Edge Functions
Build, serve, and deploy functions from the same project workspace:
supabase functions new hello-world
supabase functions serve
supabase functions deploy hello-world
Generate Types
Generate TypeScript types from your local database or linked project:
supabase gen types --local
supabase gen types --linked
Reference
Use --help on any command to explore flags and examples:
supabase db --help
supabase functions deploy --help
Developing
This repository is a pnpm monorepo. The published package lives in apps/cli.
pnpm install
pnpm check:all
cd apps/cli
pnpm types:check
pnpm run test:unit && pnpm run test:integration
Useful source entry points:
| Path | Purpose |
|---|---|
apps/cli | TypeScript/Bun CLI package |
apps/cli-go | Go CLI source used by the CLI |
packages/stack | Local Supabase stack runtime |
packages/config | Config schema and generated types |
packages/api | Typed Supabase Management API client |
After a fresh clone, install the reference repositories used for agent and developer inspection:
pnpm repos:install
Contributing
We love focused pull requests with a clear problem, a small surface area, and tests that match the user-facing behavior.
Open an issue first and wait for a maintainer to add the open-for-contribution label before starting work — external pull requests that don't link a labeled, open issue are closed automatically. See CONTRIBUTING.md for the full workflow.
Before opening a PR, run repo-wide quality checks from the repository root,
then run the relevant package tests from each workspace you touched. For each
touched TypeScript workspace (or any workspace that declares it), also run its
pnpm types:check script. For example:
# From the repository root:
pnpm check:all
# From apps/cli (a touched TypeScript workspace):
cd apps/cli
pnpm types:check
pnpm run test:unit && pnpm run test:integration
# Repeat the relevant package tests for every touched workspace; run
# pnpm types:check there too when that workspace declares the script.
PR titles must use conventional commits, for example:
fix(cli): handle linked projects without cached service versions
License
Supabase CLI packages are released under the MIT license.
相关资源

Supabase MCP Server
MCP连接 Supabase 项目:管理表结构与迁移、执行 SQL、部署 Edge Functions、创建开发分支、生成 TypeScript 类型。Supabase 官方托管的远程服务,OAuth 登录。
supabase/mcp3k
Supabase
SkillSupabase 官方通用技能:覆盖数据库、Auth、Edge Functions、Realtime、Storage、向量与队列,以及 supabase-js/SSR 集成、CLI 与 MCP、迁移和 RLS 安全检查,要求先查最新文档与变更日志再动手。
supabase/agent-skills2.8k
Supabase Agent Plugin
PluginSupabase 官方插件:内置 Supabase 与 Postgres 最佳实践技能,并接入 Supabase 远程 MCP,可管理项目、执行 SQL、设计表结构与 RLS、处理认证和存储。需要 Supabase 账号。
supabase-community/supabase-plugin36
CloudBase AI Toolkit
MCP腾讯云开发官方工具包:让 agent 登录 CloudBase,操作文档型与 PostgreSQL 数据库、云函数、云存储和静态托管,并把 Web 与小程序应用部署上线。可本地 npx 运行或接入远程 MCP,需要 CloudBase 环境。
TencentCloudBase/CloudBase-AI-Toolkit1.1k
Firebase CLI
CLIFirebase 官方命令行:部署 Hosting、Cloud Functions 与安全规则,启动本地模拟器,读写数据库并导入导出用户;同仓库还提供官方 Firebase MCP 服务器。需要登录 Firebase 账号。
firebase/firebase-tools4.5k
Supabase Postgres Best Practices
Skill按影响分级的 Postgres 规则:查询优化、索引、连接池、RLS 安全、schema 设计与锁问题排查,附错误与正确 SQL 对照,适用于任意 Postgres。Supabase 官方维护。
supabase/agent-skills2.8k