ghost-myrtle
v2.1.0
Published
A modern CLI tool to generate content for Ghost CMS using multiple AI providers (OpenAI, Anthropic, OpenRouter, Self-hosted).
Downloads
91
Maintainers
Readme
Ghost Myrtle
A modern CLI tool to generate high-quality, AI-powered content for Ghost CMS demo sites
Ghost Myrtle helps Ghost theme developers and site creators generate sample content for their themes and demo sites. Using language models from multiple AI providers, it creates realistic blog posts, static pages, and comprehensive content that showcases your theme's capabilities—no more lorem ipsum!
✨ Features
- 🤖 Multiple AI Providers: OpenAI, Anthropic (Claude), OpenRouter, or self-hosted models
- 📸 Keyword-Relevant Images: Automatic Pexels integration for relevant stock photos (or Lorem Picsum fallback)
- 📝 Rich Content Generation: Blog posts with proper formatting, SEO structure, and images
- 🎨 Style Guide Page: Optional comprehensive showcase of Ghost's formatting capabilities
- 💾 Resume Functionality: Interrupted sessions automatically save and can be resumed
- 🔄 Flexible Configuration: Easy provider switching and per-generation settings
📋 Requirements
- Node.js: v22.0.0 or higher
- Ghost Site: Local or remote Ghost installation with Admin API access
- AI Provider Account: At least one of the following:
- OpenAI API key (GPT-4, GPT-3.5, etc.)
- Anthropic API key (Claude models)
- OpenRouter API key (access to 100+ models)
- Self-hosted LLM with OpenAI-compatible API
🚀 Installation
Install Ghost Myrtle globally using npm:
npm install -g ghost-myrtleOr use it directly with npx:
npx ghost-myrtle [command]⚙️ Configuration
Initial Setup
Run the configuration wizard to set up your Ghost site and AI provider:
myrtle configYou'll be guided through:
- Ghost Configuration: Enter your Ghost site URL and Admin API key
- Provider Selection: Choose your preferred AI provider
- Provider Setup: Configure API credentials and model selection
- Generation Settings: Set default temperature and token limits
Ghost Admin API Key
To get your Ghost Admin API key:
- Go to your Ghost Admin panel
- Navigate to Settings → Integrations
- Create a new Custom Integration
- Copy the Admin API Key and API URL
Provider-Specific Configuration
OpenAI
myrtle config provider openai- API Key: Get from OpenAI Platform
- Models: Fetched automatically (GPT-4, GPT-3.5-turbo, etc.)
Anthropic (Claude)
myrtle config provider anthropic- API Key: Get from Anthropic Console
- Models: Available Claude models (Opus, Sonnet, Haiku) are fetched automatically from the API
OpenRouter
myrtle config provider openrouter- API Key: Get from OpenRouter
- Models: 100+ models fetched automatically
- Note: Check OpenRouter pricing for model costs
Self-Hosted
myrtle config provider self-hosted- Endpoint: Your local/remote model endpoint (e.g.,
http://localhost:11434/v1) - Models: Fetched from your endpoint's
/modelsAPI
Image Configuration (Optional)
Pexels API
Configure Pexels to get keyword-relevant images in your blog posts:
myrtle config pexels- API Key: Get free from Pexels API
- Free Tier: 200 requests/hour, 20,000/month
- Benefits:
- Keyword-relevant featured images and inline stock photos automatically added to posts
- Proper photographer attribution
- Fallback: If not configured, posts use Lorem Picsum placeholder images for featured and inline post images
Getting a Pexels API Key:
- Visit pexels.com/api
- Sign up for a free account
- Get instant API key (no approval needed)
- Run
myrtle config pexelsand paste your key
📖 Usage
Generate Content
Start the content generation wizard:
myrtle createYou'll be prompted for:
- Site Information: Name, type, description, target audience
- Content Options: Static pages, style guide, blog categories
- Post Configuration: Number of posts per category
The tool will then:
- ✅ Generate static pages (About, Contact, etc.)
- ✅ Create style guide page (optional)
- ✅ Generate diverse blog post titles for each category
- ✅ Write full blog posts with images and formatting
- ✅ Push everything to your Ghost site
Resume Interrupted Sessions
If generation is interrupted (API limits, network issues, etc.), simply run:
myrtle createThe tool will detect your saved progress and offer to resume.
Command Options
# Dry run (generate without pushing to Ghost)
myrtle create --dry-run
# Preview content as it's generated
myrtle create --preview
# Use a specific provider for this session
myrtle create --provider anthropic
# Override temperature setting
myrtle create --temperature 0.9Other Commands
# Show help
myrtle help
myrtle --help
# Show version
myrtle --version
# Configure a specific provider
myrtle config provider [openai|anthropic|openrouter|self-hosted]Theme Showcase
Enable the Style Guide option to generate a comprehensive page showing:
- Typography (headings, paragraphs, blockquotes)
- Lists (ordered, unordered, nested)
- Code blocks and inline code
- Images and galleries
- Tables and embeds
- Ghost-specific cards (buttons, toggles, etc.)
🔍 Troubleshooting
"Provider not configured" Error
Run the configuration for your provider:
myrtle config provider [provider-name]"Could not connect to Ghost" Error
- Verify your Ghost site is accessible
- Check Admin API key is correct
- Ensure API URL includes
/ghost/api/admin/path - Test connection:
curl [YOUR_GHOST_URL]/ghost/api/admin/site/
"API Error" or Rate Limits
- OpenAI: Check usage limits
- Anthropic: Check console billing
- OpenRouter: Check credits balance
- Use
--providerflag to switch to a different provider
Resume Not Working
The state file .myrtle-state.json should be in your current directory. Check:
ls -la .myrtle-state.jsonIf missing, the session completed or was cleared. Start a new generation.
🏗️ Development
Build from Source
# Clone the repository
git clone https://github.com/betschki/ghost-myrtle.git
cd ghost-myrtle
# Install dependencies
npm install
# Build TypeScript
npm run build
# Link for local testing
npm link🤝 Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
📄 License
Ghost Myrtle is MIT licensed.
🐛 Issues
If you encounter any issues, please report them on GitHub Issues.
