types-gen

Generate TypeScript types from a Supabase database schema.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/gpaura/claude_plugins --skill types-gen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: types-gen
Source: https://github.com/gpaura/claude_plugins/tree/main/skills/types-gen
Command: npx skills add https://github.com/gpaura/claude_plugins --skill types-gen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill generates TypeScript types directly from your Supabase database schema, eliminating manual type definitions and keeping client code in sync with the database.

Core Features & Use Cases

  • Automated type generation: Produces a Database type with Tables, Row, Insert, and Update shapes for quick, type-safe queries.
  • Seamless integration: Works with standard Next.js/TypeScript projects and common tooling; regenerates after schema changes.
  • Use Case: Use generated types to ensure compile-time correctness when querying or mutating data with the Supabase client.

Quick Start

Use the Supabase CLI to generate types from your schema: npx supabase gen types typescript --project-id YOUR_PROJECT_ID > lib/database.types.ts Or for a local schema: npx supabase gen types typescript --local > lib/database.types.ts

Frequently Asked Questions about types-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate TypeScript types from a Supabase database schema?

Generate TypeScript types from a Supabase schema by running the Supabase CLI command `npx supabase gen types typescript` with your project ID or local flag, redirecting output to a TypeScript file for type-safe queries.

Why should I generate TypeScript types for Supabase instead of defining them manually?

Generating TypeScript types from Supabase eliminates manual type definitions and keeps client code synchronized with database schema changes, ensuring compile-time correctness for queries and inserts across tables.

What do I need to set up Supabase type generation for a TypeScript project?

Supabase type generation requires Node/npm and the Supabase CLI installed in your environment. You can wire the generation command into npm scripts or pre-commit hooks to automate type updates after schema changes.

Can I use the Supabase CLI to generate types for a local database schema?

Yes, you can generate TypeScript types for a local Supabase schema by running `npx supabase gen types typescript --local`, outputting the definitions directly to your TypeScript project for local development.

How do I automate Supabase type regeneration when my database schema changes?

Automate Supabase type regeneration by wiring the `supabase gen types typescript` command into npm scripts or pre-commit hooks, ensuring your TypeScript types update automatically after any database schema changes.