Back to list
FortiumPartners

managing-supabase

by FortiumPartners

Ensemble Plugin Ecosystem - Modular Claude Code plugins for AI-augmented development workflows

0🍴 1📅 Jan 22, 2026

SKILL.md


name: managing-supabase description: Supabase CLI for database management, Edge Functions, migrations, and local development. Use for managing Postgres databases, deploying serverless functions, and debugging Supabase projects.

Supabase CLI Skill

Table of Contents

  1. Quick Reference
  2. Critical: Avoiding Interactive Mode
  3. Prerequisites
  4. Authentication
  5. CLI Decision Tree
  6. Essential Commands
  7. Local Development Ports
  8. Common Workflows
  9. Error Handling
  10. Auto-Detection Triggers
  11. Agent Integration
  12. Quick Reference Card
  13. Further Reading

Quick Reference

Supabase CLI enables local development, database migrations, Edge Functions deployment, and project management for Supabase projects.


Critical: Avoiding Interactive Mode

Supabase CLI can enter interactive mode which will hang Claude Code. Always use flags to bypass prompts:

CommandWRONG (Interactive)CORRECT (Non-Interactive)
Loginsupabase loginUse SUPABASE_ACCESS_TOKEN env var
Link projectsupabase linksupabase link --project-ref <ref>
Create projectsupabase projects createsupabase projects create <name> --org-id <id> --region <region>
Start localsupabase startsupabase start (non-interactive by default)
Deploy functionssupabase functions deploysupabase functions deploy <name> --project-ref <ref>

Never use in Claude Code:

  • supabase login without token (opens browser)
  • Any command without --project-ref when not linked
  • Interactive prompts for organization/region selection

Always include:

  • SUPABASE_ACCESS_TOKEN environment variable for authentication
  • --project-ref flag or pre-linked project
  • Explicit flags for all configuration options

Prerequisites

Installation Verification

supabase --version
# Expected: 2.x.x or higher

Installation Methods

# npm (requires Node.js 20+)
npm install -g supabase

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

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

Authentication

Environment Variables (CI/CD Required)

VariablePurposeRequired For
SUPABASE_ACCESS_TOKENPersonal access tokenAll remote operations
SUPABASE_DB_PASSWORDDatabase passworddb push, db pull, link
SUPABASE_PROJECT_IDProject reference stringLinking without interactive prompt

Token Generation

Generate tokens at: https://supabase.com/dashboard/account/tokens

Authentication Pattern for Claude Code

# Set from project .env file
export SUPABASE_ACCESS_TOKEN="$(grep SUPABASE_ACCESS_TOKEN .env | cut -d= -f2)"
export SUPABASE_DB_PASSWORD="$(grep SUPABASE_DB_PASSWORD .env | cut -d= -f2)"

# All commands will use these automatically
supabase projects list
supabase link --project-ref <ref>

CLI Decision Tree

What do you need to do?

Project Setup
├── Initialize local project ──────────► supabase init
├── Link to remote project ────────────► supabase link --project-ref <ref>
├── Start local stack ─────────────────► supabase start
├── Stop local stack ──────────────────► supabase stop
└── Check status ──────────────────────► supabase status

Database Operations
├── Create migration ──────────────────► supabase migration new <name>
├── Apply migrations locally ──────────► supabase db reset
├── Push migrations to remote ─────────► supabase db push
├── Pull remote schema ────────────────► supabase db pull
├── Diff local vs remote ──────────────► supabase db diff --linked
└── Lint database schema ──────────────► supabase db lint

Edge Functions
├── Create new function ───────────────► supabase functions new <name>
├── Serve locally ─────────────────────► supabase functions serve
├── Deploy function ───────────────────► supabase functions deploy <name>
├── List deployed functions ───────────► supabase functions list
└── Delete function ───────────────────► supabase functions delete <name>

Secrets Management
├── Set secret ────────────────────────► supabase secrets set NAME=value
├── Set from file ─────────────────────► supabase secrets set --env-file .env
├── List secrets ──────────────────────► supabase secrets list
└── Remove secret ─────────────────────► supabase secrets unset NAME

Type Generation
├── Generate TypeScript types ─────────► supabase gen types typescript --linked
└── Generate from local ───────────────► supabase gen types typescript --local

Debugging
├── View container logs ───────────────► supabase logs (local)
├── Check slow queries ────────────────► supabase inspect db outliers
└── View blocking queries ─────────────► supabase inspect db blocking

For complete command reference including storage, project management, and all inspection commands, see REFERENCE.md.


Essential Commands

Project Setup

CommandDescriptionKey Flags
supabase initInitialize local project--workdir
supabase startStart local development stack-x (exclude services)
supabase stopStop local stack--no-backup
supabase statusShow local container status-
supabase linkLink to remote project--project-ref <ref> (required)

Database Commands

CommandDescriptionKey Flags
supabase db resetReset local database-
supabase db pushPush migrations to remote--dry-run, --include-seed
supabase db pullPull schema from remote--schema <name>
supabase db diffDiff schema changes--linked, --local, -f <name>
supabase db lintLint for schema errors--linked, --level <warning|error>

Migration Commands

CommandDescriptionKey Flags
supabase migration newCreate new migration<name> (required)
supabase migration listList migration history--db-url <url>
supabase migration upApply pending migrations--local, --linked

Edge Functions Commands

CommandDescriptionKey Flags
supabase functions newCreate new function<name> (required)
supabase functions serveServe locally--env-file <path>
supabase functions deployDeploy function(s)--no-verify-jwt, --project-ref
supabase functions deleteDelete function<name> (required)

Secrets Commands

CommandDescriptionKey Flags
supabase secrets setSet secret(s)NAME=value, --env-file <path>
supabase secrets listList secrets--project-ref
supabase secrets unsetRemove secret(s)<NAME>

For type generation, database inspection, storage, and project management commands, see REFERENCE.md.


Local Development Ports

ServicePortURL
API Gateway54321http://localhost:54321
Database54322postgresql://postgres:postgres@localhost:54322/postgres
Studio54323http://localhost:54323
Inbucket (Email)54324http://localhost:54324

Common Workflows

1. Initialize New Project

# Create local project structure
supabase init

# Link to existing remote project
export SUPABASE_ACCESS_TOKEN="your-token"
supabase link --project-ref <project-ref>

# Start local development
supabase start

2. Create and Apply Migrations

# Create new migration
supabase migration new add_users_table

# Edit migration file at supabase/migrations/<timestamp>_add_users_table.sql

# Apply locally
supabase db reset

# Push to remote
supabase db push

3. Pull Remote Schema Changes

# Link project first
supabase link --project-ref <ref>

# Pull all schema changes
supabase db pull

# Or create migration from remote changes
supabase db pull --schema public

4. Deploy Edge Functions

# Create new function
supabase functions new hello-world

# Edit supabase/functions/hello-world/index.ts

# Test locally
supabase functions serve

# Deploy to production
supabase functions deploy hello-world

# Deploy without JWT verification (for webhooks)
supabase functions deploy hello-world --no-verify-jwt

5. Manage Secrets

# Set individual secret
supabase secrets set STRIPE_KEY=sk_test_xxx

# Set from .env file
supabase secrets set --env-file .env.production

# List current secrets
supabase secrets list

# Remove secret
supabase secrets unset STRIPE_KEY

6. Generate TypeScript Types

# From remote database
supabase gen types typescript --linked > src/types/database.ts

# From local database
supabase gen types typescript --local > src/types/database.ts

7. Debug Database Performance

# Find slow queries
supabase inspect db outliers

# Check for blocking queries
supabase inspect db blocking

# Check cache hit ratios
supabase inspect db cache-hit

For advanced workflows including CI/CD integration and migration strategies, see REFERENCE.md.


Error Handling

Common Errors and Solutions

ErrorCauseSolution
Error: You need to be logged inMissing access tokenSet SUPABASE_ACCESS_TOKEN env var
Error: Project ref is requiredNo project linkedUse --project-ref or run supabase link
Error: Cannot connect to DockerDocker not runningStart Docker Desktop
Error: Port 54321 already in usePrevious instance runningRun supabase stop first
Error: Migration failedSQL syntax errorCheck migration file syntax

Docker Issues

# Check if Docker is running
docker info

# Clean up Supabase containers
supabase stop --no-backup
docker system prune -f

# Restart with fresh state
supabase start

Migration Conflicts

# View migration status
supabase migration list

# Repair migration history
supabase migration repair --status reverted <version>

# Squash migrations if needed
supabase migration squash --version <timestamp>

For complete troubleshooting guide including permission issues and advanced debugging, see REFERENCE.md.


Auto-Detection Triggers

This skill auto-loads when Supabase context is detected:

File-based triggers:

  • supabase/config.toml in project
  • supabase/ directory present
  • SUPABASE_ACCESS_TOKEN in .env file

Context-based triggers:

  • User mentions "Supabase"
  • User runs supabase CLI commands
  • Database migration discussions
  • Edge Functions deployment

Agent Integration

Compatible Agents

AgentUse Case
deployment-orchestratorAutomated deployments, CI/CD
infrastructure-developerDatabase provisioning
deep-debuggerQuery analysis, performance debugging
backend-developerDatabase schema, Edge Functions
postgresql-specialistAdvanced database operations

Handoff Patterns

To Deep-Debugger: Slow query investigation, migration failures, Edge Function runtime errors

From Deep-Debugger: Schema problems requiring migrations, environment variable changes


Quick Reference Card

# Authentication (NEVER use supabase login in Claude Code)
export SUPABASE_ACCESS_TOKEN="xxx"

# Project setup
supabase init
supabase link --project-ref <ref>
supabase start
supabase stop

# Database
supabase migration new <name>
supabase db reset
supabase db push
supabase db pull
supabase db diff --linked

# Edge Functions
supabase functions new <name>
supabase functions serve
supabase functions deploy <name>

# Secrets
supabase secrets set KEY=value
supabase secrets list
supabase secrets unset KEY

# Types
supabase gen types typescript --linked > types.ts

# Debugging
supabase inspect db outliers
supabase inspect db blocking

Further Reading

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon