A fully functional Sulu skeleton CMS with extended features for running Never Code Alone platform.
# Setup
ddev start && ddev exec composer install
ddev create-db && ddev php bin/console sulu:build dev --no-interaction
# Admin access
open https://sulu-never-code-alone.ddev.site/admin
# Create new admin
ddev php bin/console sulu:security:user:create --no-interaction
# Frontend
ddev launch
# Remove Setup
ddev delete --omit-snapshot# Export
ddev export-db >backup.sql.gz
# Import
ddev import-db --file=backup.sql.gzPHP >= 8.2 Mysql >= 8.0 Composer NPM
composer install --no-dev --optimize-autoloader --no-scripts
bin/console cache:clear
npm install
npm run buildbin/console server:run
## or php builtin server
php -S localhost:8000 -t publicHere is a great read on Symfony CMS Sulu: Roland Golla - YouTube Playlist
Interactive AI chatbot with two knowledge sources: YouTube videos and Sulu CMS website content.
# Index YouTube videos from playlist
ddev exec php bin/console app:video:index [PLAYLIST_ID] --limit 100
# Index Sulu CMS content into ChromaDB
ddev exec php bin/console app:index:sulu-content
# Index with options
ddev exec php bin/console app:index:sulu-content --locale=en
ddev exec php bin/console app:index:sulu-content --all-locales
ddev exec php bin/console app:index:sulu-content --webspace=example --limit=500
# Clear video index
ddev exec php bin/console app:video:clear-index
# Test video search
ddev exec php bin/console app:video:queryThe AI chatbot uses two search tools:
video_search- Searches YouTube videos from Never Code Alonecontent_search- Searches website content from nevercodealone.de
OPENAI_API_KEY=your-api-key-here
CHROMADB_HOST=chromadb
CHROMADB_PORT=8000
CHROMADB_DATABASE=default_databaseThis project includes an AI-powered content generation system that integrates with Sulu CMS to automatically create and manage content using Google's Gemini AI. The system is built as Symfony console commands for proper integration with the framework.
- Three Symfony console commands for different use cases
- Automatic URL analysis to extract relevant information
- German-optimized content for PHP/Symfony developers
- Full Sulu integration with proper block creation
- Activity logging for complete audit trail
- Support for both URL and CMF path inputs
- Proper Symfony dependency injection and error handling
Fast content generation with minimal configuration.
# Basic usage
ddev exec bin/console ai:content:quick "<source-url>" "<prompt>"
# With options
ddev exec bin/console ai:content:quick "https://github.com/symfony/symfony" "Symfony News" \
--page="/cmf/example/contents/blog" \
--position=2 \
--format=seo \
--live
# Dry run (preview only)
ddev exec bin/console ai:content:quick "https://example.com" "Your prompt" --dry-runOptions:
-p, --page=PATH- Sulu page path (default: /cmf/example/contents/blog/quick-ai)--position=N- Insert position (default: 2)-f, --format=FORMAT- Content format: seo|technical|tutorial (default: seo)--headline=TEXT- Custom headline--dry-run- Preview only, do not save--live- Execute immediately without confirmation
Full-featured tool with extensive options and interactive approval workflow.
# Basic usage
ddev exec bin/console ai:content:generate "<page-path>" "<url>" "<prompt>"
# With URL instead of CMF path
ddev exec bin/console ai:content:generate \
"https://sulu-never-code-alone.ddev.site/de/blog/my-article" \
"https://example.com" \
"Create content about..."
# With all options
ddev exec bin/console ai:content:generate \
"/cmf/example/contents/tutorials/symfony" \
"https://symfony.com/doc/current" \
"Symfony Tutorial für Einsteiger" \
--position=2 \
--headline="Symfony 6 Tutorial" \
--format=tutorial \
--temperature=0.5Options:
--position=N- Insert position (default: 2)-l, --locale=LOCALE- Target locale (default: de)--headline=TEXT- Custom headline-t, --temperature=N- AI creativity level 0.1-1.0 (default: 0.3)-f, --format=FORMAT- Content format: seo|technical|tutorial (default: seo)--dry-run- Preview only, do not save
Step-by-step interactive assistant with guided input validation.
ddev exec bin/console ai:content:interactiveOptional default options:
-p, --page=PATH- Default Sulu page path--position=N- Default insert position-l, --locale=LOCALE- Default locale-f, --format=FORMAT- Default format-t, --temperature=N- Default AI temperature--dry-run- Default to dry run mode
The interactive assistant will guide you through:
- Target page configuration (path, position, locale)
- Source URL input with validation
- Content strategy selection (format, temperature)
- Custom prompt input
- Execution mode selection
- Configuration review and approval
All AI-generated content is automatically logged to Sulu's activity system:
- View in Sulu Admin: Navigate to Settings → Activities
- Activity format:
"Page Title [AI: Gemini via tool-name]" - Metadata tracked: Source URL, prompt, AI provider, CLI tool, timestamp
Check recent AI activities:
ddev exec mysql -udb -pdb -Ddb -e \
"SELECT * FROM ac_activities WHERE resourceTitle LIKE '%AI:%' ORDER BY timestamp DESC LIMIT 5;"Set your Gemini API key in .env.local:
GEMINI_API_KEY=your-api-key-here
GEMINI_MODEL=gemini-1.5-flashView available AI commands:
ddev exec bin/console list aiGet detailed help for any command:
ddev exec bin/console ai:content:quick --help
ddev exec bin/console ai:content:generate --help
ddev exec bin/console ai:content:interactive --help- SEO: Optimized for search engines with keywords and structure
- Technical: In-depth technical content with code examples
- Tutorial: Step-by-step guides with practical examples
Both formats are supported:
- CMF Path:
/cmf/example/contents/blog/my-page - Full URL:
https://sulu-never-code-alone.ddev.site/de/blog/my-page
Test the logging system:
ddev exec php test-direct-logging.phpTest a quick generation (dry run):
ddev exec bin/console ai:content:quick \
"https://github.com/symfony/symfony" \
"Erstelle einen deutschen Artikel über Symfony Features" \
--dry-run- Symfony Console Commands: Three specialized commands for different use cases
- AI Platform: Abstraction layer for multiple AI providers with dependency injection
- GeminiProvider: Implementation for Google's Gemini AI
- AIActivityLogger: Direct database logging to Sulu's activity table
- Dual storage support: Handles both serialized and XML property formats
- Proper error handling: Symfony console provides robust error handling and user feedback
| Old Script | New Command | Notes |
|---|---|---|
nca-quick.php |
ai:content:quick |
Same functionality, better integration |
ai_content_generator_gemini.php |
ai:content:generate |
Enhanced with proper validation |
nca-ai-assistant.php |
ai:content:interactive |
Improved user experience |
All functionality remains the same, but with better error handling, dependency injection, and Symfony integration.
Execute PHP unit tests:
ddev exec vendor/bin/phpunitClear Symfony cache:
ddev exec bin/console cache:clearWarm up cache:
ddev exec bin/console cache:warmup