Kirby Copilot supports generating content for Kirby's blocks and layout fields, including both built-in and custom block types. This makes it a true page builder for Kirby CMS.
It accomplishes this by using object generation with JSON schemas, which enables the AI to generate structured data that matches the block definitions in your project.
excludedBlocks configuration option. This allows you to fine-tune which blocks Copilot should generate content for.Copilot discovers all available blocks from Kirby's built-in types, blocks registered by plugins, and custom blocks defined in site/blueprints/blocks/. If the field's fieldsets option limits the available blocks, only those will be considered for generation.
For each block type, Copilot reads the block's field definitions and generates a schema with appropriate constraints. All block schemas are then combined into a union type. For layouts, additional column structure with width constraints is added to the schema.
The schema is sent to the AI provider along with your prompt. The JSON schema format enforces the model to respond with structured data that matches your block definitions.
The AI streams structured data back in real-time. You'll see blocks and content appear progressively in the Panel as they're generated.
Each generated block and layout is normalized before insertion. This includes assigning unique IDs (required by Kirby's block editor) and applying default values like column widths. Generated content is appended to existing field content, not replaced.
Depending on the block's complexity, the resulting JSON schema can become equally complex. This leads to the following caveats:
fieldsets or simplify the block definitions.layout field generation is only supported by models other than OpenAI. Gemini models are recommended for this feature.