Alibaba Cloud Supabase CLI
Manage your AnalyticDB for PostgreSQL Supabase (AnalyticDB Supabase) projects from the command line. Create projects, run database operations, manage migrations, and deploy edge functions with Alibaba Cloud mode enabled by default.
Introduction
What is the Alibaba Cloud Supabase CLI
The Alibaba Cloud Supabase CLI extends the open-source Supabase CLI with full AnalyticDB Supabase platform support. It includes all standard Supabase features plus Alibaba Cloud-exclusive capabilities for infrastructure management and project operations.
Key benefits
-
Out of the box: Alibaba Cloud mode enabled by default — no
--profileparameter needed. -
Full-stack support: Project management, database operations, migrations, functions, secrets, and storage.
-
No Docker required: All core commands connect directly to the remote database without a local container environment.
-
Alibaba Cloud-exclusive: Manage VPCs, availability zones, and IP whitelists.
-
Multi-platform: Supports macOS, Linux, and Windows.
Use cases
-
Project management: Create, query, and delete AnalyticDB Supabase projects.
-
Local development: Pull the remote schema, push local migrations, and run SQL queries.
-
CI/CD integration: Automate database migrations and function deployments in your pipeline.
-
Operations and maintenance: View project status, manage secrets, and monitor the database schema.
Installation
Install Supabase CLI
-
npm
npm install -g @aliyun-supabase/cli -
Download the binary
# Decompress and install. Replace the file name with the one you downloaded. tar -xzf supabase_v${VERSION}_linux_arm64.tar.gz sudo mv supabase /usr/local/bin/ # Verify the installation supabase --help
Configure access credentials
Configure your Alibaba Cloud access credentials:
# Method 1: Environment variables (Recommended)
export ALIYUN_ACCESS_KEY_ID="your-access-key-id"
export ALIYUN_ACCESS_KEY_SECRET="your-access-key-secret"
# Method 2: Combined token
export ALIYUN_ACCESS_TOKEN="AccessKeyId|AccessKeySecret"
# Optional: Set the default region and database password
export ALIYUN_REGION_ID="cn-hangzhou"
export SUPABASE_DB_PASSWORD="your-db-password"
Supported commands
Project management (supabase projects)
Create, query, and delete AnalyticDB Supabase projects.
|
Command |
Description |
Example |
|
|
Lists all projects. |
|
|
|
Shows details for a project. |
|
|
|
Shows the API keys for a project. |
|
|
|
Creates a new project. |
|
|
|
Deletes a project. |
|
|
|
Updates the IP whitelist. |
|
|
|
Resets the database password. |
|
Examples:
# List all projects
supabase projects list
# Show project details
supabase projects show sbp-3zyrsu6j0w4s****
# Show API keys
supabase projects api-keys --project-ref sbp-3zyrsu6j0w4s****
Infrastructure management (supabase infra)
Alibaba Cloud-exclusive commands for managing regions, VPCs, and vSwitches.
|
Command |
Description |
Example |
|
|
Lists available regions and availability zones. |
|
|
|
Lists the VPCs in a specified region. |
|
|
|
Lists the vSwitches in a specified VPC. |
|
Examples:
# List all available regions
supabase infra regions
# List the VPCs in the China (Hangzhou) region
supabase infra vpcs --region cn-hangzhou
Project linking (supabase link)
Link a local project to a remote AnalyticDB Supabase project.
|
Command |
Description |
Example |
|
|
Links to a remote project. |
|
|
|
Unlinks from the current project. |
|
Example:
# Link to an Alibaba Cloud project
supabase link --project-ref sbp-3zyrsu6j0w4s**** --password '<your-db-password>'
Database management (supabase db)
Manage Postgres database schema, migrations, and queries.
|
Command |
Description |
Example |
|
|
Lists database tables. |
|
|
|
Lists the columns of a table. |
|
|
|
Lists indexes. |
|
|
|
Lists extensions. |
|
|
|
Shows the differences between local and remote database schemas. |
|
|
|
Dumps the database schema. |
|
|
|
Pulls the remote schema. |
|
|
|
Pushes local migrations. |
|
|
|
Lints the schema for errors. |
|
|
|
Executes an SQL query. |
|
Examples:
# List all tables
supabase db tables list --project-ref sbp-3zyrsu6j0w4s****
# View table structure
supabase db columns list --project-ref sbp-3zyrsu6j0w4s*** --table inventory
# Run an SQL query (requires a linked project)
supabase db query "SELECT * FROM public.inventory LIMIT 10" --linked
Migration management (supabase migration)
Manage database migration scripts and history.
|
Command |
Description |
Example |
|
|
Lists migration records. |
|
|
|
Applies pending migrations. |
|
|
|
Rolls back a migration. |
|
|
|
Repairs the migration history. |
|
|
|
Creates a new migration file. |
|
|
|
Fetches migration files. |
|
Examples:
# View migration history
supabase migration list --project-ref sbp-3zyrsu6j0w4s**** --password '<your-db-password>'
# Repair a migration status
supabase migration repair 20260416111028 --status reverted --project-ref sbp-3zyrsu6j0w4s****
Edge functions (supabase functions)
Deploy and invoke AnalyticDB Supabase edge functions.
|
Command |
Description |
Example |
|
|
Lists all functions. |
|
|
|
Deploys a function. |
|
|
|
Downloads a function. |
|
|
|
Deletes a function. |
|
|
|
Invokes a function. |
|
Examples:
# List all functions
supabase functions list --project-ref sbp-3zyrsu6j0w4s****
# Deploy a function
supabase functions deploy hello-world --project-ref sbp-3zyrsu6j0w4s****
Secret management (supabase secrets)
Manage environment variables and secrets for AnalyticDB Supabase projects.
|
Command |
Description |
Example |
|
|
Lists all secrets. |
|
|
|
Sets a secret. |
|
|
|
Unsets a secret. |
|
Examples:
# List secrets
supabase secrets list --project-ref sbp-3zyrsu6j0w4s****
# Set a secret
supabase secrets set DATABASE_URL=postgresql://... --project-ref sbp-3zyrsu6j0w4s****
User management (supabase auth)
Alibaba Cloud-exclusive commands for managing Supabase Auth users.
|
Command |
Description |
Example |
|
|
Lists all users. |
|
|
|
Shows details for a user. |
|
|
|
Creates a user. |
|
|
|
Updates a user. |
|
|
|
Deletes a user. |
|
Parameters for creating a user:
|
Parameter |
Description |
|
|
The user's email address. |
|
|
The user's phone number. |
|
|
The user's password. |
|
|
Automatically confirms the user's email address. |
|
|
Automatically confirms the user's phone number. |
Examples:
# List all users
supabase auth users list --project-ref sbp-xxxxxxx
# Create a user
supabase auth users create --email user@example.com --password 'SecurePass123' --project-ref sbp-xxxxxxx
# Update a user's email
supabase auth users update <user-id> --email new@example.com --project-ref sbp-xxxxxxx
# Delete a user
supabase auth users delete <user-id> --project-ref sbp-xxxxxxx
Storage management (supabase storage)
Manage buckets and files in AnalyticDB Supabase Storage.
|
Command |
Description |
Example |
|
|
Lists buckets. |
|
|
|
Creates a bucket. |
|
|
|
Deletes a bucket. |
|
|
|
Lists files. |
|
|
|
Copies a file. |
|
|
|
Moves a file. |
|
|
|
Deletes a file. |
|
Code generation (supabase gen)
Generate type definitions from your database schema.
|
Command |
Description |
Example |
|
|
Generates a JWT. |
|
|
|
Generates a signing key. |
|
Supports TypeScript, Go, Swift, and Python.
Example:
# Generate TypeScript types
supabase gen types typescript --project-ref sbp-3zyrsu6j0w4s**** --password '<your-db-password>'
Quick start
Step 1: Configure your environment
export ALIYUN_ACCESS_KEY_ID="your-access-key-id"
export ALIYUN_ACCESS_KEY_SECRET="your-access-key-secret"
export SUPABASE_DB_PASSWORD="your-db-password"
Step 2: List all projects
supabase projects list
Step 3: Link a project
supabase link --project-ref sbp-3zyrsu6j0w4s**** --password '<your-db-password>'
Step 4: Show project details
supabase projects show sbp-3zyrsu6j0w4s****
Step 5: Query the database
# List all tables
supabase db tables list --project-ref sbp-3zyrsu6j0w4s****
# Run an SQL query
supabase db query "SELECT * FROM public.inventory LIMIT 10" --linked
Step 6: Pull the schema
# Pull the remote schema to your local environment
supabase db pull --project-ref sbp-3zyrsu6j0w4s**** --password '<your-db-password>'