Drupal is a registered trademark of Dries Buytaert

ai_generation

23 sites Security covered
View on drupal.org

Generate Drupal modules, themes, configuration (content types, views, vocabularies, webforms, etc.) and recipes using AI. ⚠️ Development-only, do not use in production.

Features

  • AI-assisted scaffolding for modules and themes (from minimal starters to complex custom implementations).
  • Generates configuration: content types, fields, displays, views, vocabularies, webforms, Search API/Solr, permissions, roles, and other config entities.
  • Generates recipes (drupal-recipe packages) that bundle configuration, module installs, and optional actions.
  • Writes Drupal-ready files so you can enable modules, import config with drush cim, or apply recipes.
  • Includes a Drush command to run prompts from the CLI (drush aigen).

Note: This module is experimental, intended for local development only. Review all generated code before enabling or importing, especially configuration files.

Post-Installation

  1. Configure the AI module first:
    • Install and enable the AI module.
    • Create an API Key using the Key module.
    • Configure your authentication with your AI provider module (e.g., OpenAI).
    • Select your preferred model in the "Chat" feature in AI Settings. Note: Results depend on the chosen model — more powerful models generally produce more accurate code.
  2. Once the AI provider is configured, go to Configuration → AI → AI Generation (/admin/config/ai/ai-generation).
  3. Enter a prompt (e.g., “Create a content type called Event with a date field”).
  4. The module calls your configured AI provider and generates files.
  5. Configuration is written to your config/sync directory → import with drush cim.
  6. Modules and themes are written under modules/custom or themes/custom.
  7. Recipes are written under recipes/{package}.
  8. Alternatively, use drush aigen "{prompt}" from the CLI.
  9. ⚠️ AI makes mistakes: always review the generated code before enabling or importing.

Additional Requirements

  • Drupal Core 10 or 11
  • drupal/ai (AI provider integration)
  • drupal/key (store API keys)
  • An AI provider account (e.g., OpenAI)
  • Drush – recommended for CLI usage.

Similar projects

Related modules include:

  • AI module – provides the base API and connection to AI providers.
  • AI Agents – allows building agents that interact with AI.

What makes AI Generation different?
While AI and AI Agents focus on providing an API and orchestration layer for prompts and agents,
AI Generation not only asks the AI what code or configuration should look like, but also creates the actual files on disk with a simple prompt, ready to be enabled, imported, or applied in your Drupal site.

Supporting this Module

This project is experimental and intended only for local development. Do not use on production sites.
Contributions are welcome! Please open issues, provide feedback, or contribute code/tests.

Community Documentation

Warning: This module is experimental and should never be used on production environments. It is designed exclusively for development and prototyping.

Activity

Total releases
4
First release
Sep 2025
Latest release
5 months ago
Release cadence
4 days
Stability
25% stable

Release Timeline

Releases

Version Type Release date
1.2.0-alpha1 Pre-release Sep 29, 2025
1.1.0-alpha1 Pre-release Sep 24, 2025
1.0.0-alpha1 Pre-release Sep 19, 2025
0.0.1 Stable Sep 17, 2025