AI-Powered Drupal Site Management via Drush
Drush Webmaster provides a comprehensive suite of Drush commands (
wm:*) designed for AI-assisted Drupal site management. Query, create, edit, and inspect entities, content types, views, menus, vocabularies, blocks, media, translations, and moderation workflows -- all through structured YAML output optimized for AI agents and human operators alike.
You need Drush Webmaster if
- You use AI coding assistants (Claude Code, Cursor, Copilot) and want them to manage your Drupal site
- You need structured, machine-readable output from Drush commands for automation pipelines
- You want a safe edit/apply workflow with dry-run validation and versioned YAML history
- You manage content across multiple languages and need translation management via CLI
- You want powerful entity querying with field conditions, sorting, and pagination without a search index
Features
-
Site Schema Discovery
Dump the full site schema (content types, views, vocabularies, menus, blocks, media types, entity types) in a single command. Provides complete AI context for understanding an unfamiliar Drupal site.
-
Entity Management
Query entities with field conditions and operators (=, !=, >, <, IN, NULL), get/set individual field values, clone entities (with or without references), compare entities with diff, and track YAML version history with revert support.
-
YAML Edit/Apply Workflow
Export any entity or view to a versioned YAML file, modify it, then apply with built-in validation. Supports
--dry-runfor previewing changes before saving. Templates for new entities pre-fill all available fields. -
Bulk Operations
Create, update, or delete multiple entities in a single operation using YAML input.
-
Views Management
List, create, clone, edit, preview, enable/disable, and delete views. Discovery helpers list available fields, filters, sorts, arguments, relationships, and areas for any base table.
-
Content Type & Field Management
Create, update, and delete content types. Add, update, and remove fields from bundles. List available field types and inspect field configurations.
-
Menu Management
Create menus, add/update/delete menu links with full hierarchy support.
-
Translation Management
List configured languages, view entity translations, add or update translations with JSON field values, and delete translations. Requires Drupal's Language and Content Translation modules.
-
Content Moderation
View current moderation state and available transitions, then move entities through workflow states (draft, review, published, archived). Requires Drupal's Content Moderation module.
-
Full-Text Search
Search across all indexed content and return results with title, URL, and snippet. Use alongside
wm:entity:queryfor field-level precision orwm:searchfor keyword discovery. -
Entity Cloning & Comparison
Clone entities with
wm:entity:cloneor deep-clone with all referenced entities viawm:entity:deep-clone. Compare any two entities side-by-side withwm:entity:diff. -
Version History & Revert
Every edit creates a versioned YAML file. Browse previous versions with
wm:entity:historyand restore any prior state withwm:entity:revert. -
Site Memory (Learnings)
AI assistants can save site-specific knowledge (field conventions, content type names, gotchas) that persists across sessions. Each session starts with the AI already knowing this site's quirks, reducing repeated discovery and errors. Works on all supported platforms via bundled scripts.
Command Reference
| Category | Commands | Description |
|---|---|---|
| Discovery | wm:schema:dump, wm:schema:sections, wm:site:info |
Full site schema dump with section filtering, site metadata |
| Entity Query | wm:entity:query, wm:entity:list, wm:search |
Field-condition queries with operators, sorting, pagination, full-text search |
| Entity CRUD | wm:entity:get, wm:entity:new, wm:entity:edit, wm:entity:apply |
Get, create, and edit entities via YAML export/apply workflow |
| Entity Fields | wm:entity:field:get, wm:entity:field:set, wm:entity:fields |
Get/set individual field values, list fields on a bundle |
| Entity Operations | wm:entity:clone, wm:entity:deep-clone, wm:entity:diff, wm:entity:history, wm:entity:revert |
Clone, compare, version history, and revert entities |
| Bulk | wm:entity:bulk-create, wm:entity:bulk-update, wm:entity:bulk-delete |
Batch entity operations via YAML input |
| Content Types | wm:content-type:list, wm:content-type:get, wm:content-type:create, wm:content-type:update, wm:content-type:delete, wm:content-type:stats |
Full content type lifecycle management |
| Fields | wm:field:list, wm:field:get, wm:field:add, wm:field:update, wm:field:delete, wm:field:types |
Field management on entity bundles |
| Views | wm:view:list, wm:view:get, wm:view:create, wm:view:clone, wm:view:edit, wm:view:apply, wm:view:preview, wm:view:delete, wm:view:enable, wm:view:disable |
Full views lifecycle with YAML edit/apply workflow |
| View Discovery | wm:view:tables, wm:view:available:fields, wm:view:available:filters, wm:view:available:sorts, wm:view:available:arguments, wm:view:available:relationships, wm:view:available:areas |
Discover available base tables, fields, filters, sorts, and relationships for building views |
| Menus | wm:menu:list, wm:menu:get, wm:menu:create, wm:menu:delete, wm:menu:link:list, wm:menu:link:add, wm:menu:link:update, wm:menu:link:delete |
Menu and menu link management with hierarchy |
| Vocabularies | wm:vocabulary:list, wm:vocabulary:get, wm:vocabulary:create, wm:vocabulary:update, wm:vocabulary:delete |
Taxonomy vocabulary management |
| Blocks | wm:block:list, wm:block:get, wm:block:place, wm:block:update, wm:block:remove, wm:block:types |
Block placement and management by region |
| Media | wm:media-type:list, wm:media-type:get, wm:media:create, wm:media:list, wm:media:attach |
Media type inspection, entity creation (from file, URL, or base64), listing, and attachment to content |
| Translation | wm:translation:languages, wm:entity:translations, wm:entity:translation:get, wm:entity:translation:set, wm:entity:translation:delete |
Multilingual content management |
| Moderation | wm:entity:transitions, wm:entity:moderate |
Content moderation workflow transitions |
Post-Installation
- Install with Composer:
composer require drupal/drush_webmaster - Enable the module:
drush en drush_webmaster - Set up AI integration:
drush wm:setup-ai— copies the Claude Code skill files to your project root so AI assistants can automatically discover and usewm:*commands. This step is required for Claude Code, Cursor, and other SKILL.md-compatible AI tools to work with Drush Webmaster. - Verify installation:
drush wm:schema:dump --section=site - Run
drush wm:[command] --helpon any command for full documentation
Sub-modules
- Drush Webmaster Webform -- Extends
wm:*commands with Webform support for managing forms and submissions via Drush - Drush Webmaster Redirect -- Extends
wm:*commands with Redirect module support for managing URL redirects via Drush
Key Workflow Pattern
Default to Discover → Inspect → Modify. Always run the appropriate discovery command before any write operation.
- Discover --
wm:schema:dump,wm:content-type:get,wm:entity:query,wm:search - Inspect --
wm:entity:get,wm:view:get,wm:field:list,wm:entity:transitions - Edit --
wm:entity:edit→ modify YAML →wm:entity:apply --dry-run→wm:entity:apply - Create --
wm:entity:new→ fill template →wm:entity:apply node new
Pre-flight Discovery Checks
| Operation | Run first |
|---|---|
| Create entity | wm:content-type:get [bundle] — see required fields and types |
| Edit entity fields | wm:entity:get [type] [id] — see current field values |
| Delete entity | wm:entity:get [type] [id] — confirm correct entity before deletion |
| Add field to bundle | wm:field:list then wm:field:types — see existing fields and available types |
| Create/edit view | wm:view:tables then wm:view:available:fields — see available fields, filters, sorts |
| Translate entity | wm:translation:languages — see configured languages |
| Moderate entity | wm:entity:transitions — see valid state transitions |
| Bulk operations | wm:content-type:get [bundle] or wm:entity:query — verify scope before batch operations |
AI Coding Assistant Integration
Drush Webmaster is designed from the ground up for AI-assisted site management. It implements the Agent Skills open standard, making it compatible with all major AI coding assistants:
- Claude Code (Anthropic)
- Codex CLI (OpenAI)
- Gemini CLI (Google)
- GitHub Copilot / VS Code
- Cursor
And other tools that support the Agent Skills standard (Kiro, Junie, Factory Droid, etc.).
What is a SKILL.md?
A SKILL.md is a standard file format that teaches AI coding assistants how to use a tool. It describes available commands, when to use them, and how they work. AI tools discover skill files automatically and invoke them when your request matches. The standard is maintained at agentskills.io.
Setup
After installing the module, run drush wm:setup-ai to enable AI coding assistant support. This copies skill files to your project root so all supported AI tools can discover them automatically.
Your AI assistant will then respond to natural language like:
- "List all content types on this site"
- "Find articles published last week"
- "Create a new page with this content"
- "Add a date field to the event content type"
- "Build a view showing recent blog posts"
- "Translate node 42 to French"
- "Publish the draft at node 15"
Your First 5 Minutes
- Run
drush wm:setup-aito install the skill - Open your AI tool in the project directory
- Ask: "What content types does this site have?"
- Ask: "Show me the fields on the article content type"
- Ask: "Find the 5 most recent articles"
- Ask: "Create a new page called About Us with some placeholder content"
The AI will automatically use wm:* commands for all of these.
Skill Features
- Progressive disclosure — slim core SKILL.md (~170 lines) with 13 comprehensive reference files loaded on demand per domain, keeping AI context focused
- Automatic site context discovery — detects content types, enabled modules, and configured languages on every invocation (all platforms)
- Discover-before-modify workflow — pre-flight checks ensure the right discovery command runs before any write operation
- Site learnings persistence — remembers site-specific conventions and gotchas across sessions via bundled scripts (all platforms)
- Cross-platform parity — identical SKILL.md at both
.claude/skills/and.agents/skills/, same features everywhere - Codex metadata —
agents/openai.yamlfor automatic Codex CLI discovery
Troubleshooting
- AI tool doesn't use wm:* commands? Run
drush wm:setup-ai— the skill files may not be at the project root yet. - "Command wm:schema:dump not found"? The module isn't enabled. Run
drush en drush_webmasteranddrush cr. - DDEV/Lando and the AI runs
drushinstead ofddev drush? Tell your AI to use the wrapper command, or set it in the conversation context. - Skill works in Claude Code but not Codex/Gemini/Cursor? Run
drush wm:setup-ai --host=agentsto install the skill at.agents/skills/. - AI says "permission denied" or gets empty output? Make sure the Drupal site is bootstrapped and the database is accessible from where drush runs.
- Skill file outdated after module update? Run
drush wm:setup-aiagain — it overwrites with the latest version. - Claude Code has the skill but answers directly instead of using wm:* commands? Your project's CLAUDE.md may be missing routing rules. Run
drush wm:setup-ai— it adds a## Skill routingsection to CLAUDE.md. - Drush runs inside Docker/DDEV but AI runs on the host? The AI tool must be able to execute
drush(orddev drush). Tell your AI to use the wrapper command.
How Drush Webmaster Compares
Drupal has a growing ecosystem of AI integration projects. Here's how Drush Webmaster fits in:
| Drush Webmaster | MCP Tools | AI Agents | Agentic Skills | |
|---|---|---|---|---|
| What it does | CLI commands for AI-assisted site management | MCP server exposing 223 Drupal tools | LLM-powered agents inside Drupal | SKILL.md files for Drupal development practices |
| Integration | Agent Skills (SKILL.md) | MCP protocol | Drupal AI module + LLM API | Agent Skills (SKILL.md) |
| Works with | Claude Code, Codex, Gemini, Copilot, Cursor, Kiro, Junie | Claude Desktop, Cursor, Windsurf | Drupal chatbot UI, Drush | Claude Code, Codex, Gemini, Copilot, Cursor |
| LLM API keys needed on server? | No | No | Yes (per-call cost) | No |
| Server process required? | No — skill files only | Yes — MCP server | No — runs inside Drupal | No — skill files only |
| Scope | Content types, fields, entities, views, menus, blocks, media, vocabularies, webforms, redirects, translations, moderation | Content types, fields, views, blocks, Layout Builder, config, roles, permissions, image styles | Content types, fields, taxonomies | Coding standards, testing, security, documentation |
| PHP requirement | 8.1+ | 8.3+ | 8.1+ | N/A |
| Dry-run support | Yes — all write operations | No | No | N/A |
| Command restrictions | None — full access, use --dry-run to preview |
None | Drupal permissions | N/A |
| Production use | Yes — for experienced users | Local dev only | Yes | Yes |
| Setup | drush wm:setup-ai |
MCP client configuration | AI module + provider config | npx skills add |
Complementary projects
These projects serve different purposes and work well alongside Drush Webmaster:
- Agentic Skills — Teaches AI agents Drupal development best practices (coding standards, testing, security). Drush Webmaster teaches them site management. Use both together.
- Surge — AI coding starter kit that aggregates Agent Skills from multiple sources. Could distribute Drush Webmaster's skill alongside development skills.
- Drupal MCP — Turns Drupal into an MCP server for bidirectional AI communication. Different protocol, complementary capabilities.
- AGENTS.md — Provides AI-readable project context for Drupal development patterns. Proposed for Drupal core.
FAQ
- Is Drush Webmaster safe to use in production?
-
Yes, for experienced Drupal administrators. Every write operation supports
--dry-runto preview changes before applying. The module also maintains a YAML version history for every entity edit, so you can revert to any prior state. That said, AI agents have full creative and destructive power over your site; use caution and review dry-run output before confirming write operations. - Does Drush Webmaster require an AI subscription or API keys?
-
No. Drush Webmaster is a set of Drush commands; it does not call any AI API. The AI integration works through SKILL.md files that teach your AI coding assistant (Claude Code, Codex, Cursor, etc.) how to use the
wm:*commands. The AI runs on your coding tool's side, not on the Drupal server. - Which AI coding assistants does Drush Webmaster support?
-
Any tool that supports the Agent Skills standard: Claude Code, Codex CLI, Gemini CLI, GitHub Copilot, Cursor, Kiro, Junie, and Factory Droid, among others. Run
drush wm:setup-aito install the skill files for automatic discovery. - How does the YAML edit/apply workflow work?
-
Export any entity to a versioned YAML file with
wm:entity:edit, modify the file, then apply withwm:entity:apply. Use--dry-runto preview what will change before saving. For new entities,wm:entity:newgenerates a template pre-filled with all available fields. The same workflow applies to Views. - Can Drush Webmaster manage translations?
-
Yes. The translation commands let you list configured languages, view existing translations, add or update translations with JSON field values, and delete translations. Requires Drupal's Language and Content Translation modules to be enabled.
- How does Drush Webmaster differ from MCP Tools?
-
Drush Webmaster uses the Agent Skills standard (SKILL.md files) and runs through Drush; no server process is needed. MCP Tools uses the MCP protocol and requires a running MCP server. Drush Webmaster supports dry-run on all write operations and works in production; MCP Tools is designed for local development. They serve different workflows and can be used alongside each other.
Requirements
- Drupal 10.3+ or 11
- PHP 8.1+
- Drush 12+ or 13+
- Optional: Language + Content Translation modules (for translation commands)
- Optional: Content Moderation module (for moderation commands)
- Optional: Search module with indexed content (for
wm:search)
Prefer a turnkey demo site?
Spin up DXPR CMS -- Drupal pre-configured with DXPR Builder, DXPR Theme, AI modules, and Drush Webmaster included.
Project information
- Project categories: Administration tools, Artificial Intelligence (AI), Developer tools
75 sites report using this module
- Created by jurriaanroelofs on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
First stable release: media create, list and attach commands with file, URL and base64 sources; setup-ai installs skill reference docs
