supabase
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSupabase Skill
Supabase 操作指南
Use the CLI to manage Supabase projects and local development.
supabase使用 CLI管理Supabase项目与本地开发。
supabaseProjects
项目管理
List all projects:
bash
supabase projects listLink to a remote project:
bash
supabase link --project-ref <project-id>列出所有项目:
bash
supabase projects list关联远程项目:
bash
supabase link --project-ref <project-id>Local Development
本地开发
Start local Supabase stack (Postgres, Auth, Storage, etc.):
bash
supabase startStop local stack:
bash
supabase stopCheck status of local services:
bash
supabase status启动本地Supabase栈(Postgres、Auth、Storage等):
bash
supabase start停止本地栈:
bash
supabase stop检查本地服务状态:
bash
supabase statusDatabase
数据库
Run SQL query:
bash
supabase db execute --sql "SELECT * FROM users LIMIT 10"Pull remote schema to local:
bash
supabase db pullPush local migrations to remote:
bash
supabase db pushReset local database:
bash
supabase db resetDiff local vs remote schema:
bash
supabase db diff运行SQL查询:
bash
supabase db execute --sql "SELECT * FROM users LIMIT 10"拉取远程架构到本地:
bash
supabase db pull推送本地迁移到远程:
bash
supabase db push重置本地数据库:
bash
supabase db reset对比本地与远程架构差异:
bash
supabase db diffMigrations
迁移管理
Create a new migration:
bash
supabase migration new <migration-name>List migrations:
bash
supabase migration listApply migrations locally:
bash
supabase migration upSquash migrations:
bash
supabase migration squash创建新的迁移:
bash
supabase migration new <migration-name>列出迁移:
bash
supabase migration list在本地应用迁移:
bash
supabase migration up合并迁移:
bash
supabase migration squashEdge Functions
Edge Functions
List functions:
bash
supabase functions listCreate a new function:
bash
supabase functions new <function-name>Deploy a function:
bash
supabase functions deploy <function-name>Deploy all functions:
bash
supabase functions deployServe functions locally:
bash
supabase functions serveView function logs:
bash
supabase functions logs <function-name>列出函数:
bash
supabase functions list创建新函数:
bash
supabase functions new <function-name>部署函数:
bash
supabase functions deploy <function-name>部署所有函数:
bash
supabase functions deploy在本地运行函数:
bash
supabase functions serve查看函数日志:
bash
supabase functions logs <function-name>Storage
存储管理
List buckets:
bash
supabase storage lsList objects in a bucket:
bash
supabase storage ls <bucket-name>Copy file to storage:
bash
supabase storage cp <local-path> ss:///<bucket>/<path>Download from storage:
bash
supabase storage cp ss:///<bucket>/<path> <local-path>列出存储桶:
bash
supabase storage ls列出存储桶中的对象:
bash
supabase storage ls <bucket-name>复制文件到存储:
bash
supabase storage cp <local-path> ss:///<bucket>/<path>从存储下载文件:
bash
supabase storage cp ss:///<bucket>/<path> <local-path>Secrets
密钥管理
Set a secret for Edge Functions:
bash
supabase secrets set <NAME>=<value>List secrets:
bash
supabase secrets listUnset a secret:
bash
supabase secrets unset <NAME>为Edge Functions设置密钥:
bash
supabase secrets set <NAME>=<value>列出密钥:
bash
supabase secrets list删除密钥:
bash
supabase secrets unset <NAME>Type Generation
类型生成
Generate TypeScript types from database schema:
bash
supabase gen types typescript --local > types/supabase.tsGenerate types from remote:
bash
supabase gen types typescript --project-id <project-id> > types/supabase.ts从数据库架构生成TypeScript类型:
bash
supabase gen types typescript --local > types/supabase.ts从远程生成类型:
bash
supabase gen types typescript --project-id <project-id> > types/supabase.tsAuthentication
身份验证
Login to Supabase:
bash
supabase loginCheck current status:
bash
supabase projects list登录到Supabase:
bash
supabase login检查当前状态:
bash
supabase projects list