Download the PHP package muench-dev/statamic-ai-writer without Composer

On this page you can find all versions of the php package muench-dev/statamic-ai-writer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package statamic-ai-writer

Statamic AI Writer

Statamic 6 Latest Version License

AI-powered writing assistant for Statamic: modify, shorten, expand, rephrase, translate, summarize, classify content, and generate post titles directly within the text editor.

Statamic AI Writer integrates seamlessly with your editor experience (Bard, Markdown, and text areas). Select or mark any text to refine it with AI, generate executive summaries, translate sections (and optionally post titles), or receive automated taxonomy recommendations.


Features


Installation

AI Writer v2.0.0 requires Statamic 6 and PHP 8.3 or newer. Statamic 5 is no longer supported. Composer availability follows publication of the v2.0.0 Git tag.

Install the addon via Composer:

Publish the assets and configuration file:

Control Panel languages

The assistant, editor buttons, notifications, permissions, and alt-text actions support English (en) and German (de), following the current Control Panel language. The assistant's script translations explicitly use the CP locale so Statamic's English fallback loading does not switch its labels to English. This is independent of the content translation target and the configured alt-text languages. English is the fallback for untranslated interface strings; AI-generated content and external provider error details are not translated by the interface.

After updating or locally rebuilding the addon JavaScript, republish the assets with php artisan vendor:publish --tag="statamic-ai-writer" --force and reload the Control Panel. The CP serves the published files in public/vendor/statamic-ai-writer/, not the package's dist/ files directly.

Translations live in the package's root lang/{locale}/messages.php directory and use Statamic's standard statamic-ai-writer::messages namespace. To customize them, publish the language files and edit lang/vendor/statamic-ai-writer/{locale}/messages.php:


Configuration

Add your API credentials to your application's .env file:

The assistant shows setup guidance until an API key is configured. After changing cached configuration, run php artisan config:clear. For non-super users, grant Use AI Writer to their role in the Control Panel. All assistant endpoints enforce this permission. Asset alt-text generation also requires edit permission for the asset's container; view-only access is insufficient. Taxonomy context is limited to configured taxonomies the user can view.

Editor integrations read server-provided permissions before Statamic initializes its JavaScript configuration, so authorized users see the assistant on the first Control Panel load. Settings are fetched after Statamic boots its HTTP client. After updating the addon, republish its assets and reload the Control Panel.

External requests and costs

AI Writer sends the selected text, instructions, and relevant existing taxonomy terms to the configured provider. Title generation sends the available post content and current title. Translation can also send the post title. Alt-text generation sends the image's full contents as a base64-encoded image, once per language requiring a description. The image_detail option affects provider processing, not the amount of image data uploaded. Review your provider's data-retention and privacy terms before using private content or images. Provider credentials and any usage fees are supplied and paid by the site owner; no AI service subscription is included with this add-on. Image generation requires a vision-capable model and endpoint.

Compatible Providers

Because AI Writer supports any OpenAI-compatible endpoint, you can easily point it to alternative providers:

Opper AI

OpenRouter

Local Ollama

Advanced Settings

You can customize defaults in config/statamic-ai-writer.php:

classification.max_tags and max_categories cap the returned suggestions. classification.taxonomies is an allowlist of handles used for existing-term context and the settings response; an empty array disables existing-term context. These options do not automatically apply suggestions or create terms.


How to Use

1. In Bard Editor

The assistant moves keyboard focus into the dialog, keeps Tab and Shift+Tab inside it, and closes with Escape or Cancel. Closing restores focus to the control that opened it. Responses from a closed or replaced session are ignored, and result actions wrap into a compact layout on small screens.

2. In Markdown / Text Fields

3. Translating Content & Post Titles

4. Categorizing & Tagging


5. Generating Post Titles

6. Generating Image Alt Text

In Assets, select one or more raster images and choose Generate AI Alt Text. Existing non-empty alt fields are skipped unless Overwrite existing alt text is enabled. SVGs and non-images are excluded. The action requires Use AI Writer and edit access to each asset. Setting alt_text.enabled to false disables the asset action and upload generation.

Configure automatic upload generation and the vision model in .env:

Upload generation is opt-in. When enabled, authenticated uploaders must have the same AI and asset-edit permissions. Server-side uploads without a logged-in user use the site-wide automation setting. Images are sent to the provider, including automatically on upload when this option is enabled.

The alt_text section of config/statamic-ai-writer.php controls the model, image detail, output token limit, queue name, default language, and optional field_mapping. By default, a site with one unique language writes alt; multiple site languages write alt_{lang}, such as alt_en and alt_de, using Statamic's site language codes. Add these text fields to the asset container's blueprint and use the matching field in your templates; the add-on does not create blueprint fields or switch template output for you. Existing fields are preserved unless overwrite is explicitly requested.

To use different field names, configure a language-to-field mapping:

With QUEUE_CONNECTION=sync, generation runs immediately and reports generated, skipped, and failed alt-field counts. Missing credentials, provider failures, and cancelled asset saves are reported as errors, including partial failures. Fields count as generated only after the asset save succeeds. With an asynchronous queue, the action only confirms that work was queued; it does not claim generation succeeded. Run a worker for the configured queue, for example php artisan queue:work --queue=default, and inspect application logs and php artisan queue:failed for failures. Successful language fields are saved even if another language fails; retrying without overwrite skips those already generated.

Upgrading to v2.0.0

This is a breaking compatibility update: upgrade your site to Statamic 6 and PHP 8.3+ before installing AI Writer v2. Once v2.0.0 is published, update with composer require muench-dev/statamic-ai-writer:^2.0 --with-all-dependencies.

Statamic 5 sites can remain on the older v1 releases for compatibility, but v1.2.0 predates the authorization and failure-reporting fixes listed in the changelog. These fixes are not backported to v1.

Review role permissions: users who previously used the assistant implicitly now need Use AI Writer. All configuration is read from statamic-ai-writer; move any custom settings previously placed in config/ai-writer.php into config/statamic-ai-writer.php. The unused bundled ai-writer.php config has been removed. Keep your existing published configuration and merge any missing defaults rather than overwriting it. Republish the updated assets with php artisan vendor:publish --tag="statamic-ai-writer" --force and clear cached configuration.

Testing

GitHub Actions runs strict Composer validation, PHP syntax checks, and the PHP test suite on PHP 8.3 and 8.4 for pull requests, pushes to main, and v* release tags. The workflow can also be started manually.

Run tests inside the addon directory:

Or using PHPUnit:

Run the frontend checks with npm test, and rebuild the distributed assets with npm run build after changing JavaScript or CSS. npm run verify runs Composer validation plus both test suites. The package's development setup uses Testbench 10 and PHPUnit 12; run these commands with PHP 8.3+ in the DDEV container.

Releasing

Releases use release-it, not npm publishing. Composer derives the package version from Git tags. package.json records the current or prepared release version for the asset/release tooling and stays synchronized with package-lock.json.

Install the release tools with npm ci using a supported Node version (Node 24.15+ is supported). Keep curated notes under ## [Unreleased] in CHANGELOG.md. Build and commit the distributed assets before releasing. Release-it requires a clean main branch with an upstream, runs the build and validation checks, bumps the package/lock versions, dates the changelog, creates a vX.Y.Z tag, pushes the release commit/tag, and creates a GitHub release from the changelog notes. It never publishes to npm.

The breaking v2.0.0 update already has finalized changelog notes and version metadata. Publish that prepared version without incrementing it again:

Run these inside the DDEV container, from the add-on directory. Supply GITHUB_TOKEN to the container environment with permission to create releases, and ensure Git push authentication is available there. A dry run previews release actions without writing versions, creating commits/tags, pushing, or publishing; run npm run verify separately because dry runs preview validation hooks too.

The configuration sets increment: false, so both bare release-it and npm run release use the prepared version's dated changelog section. For subsequent releases, add notes under Unreleased and use npm run release:next -- patch, minor, or major (or release-it patch, minor, or major) as appropriate; an explicit increment overrides the default, and release-it will increment metadata and finalize those notes automatically. Use the prepared-version command only when both the target version and its dated changelog section have already been prepared.

After release, verify that Packagist sees the new tag, install that version in an isolated Statamic 6 site, and resubmit the tagged release to the Statamic Marketplace. See AGENTS.md for the complete maintainer workflow.

Support

Community support and bug reports are available through GitHub Issues. Include your Statamic/PHP versions, queue driver, and reproduction steps; exclude API keys and private content.

Changelog

See CHANGELOG.md for release history and unreleased changes.


License

The MIT License (MIT). Please see License File for more information.

Inline icons are adapted from Lucide (ISC), including icons derived from Feather (MIT). Their copyright and permission notices are included in LICENSE.

Marketplace artwork

The original Marketplace icon is included as an editable 1024 × 1024 PNG for uploads. It uses a fountain-pen nib, an AI sparkle, and writing lines, has no external fonts or images, and is covered by this package's MIT license. This artwork is separate from the inline UI icons credited above.


All versions of statamic-ai-writer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
statamic/cms Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package muench-dev/statamic-ai-writer contains the following files

Loading the files please wait ...