Getting Started
This guide will help you get started with AI Assistant for Craft CMS.
Installation
- Require the package:
composer require solspace/craft-aiassistant - In Craft CP → Plugins, install "AI Assistant"
- Configure providers in AI Assistant → Integrations
- Enable fields in AI Assistant → Settings
Configuration
Setting Up Integrations
- Go to AI Assistant → Integrations
- Click New Integration
- Choose provider (OpenAI, Gemini, Anthropic, xAI, Replicate), set API key, model, and defaults
- Save and test
Enabling Fields
- Go to AI Assistant → Settings
- Toggle which fields show the inline AI button
- Save
Configuring Prompts
- Go to AI Assistant → Prompts
- Create custom prompts or view built-in prompts
- Optionally bind a prompt to a specific integration
Field-Specific Prompts
You can preselect a prompt for each enabled field so the Generate modal opens with the right context:
- Go to AI Assistant → Settings
- In the "Field Prompts" table, choose a prompt per field (or keep "Any")
- Save Settings
Usage
Using the Inline AI Button
- Open any entry with enabled fields; an inline AI button appears inside the input area
- Click the button to open the modal
- Pick a prompt, edit "Prompt Text" as needed
- Optionally enable "Include input context"
- Generate and review in the right column; Insert replaces the field's content
Quick AI Actions Widget
- Add the "AI Assistant Quick Actions" widget on the dashboard
- Select a prompt, edit "Prompt Text," Generate, and Copy as needed
API Endpoints
GET /admin/ai-assistant/api/integrationsGET /admin/ai-assistant/api/promptsPOST /admin/ai-assistant/api/generate-textPOST /admin/ai-assistant/api/generate-image(coming soon)
File Structure
aiassistant/
├── src/
│ ├── assets/ # JS/CSS + AssetBundle
│ ├── controllers/ # CP + API endpoints
│ ├── models/ # Integration, Prompt, Settings
│ ├── records/ # ActiveRecord for DB tables
│ ├── services/ # Business logic + helpers
│ ├── Integrations/ # Providers (OpenAI, Gemini, …)
│ ├── templates/ # Twig (modal, widget, CP screens)
│ ├── AiAssistant.php # Main plugin class
│ ├── icon-mask.svg
│ └── icon.svg
└── composer.json
Support
For issues and feature requests, please contact Solspace.