# mageprince/magento2-mage-ai

> Magento 2 Content Generator Extension

`composer require mageprince/magento2-mage-ai`

Canonical URL: https://packagento.com/mageprince/magento2-mage-ai

## At a glance

- **Vendor**: mageprince (https://packagento.com/mageprince.md)
- **Latest version**: 1.1.1 — released 2026-06-10
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/mageprince/magento2-mage-ai and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require mageprince/magento2-mage-ai:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Magento 2 Content Generator Extension

## README

This Magento 2 extension integrates **OpenAI (GPT)**, **Anthropic (Claude)**, and **Google Gemini** to automatically generate high-quality short and long product descriptions, **AI-generated product images**, and **AI image editing of existing product photos** — based on product attributes like name, features, material, and more. It's a powerful tool to save time and improve content quality across your catalog.

❤️ The goal of this extension is to remain fully open-source and continuously expand by integrating every possible way to use AI with Magento 2. From writing content to helping customers, improving SEO, or automating tasks — the idea is to make Magento and AI work great together. I'm building it to be flexible and helpful for everyone, and I'd love for others to join in. If you're into Magento or AI, your ideas and contributions are always welcome. Let's create something awesome together!

### Features
- **Multi-provider AI support** — switch between OpenAI (GPT), Anthropic (Claude), and Google Gemini from a single config screen
- **AI product image generation** — generate a product image from a prompt (or a configurable default) right from the Images And Videos section, added straight to the gallery (OpenAI & Gemini)
- **AI product image editing** — pick any existing product image, describe the change in a prompt (or use a configurable default), preview the edited result side-by-side with the original, and replace it in the gallery on confirm (OpenAI & Gemini)
- **Global baseline prompt** — set brand voice, language, compliance and SEO rules once and have them automatically applied to every text generation (full, short, and custom prompts) across all providers
- Generate product descriptions using a **custom free-form prompt** for full control and flexibility
- Customize prompt templates using `{{ product.name }}` and `{{ product.attributes }}` variables
- Select **multiple product attributes** to base generation on (name, material, features, etc.)
- Configure **max tokens** and **temperature** separately for full and short descriptions
- Works on both **existing** and **unsaved (new) products**
- Supports OpenAI chat and completion endpoints (`gpt-4o`, `gpt-4-turbo`, `gpt-4o-mini`, `gpt-3.5-turbo`, etc.)
- Supports Anthropic Messages API (`claude-opus-4-5`, `claude-sonnet-4-6`, `claude-haiku-4-5`, etc.)
- Supports Google Gemini API (`gemini-2.5-flash`, `gemini-2.5-pro`, etc.)
- Clean, valid HTML output ready to use in the WYSIWYG editor
- Compatible with Page Builder

### Supported AI Providers

| Provider | Models |
|---|---|
| **Google Gemini** *(default)* | `gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-1.5-flash`, `gemini-1.5-pro` |
| **OpenAI (ChatGPT)** | `gpt-4o`, `gpt-4o-mini`, `gpt-4-turbo`, `gpt-4`, `gpt-3.5-turbo` |
| **Anthropic (Claude)** | `claude-opus-4-5`, `claude-sonnet-4-6`, `claude-haiku-4-5` |

### Usage

#### Setup
1. Go to `Stores > Configuration > Mageprince > MageAI`
2. Choose your preferred AI **Provider** (Gemini, OpenAI, or Anthropic)
3. Enter the **API key** for the selected provider
4. Select the **model** and tune **max tokens** / **temperature** as needed
5. Configure the **image generation** and **image editing** prompts/models if you plan to use the image features
6. Save the configuration

> All features below work on both **new (unsaved)** and **existing** products. Remember to save the product to persist generated content and images.

#### Generate Descriptions
1. Open any product and locate the Short or Long Description editor
2. Click **"Generate with MageAI"**
3. The AI generates polished, HTML-ready content based on the product name and the attributes you selected in config
4. Review and save the product

#### Custom Prompt (Descriptions)
Click **"Advanced Generate with MageAI"** to open the custom prompt modal and type any free-form instruction — the module skips attribute lookup and sends your prompt directly to the AI.

#### Generate Product Image
Click **"Generate Image with MageAI"** next to the **Add Video** button in the Images And Videos section. Enter a prompt (or leave it empty to use the default configured prompt) and the generated image is added straight to the product gallery. Available with the **OpenAI** and **Gemini** providers.

#### Edit Product Image
Click **"Edit Image with MageAI"** (next to the generate button) to open a popup listing the product's current images. Click **"Edit with MageAI"** under any image, describe the change in a prompt (or leave it empty to use the default configured modify prompt), and the AI returns an edited version shown side-by-side with the original. Click **Confirm & Replace** to swap the original image with the edited one — its base/role, position, and visibility are preserved, and the change is saved with the product. Available with the **OpenAI** and **Gemini** providers.

#### Prompt Templates
Description and image prompts support two variables:
- `{{ product.name }}` — the product's name
- `{{ product.attributes }}` — a comma-separated `Label: Value` string from the attributes you selected in config (descriptions and image prompts have independent attribute selections)

### How to Install
#### Install via Composer

Run the following commands in your Magento 2 root folder:

```bash
composer require mageprince/magento2-mage-ai
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
```

### Contribution
Contributions are highly welcome and encouraged! 🙌

This project is a personal open-source effort to bring the power of AI to Magento 2. Whether you want to:
- Add new features
- Improve prompts or logic
- Fix bugs
- Help with translations or documentation
- Or just share feedback…

You're very welcome to join in.

_(README truncated for .md surface. Full README on https://packagento.com/mageprince/magento2-mage-ai.)_

## Recent Versions

| Version | Released |
|---|---|
| 1.1.1 | 2026-06-10 |
| 1.1.0 | 2026-06-09 |
| 1.0.3 | 2026-06-04 |
| 1.0.2 | 2026-06-02 |
| 1.0.1 | 2025-05-05 |
| 1.0.0 | 2025-04-07 |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["mageprince/magento2-mage-ai"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

mageprince is a Magento 2 vendor on Packagento. See https://packagento.com/mageprince.md for their full catalogue.

