Supabase and Gemini CLI Integration

Gemini CLI stack for Supabase

Gemini CLI Templates offers three pre-built components for Supabase integration:

🤖 Agents

Component Description
Supabase Schema Architect Expert in database design, migrations, and RLS policies. Automatically analyzes requirements and generates production-ready schemas with optimal performance.
Supabase Realtime Optimizer Specialist in WebSocket optimization and real-time performance. Monitors connections, optimizes subscriptions, and ensures scalable real-time applications.

⚡ Commands

Command Description
supabase-schema-sync Synchronize local and remote schemas, manage version control, and detect schema drift automatically.
supabase-migration-assistant Generate, manage, and execute database migrations with rollback capabilities and conflict resolution.
supabase-performance-optimizer Analyze query performance, suggest indexes, and optimize database operations for maximum speed.
supabase-security-audit Comprehensive security analysis, RLS policy validation, and vulnerability scanning with automated fixes.
supabase-backup-manager Automated backup scheduling, restoration procedures, and disaster recovery planning with testing.
supabase-type-generator Generate TypeScript types from database schema, maintain type safety, and auto-update on schema changes.
supabase-data-explorer Interactive data exploration, visual query builder, and data export capabilities with filtering.
supabase-realtime-monitor Real-time connection monitoring, performance tracking, and WebSocket health diagnostics.

🔌 MCP

Component Description
🔌 Supabase MCP Server Direct integration with Supabase API through Model Context Protocol for seamless Gemini CLI interaction.

Browse all components on gemini-cli-templates.vercel.app

Before installing, you can explore all available Supabase components on the official Gemini CLI Templates website:

Visit pmaojo.github.io and search for "supabase" to see:

Searching for Supabase components on gemini-cli-templates.vercel.app

Installation Options

There are multiple ways to install the Supabase stack for Gemini CLI. Choose the approach that best fits your workflow:

Install Individual Components


# Install specific agent
npx github:pmaojo/gemini-cli-templates --agent supabase-schema-architect

# Install specific Supabase command
npx github:pmaojo/gemini-cli-templates --command supabase-schema-sync

# Install MCP server
npx github:pmaojo/gemini-cli-templates --mcp supabase

Components will be installed to:

  • 📁 .gemini/commands/
  • 📁 .gemini/agents/
  • 📁 .mcp.json

Create Global Agents (Available Anywhere)

# Create global agents accessible from any project
npx github:pmaojo/gemini-cli-templates --create-agent supabase-schema-architect
npx github:pmaojo/gemini-cli-templates --create-agent supabase-realtime-optimizer

# List all global agents
npx github:pmaojo/gemini-cli-templates --list-agents

# Update global agents
npx github:pmaojo/gemini-cli-templates --update-agent supabase-schema-architect

# Remove global agents  
npx github:pmaojo/gemini-cli-templates --remove-agent supabase-realtime-optimizer

Install Multiple Components at Once


# Install specific Supabase commands (comma-separated for multiple)
npx github:pmaojo/gemini-cli-templates --command supabase-schema-sync,supabase-type-generator,supabase-data-explorer
              

# Install all Supabase components in one command
npx github:pmaojo/gemini-cli-templates \
  --command supabase-schema-sync,supabase-migration-assistant,supabase-performance-optimizer,supabase-security-audit,supabase-backup-manager,supabase-type-generator,supabase-data-explorer,supabase-realtime-monitor \
  --agent supabase-schema-architect,supabase-realtime-optimizer \
  --mcp supabase

This will install:

  • ✓ 8 database commands
  • ✓ 2 specialized AI agents
  • ✓ 1 MCP server integration

Where Components Are Installed

The installation creates a standard Gemini CLI structure with components organized as follows:

your-project/
├── .gemini/
│   ├── commands/
│   │       ├── supabase-schema-sync.md
│   │       ├── supabase-migration-assistant.md
│   │       ├── supabase-performance-optimizer.md
│   │       ├── supabase-security-audit.md
│   │       ├── supabase-backup-manager.md
│   │       ├── supabase-type-generator.md
│   │       ├── supabase-data-explorer.md
│   │       └── supabase-realtime-monitor.md
│   └── agents/
│       └── supabase-schema-architect.md
│       └── supabase-realtime-optimizer.md
└── .mcp.json
└── src/ # Your application code

That's it! Gemini CLI will automatically detect all components and you can start using them immediately.

Back to Blog