Generate files from your Tailor Platform configuration. This command processes yourDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tailor-platform/sdk/llms.txt
Use this file to discover all available pages before exploring further.
tailor.config.ts file and runs all configured code generators to produce TypeScript types, resolver scaffolding, and other generated artifacts.
Command Syntax
Options
Path to SDK config file.Alias:
-cWatch for type/resolver changes and regenerate automatically. The watcher monitors your TailorDB types and resolver files, rerunning generation when changes are detected.Alias:
-WCommon Options
The following common options are also available:--env-file/-e- Path to environment file (error if not found)--env-file-if-exists- Path to environment file (ignored if not found)--verbose- Enable verbose logging (show stack traces on error)
Usage Examples
Basic Generation
tailor.config.ts configuration file.
Generate with Custom Config
Watch Mode
Generate with Environment Variables
.env.local before running generation.
What Gets Generated
Thegenerate command processes your configuration and produces files based on:
User Types
TypeScript type definitions are automatically generated for:- TailorDB types and their fields
- Resolver input/output types
- Executor configurations
- Auth service types
Code Generators
Custom generators defined indefineGenerators() run in phases:
- TailorDB Phase - Generators with
tailordbdependency - Resolver Phase - Generators with
resolverdependency - Executor Phase - Generators with
executordependency
- Process individual types/resolvers/executors
- Aggregate results across namespaces
- Write files to disk
Plugin Outputs
Plugins can hook into generation lifecycle:onTailorDBReady- Runs after TailorDB types are loadedonResolverReady- Runs after resolvers are loadedonExecutorReady- Runs after executors are loaded
Generation Pipeline
The generation process follows this order:- Load configuration from
tailor.config.ts - Generate user types for TailorDB, Auth, and other services
- Load TailorDB types (including plugin-generated types)
- Run TailorDB-only generators and
onTailorDBReadyhooks - Load Resolvers (can import generated files)
- Run non-executor generators and
onResolverReadyhooks - Load Executors (can import generated files)
- Run executor-dependent generators and
onExecutorReadyhooks
Generated files are written to
.tailor/dist/generated/ by default. Each generator or plugin creates files in its own subdirectory.Watch Mode Behavior
When running with--watch:
- Monitors configuration file and all service files (TailorDB, Resolver, Executor)
- Automatically reruns generation when changes are detected
- Restarts the process to clear module cache when config changes
- Suppresses errors in watch mode to prevent crashes