netresearch / t3-cowriter
With the help of AI you can now work on a page together with a cowriter - a digital assistant that helps you to write your content.
Package info
github.com/netresearch/t3x-cowriter
Type:typo3-cms-extension
pkg:composer/netresearch/t3-cowriter
Requires
- php: ^8.2 || ^8.3 || ^8.4
- typo3/cms-backend: ^12.4 || ^13.4
- typo3/cms-core: ^12.4 || ^13.4
- typo3/cms-rte-ckeditor: ^12.4 || ^13.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.87
- overtrue/phplint: ^9.5
- phpstan/phpstan: ^1.10 || ^2.0
- phpstan/phpstan-deprecation-rules: ^1.1 || ^2.0
- phpstan/phpstan-strict-rules: ^1.5 || ^2.0
- saschaegerer/phpstan-typo3: ^1.10 || ^2.0
- ssch/typo3-rector: ^2.0 || ^3.0
- typo3/testing-framework: ^7.0 || ^8.0
This package is auto-updated.
Last update: 2026-03-10 07:29:09 UTC
README
AI-powered content assistant for TYPO3 CKEditor - write better content with help from AI.
Features
- Task-based dialog: Select from predefined tasks (Improve, Summarize, Extend, Fix Grammar, Translate) with result preview before inserting
- Vision / Alt Text: Analyze images and generate descriptive alt text via the CKEditor toolbar
- Translation: Translate selected text into 10+ languages directly from the toolbar dropdown
- Prompt Templates: Load reusable prompt presets from the backend for consistent content generation
- Tool Calling: Structured function calling that lets the LLM query TYPO3 content during conversations
- CKEditor Integration: Four toolbar components — main dialog, vision, translation, and templates
- Multi-Provider Support: Works with all LLM providers supported by nr-llm (OpenAI, Claude, Gemini, etc.)
- Secure Backend Proxy: API keys never exposed to frontend — all requests proxied through TYPO3 backend
- Context control: Choose between selected text or full content element as context
- Ad-hoc instructions: Add custom instructions per request (e.g., "Write in formal tone")
- Rate limiting: 20 requests/minute per backend user
- Streaming: Server-Sent Events for real-time completions
- Content sanitization: Frontend DOMParser-based sanitization with CKEditor's HTML processing pipeline
Requirements
- PHP 8.2+
- TYPO3 v13 or v14
- netresearch/nr-llm extension (LLM provider abstraction)
Installation
Install via Composer:
composer require netresearch/t3-cowriter
Configuration
1. Configure nr-llm Extension
First, set up at least one LLM provider in the nr-llm extension:
- Navigate to Admin Tools → LLM Management
- Add a provider (e.g., OpenAI with your API key)
- Create a model configuration
- Create an LLM configuration and set it as default
2. Add CKEditor Preset
Option A: Use the included preset
Add the cowriter preset to your Page TSconfig:
RTE.default.preset = cowriter
Option B: Extend your existing preset
Add to your RTE configuration YAML:
editor: config: importModules: - { module: '@netresearch/t3_cowriter/cowriter', exports: ['Cowriter'] } toolbar: items: - cowriter - cowriterVision - cowriterTranslate - cowriterTemplates
Usage
- Open a content element with a rich text field in the TYPO3 backend
- Optionally select text in CKEditor (or leave empty to use full content)
- Click the Cowriter button in the toolbar
- A dialog opens where you can:
- Select a task (Improve Text, Summarize, Extend, Fix Grammar, Translate to EN/DE)
- Choose context scope — selected text or whole content element
- Add instructions — optional ad-hoc rules like "Write in formal tone"
- Click Execute — the task is sent to the LLM
- Review the result in the preview area
- Click Insert to replace content, or Retry to re-execute
Available tasks
Tasks are managed in the nr-llm extension (tx_nrllm_task table) with category = 'content'. Default tasks:
| Task | Description |
|---|---|
| Improve Text | Enhance readability and quality |
| Summarize | Create a concise summary |
| Extend / Elaborate | Add depth and detail |
| Fix Grammar & Spelling | Correct grammar and spelling |
| Translate to English | Translate to English |
| Translate to German | Translate to German |
Architecture
CKEditor Toolbar
├─ cowriter → [CowriterDialog] → AIService.js → AjaxController
├─ cowriterVision → AIService.js ──────────────→ VisionController
├─ cowriterTranslate→ AIService.js ──────────────→ TranslationController
├─ cowriterTemplates→ AIService.js ──────────────→ TemplateController
└─ (tool calling) → AIService.js ──────────────→ ToolController
↓
[LlmServiceManagerInterface]
↓
[nr-llm Provider]
↓
[External LLM API]
All LLM requests are proxied through the TYPO3 backend. API keys are stored encrypted and never exposed to the browser.
Development
Prerequisites
- DDEV for local development
- PHP 8.2+ with required extensions
Setup
ddev start ddev composer install ddev install-v14
Testing
# Run all quality checks (lint, phpstan, rector, code style) make ci # Run all tests (unit, functional, integration, e2e) make test # Individual test suites make test-unit # Unit tests make test-functional # Functional tests make test-integration # Integration tests make test-e2e # End-to-end tests # Code quality make lint # PHP-CS-Fixer make phpstan # PHPStan level 10
Test Coverage
Target: >80% code coverage
make test-coverage open var/coverage/unit/index.html
Security
- API keys stored in nr-llm with sodium encryption
- All backend AJAX endpoints require TYPO3 authentication
- Frontend DOMParser-based content sanitization via CKEditor's HTML processing pipeline
- TYPO3 backend route authentication with nonce-based URL tokens
- Content Security Policy (CSP) compatible
Migration to v4.x
Version 4.0 requires TYPO3 v13.4+ and PHP 8.2+. It removes the frontend-only architecture and uses the nr-llm extension for provider-agnostic LLM access. API keys are no longer stored in extension settings.
See CHANGELOG.md for migration details.
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Contributing
See CONTRIBUTING.md for contribution guidelines.
Contact
Netresearch DTT GmbH - Your TYPO3 and eCommerce experts.
