xddesigners / silverstripe-ai-assistant
CMS AI assistant UI for Silverstripe, powered by xddesigners/silverstripe-ai
Package info
github.com/xddesigners/silverstripe-ai-assistant
Language:JavaScript
Type:silverstripe-vendormodule
pkg:composer/xddesigners/silverstripe-ai-assistant
Requires
README
CMS AI assistant UI for SilverStripe, powered by xddesigners/silverstripe-ai.
Adds an Assistant tab to CMS edit forms, letting editors generate and preview AI-written content for any configured fields — without overwriting the real content until they explicitly accept it.
Requirements
- SilverStripe Framework
^6 - SilverStripe Admin
^3 - xddesigners/silverstripe-ai
^1.0 - PHP
^8.1
Installation
composer require xddesigners/silverstripe-ai-assistant
Run a dev/build after installation:
sake dev/build flush=1
Configuration
The module requires the silverstripe-ai environment variables to be set. Copy .env.example as a starting point:
AI_PLATFORM_TYPE="openai" AI_MODEL="gpt-4o-mini" AI_API_KEY="sk-xxx"
Default setup
Out of the box, the assistant is applied to:
SiteTree— fields:Title,Content,MetaDescriptionDNADesign\Elemental\Models\ElementContent— fields:Title,HTML
Applying the assistant to your own DataObjects
Add AIAssistantExtension to any DataObject and list the database fields you want included:
App\Models\MyDataObject: extensions: - XD\SilverstripeAIAssistant\Extensions\AIAssistantExtension ai_assisted_fields: - Title - Summary - MetaDescription
Run dev/build flush=1 after updating the config.
How it works
Once installed, each configured DataObject gets an Assistant tab in its CMS edit form, inserted after the Main tab.
The tab contains:
- AI prompt — a textarea where the editor provides instructions (e.g. "Improve for SEO while keeping the same tone of voice").
- Generate content button — sends the current field values as context to the
/ai/generateendpoint and populates preview copies of the configured fields with the AI response. - AI-assisted fields — read-only previews of the AI-generated content. TinyMCE (HTML) fields are fully supported.
- Accept AI Content button — copies the previewed AI content into the real CMS fields. A confirmation dialog is shown before any values are overwritten.
Saving the record is always a separate, explicit action — accepting the AI content only updates the live form fields.
Customising the default AI instructions
The default system instruction ("You are a helpful assistant and SEO expert.") can be changed in YAML:
XD\SilverstripeAI\Services\AIClient: default_instructions: 'You are an expert copywriter for a sustainable fashion brand.'
Editors can also override instructions per-generation using the AI prompt textarea in the CMS.
License
BSD-3-Clause © XD Designers