supabase-cli

GitHub

Supabase CLI 技能,涵盖本地开发、数据库迁移、边缘函数管理及项目配置。支持初始化环境、启动/停止服务、执行 SQL 迁移、部署函数及生成代码类型等完整工作流。

plugins/supabase-skills/skills/supabase-cli/SKILL.md fcakyon/claude-codex-settings

Trigger Scenarios

使用 supabase CLI supabase init supabase start 运行数据库迁移 部署边缘函数 管理 Supabase 项目

Install

npx skills add fcakyon/claude-codex-settings --skill supabase-cli -g -y
More Options

Non-standard path

npx skills add https://github.com/fcakyon/claude-codex-settings/tree/main/plugins/supabase-skills/skills/supabase-cli -g -y

Use without installing

npx skills use fcakyon/claude-codex-settings@supabase-cli

指定 Agent (Claude Code)

npx skills add fcakyon/claude-codex-settings --skill supabase-cli -a claude-code -g -y

安装 repo 全部 skill

npx skills add fcakyon/claude-codex-settings --all -g -y

预览 repo 内 skill

npx skills add fcakyon/claude-codex-settings --list

SKILL.md

Frontmatter
{
    "name": "supabase-cli",
    "license": "MIT",
    "references": [
        "commands",
        "db",
        "migration",
        "functions"
    ],
    "description": "This skill should be used when user asks to \"use supabase CLI\", \"supabase init\", \"supabase start\", \"run migrations\", \"deploy edge functions\", \"manage Supabase project\", or works with the supabase command-line tool for local development and project management."
}

Supabase CLI Skill

Skill for local development, migrations, edge functions, and project management with the supabase CLI. Official docs: https://supabase.com/docs/reference/cli/about

Installation

# macOS / Linux (Homebrew)
brew install supabase/tap/supabase

# npm
npm install -g supabase

# Windows (Scoop)
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
scoop install supabase

Authentication

# Login with access token from https://supabase.com/dashboard/account/tokens
supabase login

# Link to a project
supabase link --project-ref <project-id>

Quick Decision Trees

"I need local development"

Local dev?
├─ Initialize project → supabase init
├─ Start local stack → supabase start
│  ├─ Without specific services → supabase start -x studio,imgproxy
│  └─ Status → supabase status
├─ Stop local stack → supabase stop
│  └─ Clean up data → supabase stop --no-backup
├─ View service URLs → supabase status
└─ Bootstrap from template → supabase bootstrap

"I need database migrations"

Migrations?
├─ Create new migration → supabase migration new <name>
├─ Apply pending migrations → supabase migration up
│  └─ Rollback → supabase migration down
├─ Diff local changes → supabase db diff
│  └─ Save as migration → supabase db diff -f <name>
├─ Pull remote schema → supabase db pull
├─ Push local migrations → supabase db push
├─ Reset local database → supabase db reset
├─ List migrations → supabase migration list
├─ Squash migrations → supabase migration squash
├─ Run arbitrary SQL → supabase db query 'SELECT 1'
├─ Run pgTAP tests → supabase test db
└─ Lint schema → supabase db lint

"I need edge functions"

Edge Functions?
├─ Create new function → supabase functions new <name>
├─ Serve locally → supabase functions serve
│  └─ With env file → supabase functions serve --env-file .env.local
├─ Deploy to project → supabase functions deploy <name>
│  └─ Deploy all → supabase functions deploy
├─ Delete function → supabase functions delete <name>
├─ List functions → supabase functions list
└─ Download function → supabase functions download <name>

"I need to manage secrets"

Secrets?
├─ Set secrets → supabase secrets set KEY=value KEY2=value2
├─ Set from .env file → supabase secrets set --env-file .env
├─ List secrets → supabase secrets list
└─ Unset secrets → supabase secrets unset KEY KEY2

"I need code generation"

Code gen?
├─ TypeScript types from DB → supabase gen types typescript --project-id <id>
│  └─ From local DB → supabase gen types typescript --local
├─ Signing key → supabase gen signing-key
└─ Bearer JWT → supabase gen bearer-jwt --project-ref <ref>

"I need to inspect the database"

Inspect?
├─ Database stats → supabase inspect db db-stats
├─ Slow queries → supabase inspect db outliers
├─ Lock monitoring → supabase inspect db locks / blocking
├─ Long running queries → supabase inspect db long-running-queries
├─ Index analysis → supabase inspect db index-usage / unused-indexes
├─ Table sizes → supabase inspect db table-sizes / table-record-counts
├─ Cache hit ratio → supabase inspect db cache-hit
├─ Bloat → supabase inspect db bloat
├─ Vacuum stats → supabase inspect db vacuum-stats
└─ Replication slots → supabase inspect db replication-slots

"I need project management"

Project management?
├─ Create project → supabase projects create <name> --org-id <id> --db-password <pw> --region <r>
├─ List projects → supabase projects list
├─ Delete project → supabase projects delete --project-ref <ref>
├─ API keys → supabase projects api-keys --project-ref <ref>
├─ Organizations → supabase orgs list / create
├─ Custom domains → supabase domains create / get / activate
├─ Preview branches → supabase branches create / list / delete
├─ Backups (PITR) → supabase backups list / restore
├─ SSO management → supabase sso add / list / remove
└─ Push config → supabase config push

Common Workflows

New project setup

supabase init
supabase start
# Make schema changes in Supabase Studio (http://127.0.0.1:54323)
supabase db diff -f initial_schema
supabase stop

Migration workflow

# Create migration from local changes
supabase db diff -f add_profiles_table

# Or write SQL directly
supabase migration new add_profiles_table
# Edit supabase/migrations/<timestamp>_add_profiles_table.sql

# Test locally
supabase db reset
supabase test db

# Deploy to remote
supabase db push

Edge function development

supabase functions new my-function
# Edit supabase/functions/my-function/index.ts
supabase functions serve  # local dev with hot reload
supabase functions deploy my-function

Generate types after schema change

# From remote project
supabase gen types typescript --project-id <id> > database.types.ts

# From local running instance
supabase gen types typescript --local > database.types.ts

Reference Index

Category Reference Description
Top-level commands references/commands/ init, start, stop, status, login, link
Database references/db/ diff, dump, lint, pull, push, reset, query
Migrations references/migration/ list, new, repair, squash, up, down
Edge Functions references/functions/ new, serve, deploy, delete
Inspect references/inspect/ 20+ database inspection subcommands
Config references/config/ push config to remote
Domains references/domains/ custom domain management
Tests references/test/ pgTAP database tests
Examples references/examples.yaml Usage examples for all commands

Version History

  • 9d0ce8b Current 2026-07-25 10:36

Same Skill Collection

plugins/adhd-output-style/skills/adhd-output-style/SKILL.md
plugins/anthropic-office-skills/skills/pdf/SKILL.md
plugins/azure-tools/skills/azure-usage/SKILL.md
plugins/azure-tools/skills/setup/SKILL.md
plugins/cloudflare-skills/skills/cloudflare-deploy/SKILL.md
plugins/codex-advisor/skills/codex-advisor/SKILL.md
plugins/dokploy-skills/skills/dokploy-deploy/SKILL.md
plugins/fable-advisor/skills/fable-advisor/SKILL.md
plugins/frontend-design-skills/skills/anthropic-frontend-design/SKILL.md
plugins/frontend-design-skills/skills/openai-frontend-design/SKILL.md
plugins/gcloud-tools/skills/gcloud-usage/SKILL.md
plugins/gcloud-tools/skills/setup/SKILL.md
plugins/github-dev/skills/clean-gone-branches/SKILL.md
plugins/github-dev/skills/commit-staged/SKILL.md
plugins/github-dev/skills/create-pr/SKILL.md
plugins/github-dev/skills/resolve-pr-comments/SKILL.md
plugins/github-dev/skills/review-pr/SKILL.md
plugins/github-dev/skills/setup/SKILL.md
plugins/github-dev/skills/update-pr-summary/SKILL.md
plugins/hetzner-skills/skills/hetzner-deploy/SKILL.md
plugins/humanize/skills/humanize/SKILL.md
plugins/livekit-skills/skills/livekit-skills/SKILL.md
plugins/mongodb-skills/skills/mongodb-atlas-stream-processing/SKILL.md
plugins/mongodb-skills/skills/mongodb-mcp-setup/SKILL.md
plugins/mongodb-skills/skills/mongodb-query-optimizer/SKILL.md
plugins/openai-office-skills/skills/doc/SKILL.md
plugins/openai-office-skills/skills/pdf/SKILL.md
plugins/openai-office-skills/skills/slides/SKILL.md
plugins/openai-office-skills/skills/spreadsheet/SKILL.md
plugins/openobserve-skills/skills/openobserve-api/SKILL.md
plugins/overleaf-skills/skills/review-overleaf/SKILL.md
plugins/overleaf-skills/skills/setup/SKILL.md
plugins/paper-search-tools/skills/paper-search-usage/SKILL.md
plugins/paper-search-tools/skills/setup/SKILL.md
plugins/polar-skills/skills/polar-billing/SKILL.md
plugins/polar-skills/skills/polar-local-environment/SKILL.md
plugins/python-skills/skills/python-guidelines/SKILL.md
plugins/react-skills/skills/composition-patterns/SKILL.md
plugins/react-skills/skills/react-best-practices/SKILL.md
plugins/react-skills/skills/react-native-skills/SKILL.md
plugins/react-skills/skills/web-design-guidelines/SKILL.md
plugins/simplify/skills/simplify/SKILL.md
plugins/supabase-skills/skills/supabase-js/SKILL.md
plugins/tavily-tools/skills/setup/SKILL.md
plugins/tavily-tools/skills/tavily-usage/SKILL.md
plugins/ultralytics-branding/skills/ultralytics-branding/SKILL.md
plugins/ultralytics-dev/skills/ultralytics-platform/SKILL.md
plugins/ultralytics-dev/skills/yolo-training/SKILL.md
plugins/web-performance-skills/skills/web-performance-optimization/SKILL.md

Metadata

Files
0
Version
c4b9424
Hash
b4373468
Indexed
2026-07-25 10:36

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 05:22
浙ICP备14020137号-1 $방문자$