PHPackages                             el-schneider/statamic-magic-actions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. el-schneider/statamic-magic-actions

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

el-schneider/statamic-magic-actions
===================================

AI-powered bulk actions and field generation for Statamic

v0.2.1(4mo ago)1421[6 issues](https://github.com/el-schneider/statamic-magic-actions/issues)[6 PRs](https://github.com/el-schneider/statamic-magic-actions/pulls)MITPHPCI passing

Since Dec 8Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/el-schneider/statamic-magic-actions)[ Packagist](https://packagist.org/packages/el-schneider/statamic-magic-actions)[ Docs](https://github.com/el-schneider/statamic-magic-actions)[ Fund](https://www.buymeacoffee.com/el.schneider)[ RSS](/packages/el-schneider-statamic-magic-actions/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (16)Versions (21)Used By (0)

[![Magic Actions](images/ma_banner.png)](images/ma_banner.png)

AI-powered field actions for Statamic. Generate alt text, extract tags, create teasers, transcribe audio, and more — directly from the control panel.

Features
--------

[](#features)

- **Zero-friction workflow**: One-click AI actions integrated directly into field UI
- **Multiple AI providers**: OpenAI, Anthropic, Gemini, and Mistral via [Prism PHP](https://prismphp.dev/)
- **Background processing**: Jobs run asynchronously with status tracking
- **Bulk actions**: Run actions on multiple entries/assets from listing views
- **CLI command**: `php please magic:run` for batch processing with dry-run support
- **9 built-in actions**: Alt text, captions, titles, meta descriptions, teasers, tags, transcription
- **Extensible**: Create custom actions — just extend `BaseMagicAction`

Installation
------------

[](#installation)

```
composer require el-schneider/statamic-magic-actions
```

Configuration
-------------

[](#configuration)

Add your API keys to `.env`:

```
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=...
MISTRAL_API_KEY=...
```

Only add keys for the providers you plan to use.

Optionally publish the config:

```
php artisan vendor:publish --tag=statamic-magic-actions-config
```

Built-in Actions
----------------

[](#built-in-actions)

### Propose Title

[](#propose-title)

Generate SEO-friendly titles from entry content.

[![Propose Title](images/actions/readme-propose-title.gif)](images/actions/readme-propose-title.gif)

### Extract Meta Description

[](#extract-meta-description)

Generate SEO-optimized descriptions (max 160 characters) from entry content.

[![Extract Meta Description](images/actions/readme-meta-description.gif)](images/actions/readme-meta-description.gif)

### Extract Tags

[](#extract-tags)

Auto-generate taxonomy tags from entry content.

[![Extract Tags](images/actions/readme-extract-tags.gif)](images/actions/readme-extract-tags.gif)

### Alt Text

[](#alt-text)

Create accessible image descriptions using vision models.

[![Alt Text](images/actions/readme-alt-text.gif)](images/actions/readme-alt-text.gif)

### Action Reference

[](#action-reference)

ActionDescriptionFieldtypesSourceModel**Propose Title**SEO-friendly titles from contentTextEntry contentText**Extract Meta Description**SEO descriptions (max 160 chars)TextareaEntry contentText**Extract Tags**Auto-generate taxonomy tagsTermsEntry contentText**Alt Text**Accessible image descriptionsTextAsset imageVision**Image Caption**Narrative captions for imagesText, Textarea, BardAsset imageVision**Create Teaser**Preview text (~300 chars) from contentTextarea, BardEntry contentText**Transcribe Audio**Audio-to-text via WhisperTextarea, BardAudio assetAudio**Assign Tags**Match content to existing taxonomy termsTermsEntry content + taxonomyText**Extract Asset Tags**Generate tags from image analysisTermsAsset imageVisionUsage
-----

[](#usage)

### 1. Configure a field in your blueprint

[](#1-configure-a-field-in-your-blueprint)

In the Statamic control panel, edit any supported fieldtype and enable Magic Actions:

- **Enabled**: Toggle on
- **Action**: Choose from available actions (supports multiple per field)
- **Source**: Field containing source content
- **Mode**: Append or Replace

### 2. Click the magic button

[](#2-click-the-magic-button)

A wand icon appears on configured fields. Click it to run the action.

### 3. Bulk actions

[](#3-bulk-actions)

Select entries or assets in listing views — bulk action buttons appear automatically for all actions that declare `supportsBulk()`.

### 4. CLI batch processing

[](#4-cli-batch-processing)

```
# Process all entries in a collection
php please magic:run --collection=pages --field=title --action=propose-title

# Dry run to preview targets
php please magic:run --collection=pages --field=title --action=propose-title --dry-run

# Process a specific entry by ID
php please magic:run --entry=entry-id --field=title --action=propose-title

# Queue jobs instead of running synchronously
php please magic:run --collection=pages --field=title --action=propose-title --queue
```

### 5. Queue processing

[](#5-queue-processing)

For best performance, configure a queue worker:

```
php artisan queue:work
```

> Without a queue worker, jobs run synchronously which may cause timeouts for longer operations.

Custom Actions
--------------

[](#custom-actions)

Create your own magic actions by extending `BaseMagicAction`:

```
