A powerful Streamlit-based application for automated content creation and WordPress publishing powered by Google Gemini AI. Create professional articles, technical documentation, complete Python projects, and publish directly to WordPress with SEO optimization, featured images, and comprehensive customization options.
- 13 Content Types: Blog posts, technical articles, tutorials, reviews, documentation, case studies, and more
- Google Gemini 2.0: State-of-the-art AI model for natural, professional content
- SEO Optimization: Automatic title, meta description, keywords, and URL slug generation
- Customizable Parameters: Writing style, target audience, word count (500-5000+ words)
- Advanced Options: Table of contents, practical examples, code blocks, conclusions
- 9 Project Types: Python projects, web apps, APIs, ML projects, Discord bots, automation scripts, CLI tools, games
- Multiple Files: Main code, requirements.txt, README.md, .gitignore, config files
- Advanced Features: Unit tests, Docker setup, CI/CD configuration, comprehensive documentation
- Production-Ready: Error handling, best practices, proper code structure
- Download Options: ZIP archive or individual files
- Direct Publishing: One-click publishing to WordPress from the app
- Self-Hosted & WordPress.com: Support for both hosting types with auto-detection
- Permalink Auto-Detection: Works with and without pretty permalinks
- Featured Images: Manual upload or AI-generated placeholder images
- Categories & Tags: Select from existing WordPress terms or let SEO suggest tags
- Post Status: Publish immediately or save as draft
- REST API: Uses WordPress REST API for secure, modern integration
- Automatic SEO Generation: AI-powered SEO metadata for every piece of content
- Title Optimization: 50-60 character SEO titles
- Meta Descriptions: 150-160 character descriptions optimized for click-through
- Keyword Extraction: 3-5 relevant, high-impact keywords
- URL Slugs: Clean, search-friendly URL slugs
- Editable Metadata: Review and adjust all SEO elements before publishing
- Publication History: Track all WordPress publications with timestamps
- Content Analytics: Word count, paragraphs, code blocks, headings
- SEO Analysis: Title/description length validation and recommendations
- Project Statistics: File count, total lines, file type breakdown
- Session Management: Export/import configuration preferences
- Markdown Files: Save with YAML front matter metadata
- HTML Websites: Complete, styled HTML with responsive design
- Project ZIP: Download complete projects as ZIP archives
- Individual Downloads: Download project files separately
- Configuration Export: Save and load your preferences
- Python 3.8 or higher
- Modern web browser
- Internet connection
- 2GB+ RAM
- WordPress 4.7+ (for publishing)
streamlit>=1.28.0
requests>=2.31.0
markdown>=3.5.0
python-dotenv>=1.0.0
pip install streamlit requests markdown python-dotenvOr use requirements.txt:
pip install -r requirements.txtrequirements.txt:
streamlit>=1.28.0
requests>=2.31.0
markdown>=3.5.0
python-dotenv>=1.0.0
- Visit Google AI Studio
- Sign in with your Google account
- Click "Get API Key"
- Create a new API key
- Copy the key (starts with
AIza...)
- Enable REST API (usually enabled by default in WordPress 4.7+)
- Create Application Password:
- Go to WordPress Admin → Users → Profile
- Scroll to "Application Passwords"
- Enter name (e.g., "AI Content Agent")
- Click "Add New Application Password"
- Copy the generated password (appears only once)
- Upgrade Plan: Requires Business plan or higher
- Make Site Public: Remove "Coming Soon" mode
- Get Access Token:
- Go to WordPress.com → My Sites → Manage → Marketing → Connections
- Create a new connection/token
- Copy the access token
Create a .env file in the project directory:
# Gemini AI API Key
GEMINI_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXX
# WordPress Configuration (Self-Hosted)
WP_SITE_URL=https://yoursite.com
WP_USERNAME=your-username
WP_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
# Or for WordPress.com
WP_SITE_URL=https://yoursite.wordpress.com
WP_USERNAME=your-username
WP_APP_PASSWORD=your-access-tokenNote: Settings can also be configured directly in the app's sidebar.
streamlit run app.pyThe app will open in your default browser at http://localhost:8501
Gemini AI:
- Enter your Gemini API key
- Click outside the field or press Enter
- Wait for "✅ Gemini AI Connected"
WordPress (Optional):
- Select WordPress type (Self-hosted or WordPress.com)
- Enter Site URL
- Enter Username
- Enter Application Password/Access Token
- Click "🔗 Test WordPress Connection"
- Wait for success message
Navigate to "📝 Content & Project Creation" tab:
-
Choose Type: Content (articles) or Projects (Python code)
-
For Articles:
- Enter topic (e.g., "The Future of AI")
- Select content type (Blog Post, Tutorial, etc.)
- Choose writing style (Professional, Casual, etc.)
- Select target audience (Beginners, Advanced, etc.)
- Choose word count (500-5000+ words)
- Add detailed description and requirements
- Enable/disable advanced options (SEO, TOC, examples)
- Click "🚀 Generate Content"
-
For Projects:
- Enter project name (e.g., "Flask API Server")
- Select project type (Python Project, Web App, etc.)
- Choose target audience
- Add detailed description and features
- Enable/disable advanced options (tests, Docker, CI/CD)
- Click "🚀 Generate Project"
In the "🚀 Publishing" tab:
- Preview generated content
- Edit SEO metadata (title, description, keywords, slug)
- View content statistics
- For projects: Browse individual files
WordPress Publishing:
- Select post status (draft or publish)
- Choose categories and tags
- Add featured image (manual upload or AI-generated)
- Click "📝 Publish Post to WordPress"
- Get live URL and edit link
Local Download:
- Save as Markdown file
- Create HTML website
- Download project as ZIP
- Download individual project files
Navigate to "📊 Results" tab:
- View publication history
- Check content analytics
- Review SEO analysis
- Track WordPress publications
Writing Styles:
- Professional
- Casual
- Technical
- Conversational
- Academic
- Creative
- Formal
- Friendly
- Authoritative
Target Audiences:
- Beginners
- Intermediate
- Advanced
- General Public
- Developers
- Business Professionals
- Students
- Researchers
- Decision Makers
Word Counts:
- 500-800 (short article)
- 800-1200 (standard article)
- 1200-2000 (comprehensive article)
- 2000-3000 (in-depth guide)
- 3000-5000 (extensive tutorial)
- 5000+ (complete guide/documentation)
Project Types:
- Python Project
- Web Application
- API Project
- Data Science Project
- Machine Learning Project
- Discord Bot
- Automation Script
- CLI Tool
- Game Project
Complexity Levels:
- Simple: Basic functionality
- Intermediate: Production features
- Advanced: Enterprise-grade code
Optional Features:
- Unit Tests (pytest/unittest)
- Docker Setup (Dockerfile + compose)
- CI/CD Configuration (GitHub Actions)
- Comprehensive Documentation
- Usage Examples
Permalink Settings: The app auto-detects your WordPress permalink structure:
- Pretty permalinks:
/wp-json/wp/v2/posts - Query parameters:
/?rest_route=/wp/v2/posts
Categories & Tags:
- Auto-fetched from WordPress on connection
- Select existing categories/tags from dropdown
- Tags can be auto-suggested from SEO keywords
- Must exist in WordPress before publishing
Post Status:
draft: Save as draft for reviewpublish: Publish immediately to live site
Topic: "10 Python Tips for Beginners"
Content Type: Blog Post
Writing Style: Friendly
Audience: Beginners
Word Count: 1200-2000
Advanced: Enable SEO, Examples, Conclusion
Result: SEO-optimized blog post with code examples, ready to publish.
Topic: "REST API Documentation for XYZ Service"
Content Type: API Documentation
Writing Style: Technical
Audience: Developers
Word Count: 2000-3000
Advanced: Enable TOC, Examples
Result: Complete API docs with endpoints, parameters, examples.
Project Name: "Discord Weather Bot"
Type: Discord Bot
Audience: Intermediate
Complexity: Intermediate
Advanced: Enable Tests, Docker, Examples
Result: Full project with bot.py, requirements.txt, README, Docker setup.
Topic: "Machine Learning with scikit-learn"
Content Type: Tutorial
Writing Style: Professional
Audience: Intermediate
Word Count: 3000-5000
Advanced: Enable all options
Result: Step-by-step tutorial with code, explanations, exercises.
Topic: "ChatGPT Plus vs Claude Pro Comparison"
Content Type: Review
Writing Style: Conversational
Audience: General Public
Word Count: 1200-2000
Advanced: Enable SEO, Conclusion
Result: Detailed comparison with pros/cons, ratings, recommendations.
The app uses sophisticated prompts that include:
- Content type-specific instructions
- SEO requirements
- Structural guidelines
- Code formatting rules
- Quality standards
Automatic Generation:
- Primary keywords extracted from content
- Related keywords suggested
- Title optimized for 50-60 characters
- Description optimized for 150-160 characters
- Clean URL slugs with hyphens
Validation:
- Real-time length checking
- Green checkmarks for optimal lengths
- Yellow warnings for improvements needed
Manual Upload:
- Support for PNG, JPG, JPEG, GIF
- Upload to WordPress media library
- Automatic association with post
AI Generated (Placeholder):
- Describe desired image
- Generate placeholder image
- Upload to WordPress
- Note: Real AI image generation requires external API integration
Standard Project Files:
project_name/
├── main.py (core logic)
├── requirements.txt (dependencies)
├── README.md (documentation)
├── .gitignore (Git exclusions)
├── config.py (configuration)
├── .env.example (environment template)
├── tests/ (optional)
│ └── test_main.py
├── Dockerfile (optional)
├── docker-compose.yml (optional)
└── .github/workflows/ci.yml (optional)
Export Settings:
- Generate JSON configuration file
- Save content preferences
- Save project preferences
- Save WordPress settings (passwords excluded)
Import Settings:
- Upload configuration JSON
- Load saved preferences
- Apply to new sessions
- Merge with current settings
-
API Keys
- Store in
.envfile - Never commit to version control
- Add
.envto.gitignore - Rotate keys periodically
- Store in
-
WordPress Credentials
- Use Application Passwords (not login passwords)
- Create specific user for API access
- Limit permissions as needed
- Revoke unused application passwords
-
WordPress.com
- Use access tokens instead of passwords
- Keep site public for REST API access
- Upgrade to Business plan minimum
- Monitor API usage
-
Data Privacy
- Content generated locally
- API calls use HTTPS
- No data stored on external servers
- Session data cleared on exit
.env
*.pyc
__pycache__/
.streamlit/secrets.toml
generated_content/
generated_website/
ai_agent_config.json
.DS_Store
Error: "Authentication failed"
- Verify API key is correct
- Check for extra spaces
- Ensure key has proper permissions
- Try generating new API key
Error: "No content generated"
- Check internet connection
- Verify API key is active
- Try simpler prompts
- Check Gemini API status
Self-Hosted WordPress:
"Authentication failed"
- Use Application Password, not login password
- Verify username is correct
- Check WordPress user has proper permissions
- Ensure REST API is enabled
"404 Not Found"
- Check site URL is correct
- Try toggling permalink settings
- Verify
.htaccessis writable - Check if REST API endpoint exists
WordPress.com:
"Site is private or Coming Soon"
- Make site public
- Remove "Coming Soon" mode
- Settings → Privacy → Public
"403 Forbidden"
- Upgrade to Business plan or higher
- Verify access token is valid
- Check token permissions
"Invalid parameter(s): categories"
- Categories must exist in WordPress first
- Create categories manually
- Match category names exactly (case-insensitive)
- App fetches available categories on connection
"Featured image upload failed"
- Check file size limits (PHP settings)
- Verify file type is supported
- Check user permissions for media upload
- Try smaller image files
"Tags not applied"
- Tags must exist in WordPress first
- Create tags manually or
- WordPress may auto-create tags on first use
- Check spelling matches exactly
App won't start
# Check Python version
python --version # Should be 3.8+
# Reinstall dependencies
pip install -r requirements.txt --upgrade
# Clear Streamlit cache
streamlit cache clearSession state errors
- Click "🗑️ Clear All Session Data" in Settings
- Refresh browser
- Restart Streamlit app
Slow content generation
- Normal for long content (2000+ words)
- Expected time: 30-180 seconds
- Check internet speed
- Try shorter word count first
| Word Count | Generation Time | Quality |
|---|---|---|
| 500-800 | 30-45 seconds | Excellent |
| 800-1200 | 45-60 seconds | Excellent |
| 1200-2000 | 60-90 seconds | Excellent |
| 2000-3000 | 90-120 seconds | Very Good |
| 3000-5000 | 120-180 seconds | Good |
| Complexity | Files | Time | Quality |
|---|---|---|---|
| Simple | 3-5 | 45-60s | Good |
| Intermediate | 5-8 | 60-90s | Very Good |
| Advanced | 8-12 | 90-150s | Excellent |
Gemini AI:
- Free tier: 60 requests/minute
- Rate limiting may apply
- No monthly limit on free tier
WordPress REST API:
- No specific rate limits
- Depends on hosting
- Shared hosting may be slower
- Be Specific: Detailed descriptions produce better content
- Use Examples: Reference similar content you like
- Iterate: Generate, review, refine requirements, regenerate
- Keywords: Include target keywords in topic/description
- Audience: Match style to target audience
- Test First: Always publish as draft first
- Review Content: Check formatting in WordPress editor
- Create Terms: Create categories/tags before publishing
- Featured Images: Use high-quality, relevant images
- SEO Check: Review and adjust SEO metadata
- Clear Requirements: List specific features needed
- Example Code: Reference similar projects
- Technical Details: Specify libraries, frameworks
- Complexity: Start simple, iterate to advanced
- Documentation: Enable all documentation options
- Cache Results: Generated content persists in session
- Batch Operations: Generate multiple pieces separately
- Monitor Limits: Watch API usage on free tiers
- Optimize Prompts: Shorter prompts = faster generation
Contributions welcome! Areas for improvement:
- Add real AI image generation (DALL-E, Stable Diffusion)
- Support for more CMS platforms (Ghost, Medium, etc.)
- Bulk content generation
- Content scheduling
- Multi-language support
- Custom templates
- Analytics integration
- Social media posting
- Content optimization suggestions
- A/B testing for headlines
This project is licensed under the MIT License.
This software is for content creation and automation purposes. Users are responsible for:
- Compliance with WordPress terms of service
- Content accuracy and originality
- Proper attribution and citations
- Copyright compliance
- SEO best practices
- API key security
The AI-generated content should be reviewed and edited before publishing.
- Google Gemini AI: Content generation engine
- Streamlit: Web application framework
- WordPress: Content management system
- Markdown: Content formatting
- Python: Core programming language
- Gemini AI: Google AI Studio
- Streamlit Docs: docs.streamlit.io
- WordPress REST API: developer.wordpress.org/rest-api
- Issues: Report bugs via GitHub
- Content generation with Gemini AI
- Project generation (9 types)
- WordPress publishing (self-hosted & .com)
- SEO optimization
- Featured image upload
- Categories & tags support
- Real AI image generation integration
- Content templates
- Bulk publishing
- Post scheduling
- Analytics dashboard
- Multi-CMS support
- Social media integration
- Team collaboration
- Custom AI training
- Mobile app
# 1. Start the app
streamlit run app.py
# 2. In the browser:
# - Add Gemini API key in sidebar
# - Configure WordPress (optional)
# - Click "Test WordPress Connection"
# 3. Generate Content:
# - Go to "Content & Project Creation" tab
# - Enter topic: "Getting Started with Python"
# - Select: Blog Post, Professional, Beginners, 1200-2000 words
# - Add description: "Cover installation, first program, variables"
# - Click "Generate Content"
# 4. Publish:
# - Go to "Publishing" tab
# - Review SEO metadata
# - Select WordPress status: draft
# - Choose categories and tags
# - Click "Publish Post to WordPress"
# 5. Done!
# - View published post URL
# - Edit in WordPress admin
# - Check results in "Results" tabMade with ❤️ for content creators and developers
🚀 Create professional content and code with AI