Skip to main content
command CX Codex

generate-types-from-supabase — Claude Code command: types from DB

generate-types-from-supabase analyzes Supabase schema and generates TypeScript types for DTOs and Command Models. Cuts down manual type definition work by deriving structures from your database.

AGPL-3.0 ★ 267 updated 2026-02-20

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/generate-types-from-supabase.md
Open on GitHub

What generate-types-from-supabase does

The command reads your database model definitions and produces typed Data Transfer Objects and command structures. It examines entity schemas, isolates relevant fields, applies TypeScript transformations (Pick, Omit, Partial), and binds each DTO back to the original table definition.

Works in steps: studies model structure, builds DTOs with correct types, validates connections between commands and entities. Output goes to src/types.ts ready to use.

Requires the database schema to be available as @database.types.ts. Keeps types in sync with Supabase changes and enforces strict typing across your API layer.

What it helps with

  • Generate DTO types matching Supabase table schemas
  • Create Command Models tied to database entities
  • Prevent drift between type definitions and actual data structures
  • Apply type transformations for Create, Update, and Read operations

Example prompts for the agent

  • Generate DTOs for all tables from the database schema
  • Create Create and Update Command Models from entity definitions
  • Analyze @database.types.ts and write types to src/types.ts

How to install generate-types-from-supabase

Manually: put the files in place

.claude/commands/generate-types-from-supabase.md

Call it with /generate-types-from-supabase. For all projects use ~/.claude/commands/

Questions about generate-types-from-supabase

How do I install generate-types-from-supabase in Claude Code?

Copy .claude/commands/generate-types-from-supabase.md to your project's .claude/commands/ directory. The command becomes available in Claude Code immediately after.

What does generate-types-from-supabase do?

Reads Supabase type definitions, extracts fields for DTOs, and builds typed command models that reference source entities through TypeScript type utilities.

What do I need for the command to work?

Database schema must be accessible as @database.types.ts. You need TypeScript familiarity and understanding of your Supabase table structure.

Similar slash commands

All slash commands for Backend and APIs →
supabase-migration-assistant davila7 supabase-migration-assistant is a Claude Code command that generates and validates Supabase database migrations. It builds SQL scripts, updates TypeScript definitions, and prepares rollback steps. CX Codex +1 982installs supabase-type-generator davila7 supabase-type-generator — a slash command that turns your Supabase schema into TypeScript types and keeps them in sync. Useful when the database moves ahead of the types in your project. CX Codex +1 948installs nextjs-typescript-tailwindcss-supabase Mindrally nextjs-typescript-tailwindcss-supabase — a skill that steers your agent toward Next.js 14, TypeScript, TailwindCSS and Supabase: server components, error handling, readable code. CX Codex +1 1,400installs supabase bobmatnyc Provides patterns for configuring @supabase/supabase-js, querying Postgres via PostgREST, and setting up auth flows in Next.js, React, or Vue apps. CX Codex +1 219installs typescript-react-nextui-supabase-cursorrules-promp PatrickJS The typescript-react-nextui-supabase-cursorrules-promp rule gives an agent context for a TypeScript app built with React, NextUI, and Supabase. Use it when working on the UI, user dashboard, or authentication flows. CX Codex +1 ★ 41,178repo stars typescript-nextjs-supabase-cursorrules-prompt-file PatrickJS typescript-nextjs-supabase-cursorrules-prompt-file — a Cursor rule that keeps TypeScript work on Next.js App Router and Supabase consistent: server components first, Shadcn UI, Tailwind. CX Codex +1 ★ 41,178repo stars

From the same set24

The whole set →
shadcn-resume-implementation shadcn-resume-implementation is a Claude Code command that resumes frontend work from a saved status. It uses the implementation plan, frontend rules, and type definitions. CX Codex +1 ★ 267repo stars shadcn-plan-summary shadcn-plan-summary — a command that captures decisions from UI architecture sessions. Extracts choices about layout, flows, API integration, and state management, then compiles them into a structured report for the next development phase. CX Codex +1 ★ 267repo stars test-plan test-plan is a Claude Code rule that builds a project-specific test plan from the codebase and tech stack. It writes the result in Polish as Markdown. CX Codex +1 ★ 267repo stars supabase-migrations This rule guides Claude Code when creating Supabase SQL migrations, from timestamped filenames to RLS policies. It applies to files under supabase/migrations/. CX Codex +1 ★ 267repo stars vitest-unit-testing vitest-unit-testing is a Claude Code rule for writing Vitest unit tests. It guides module mocking and React component test structure. CX Codex +1 ★ 267repo stars project-prd The project-prd command turns project plans into a structured PRD and saves it as a Markdown file. Use it to draft requirements, user stories, and acceptance criteria. CX Codex +1 ★ 267repo stars 10x-implement 10x-implement — a command to implement approved technical plans step-by-step in Claude Code. Reads the plan, tracks progress, and verifies each phase before moving on. CX Codex +1 ★ 267repo stars shadcn-plan-session shadcn-plan-session runs an interactive UI planning session for an MVP using product specs, tech stack notes, and API endpoints. CX Codex +1 ★ 267repo stars

Project sponsors

Companies that keep this analytics open