base44 types generate
Generate TypeScript declaration file (types.d.ts) from project resources (entities, functions, actors, agents, connectors).
Usage
npx base44 types generateWhat It Does
- Reads project configuration — Scans
base44/entities/,base44/functions/,base44/actors/,base44/agents/, andbase44/connectors/for all defined resources - Generates
base44/.types/types.d.ts— Creates a TypeScript declaration file that augments the@base44/sdkmodule with typed registries - Updates
tsconfig.json(if present) — Automatically addsbase44/.types/*.d.tsto theincludearray so TypeScript picks up the generated types
Authentication
Not required. This command runs entirely locally and does not need authentication.
Output File
The generated file is placed at:
base44/.types/types.d.tsGenerated Content
The declaration file augments the @base44/sdk module with five registries:
EntityTypeRegistry— Maps entity names to their TypeScript interfaces (compiled from entity JSON schemas)FunctionNameRegistry— Lists all backend function namesAgentNameRegistry— Lists all agent namesConnectorTypeRegistry— Lists all connector typesActorNameRegistry— Lists all actor names
A registry with no entries is omitted from the file entirely.
Actor message types are not generated — augment ActorRegistry by hand to type subscribe callbacks and send payloads (see the base44-sdk skill's actors.md).
Example output:
// Auto-generated by Base44 CLI - DO NOT EDIT
// Regenerate with: base44 types generate
export interface Task {
title: string;
status: "todo" | "in_progress" | "done";
assignee?: string;
}
export interface Board {
name: string;
description?: string;
}
declare module '@base44/sdk' {
interface EntityTypeRegistry {
"Task": Task;
"Board": Board;
}
interface FunctionNameRegistry {
"send_email": true;
}
interface AgentNameRegistry {
"support_agent": true;
}
interface ConnectorTypeRegistry {
"googlecalendar": true;
}
interface ActorNameRegistry {
"ChatRoom": true;
}
}If no resources are found, the file contains a placeholder with instructions on how to add resources.
tsconfig.json Integration
If a tsconfig.json exists in the project root, the command automatically adds base44/.types/*.d.ts to the include array:
{
"include": [
"src",
"base44/.types/*.d.ts"
]
}If the path is already included, or no tsconfig.json exists, this step is silently skipped.
When to Run
- After creating or modifying entity schemas in
base44/entities/ - After adding or removing backend functions in
base44/functions/ - After adding or removing actors in
base44/actors/ - After adding or removing agents in
base44/agents/ - After adding or removing connectors in
base44/connectors/ - When setting up a TypeScript project for the first time with Base44
Notes
- The generated file should not be manually edited — it will be overwritten on the next run
- Consider adding
base44 types generateto your build pipeline or as a pre-build script - The
.typesdirectory is created automatically inside thebase44/folder