generate_typescript_types
Generate TypeScript types from a Supabase database schema and save the file to a specified path. Requires DATABASE_URL configuration and Supabase CLI installation to streamline type generation for development projects.
Instructions
Generates TypeScript types from the database schema using the Supabase CLI (supabase gen types) and downloads the file to the specified absolute path. The tool returns the current platform (win32, darwin, linux) to help with path formatting. Requires DATABASE_URL configuration and Supabase CLI installed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| included_schemas | No | Database schemas to include in type generation. | |
| output_filename | No | Filename to save the generated types to in the workspace root. | database.types.ts |
| output_path | Yes | Absolute path where to download the generated TypeScript file. Examples: Windows: "C:\\path\\to\\project\\database.types.ts", macOS/Linux: "/path/to/project/database.types.ts". This parameter is required. |
Input Schema (JSON Schema)
{
"properties": {
"included_schemas": {
"default": [
"public"
],
"description": "Database schemas to include in type generation.",
"items": {
"type": "string"
},
"type": "array"
},
"output_filename": {
"default": "database.types.ts",
"description": "Filename to save the generated types to in the workspace root.",
"type": "string"
},
"output_path": {
"description": "Absolute path where to download the generated TypeScript file. Examples: Windows: \"C:\\\\path\\\\to\\\\project\\\\database.types.ts\", macOS/Linux: \"/path/to/project/database.types.ts\". This parameter is required.",
"type": "string"
}
},
"required": [
"output_path"
],
"type": "object"
}