Files
seo/scripts/run_analysis.sh
Kevin Bataille 8c7cd24685 Refactor SEO automation into unified CLI application
Major refactoring to create a clean, integrated CLI application:

### New Features:
- Unified CLI executable (./seo) with simple command structure
- All commands accept optional CSV file arguments
- Auto-detection of latest files when no arguments provided
- Simplified output directory structure (output/ instead of output/reports/)
- Cleaner export filename format (all_posts_YYYY-MM-DD.csv)

### Commands:
- export: Export all posts from WordPress sites
- analyze [csv]: Analyze posts with AI (optional CSV input)
- recategorize [csv]: Recategorize posts with AI
- seo_check: Check SEO quality
- categories: Manage categories across sites
- approve [files]: Review and approve recommendations
- full_pipeline: Run complete workflow
- analytics, gaps, opportunities, report, status

### Changes:
- Moved all scripts to scripts/ directory
- Created config.yaml for configuration
- Updated all scripts to use output/ directory
- Deprecated old seo-cli.py in favor of new ./seo
- Added AGENTS.md and CHANGELOG.md documentation
- Consolidated README.md with updated usage

### Technical:
- Added PyYAML dependency
- Removed hardcoded configuration values
- All scripts now properly integrated
- Better error handling and user feedback

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-16 14:24:44 +01:00

74 lines
2.8 KiB
Bash
Executable File

#!/bin/bash
set -e
echo "╔════════════════════════════════════════════════════════════╗"
echo "║ SEO Analysis & Improvement System - Full Pipeline ║"
echo "╚════════════════════════════════════════════════════════════╝"
echo ""
# Check if venv exists
if [ ! -d "venv" ]; then
echo "❌ Virtual environment not found. Please run: python3 -m venv venv"
exit 1
fi
# Check if input files exist
if [ ! -f "input/new-propositions.csv" ]; then
echo "❌ Missing input/new-propositions.csv"
echo "Please place your WordPress posts CSV in input/ directory"
exit 1
fi
if [ ! -f "input/analytics/ga4_export.csv" ]; then
echo "❌ Missing input/analytics/ga4_export.csv"
echo "Please export GA4 data and place it in input/analytics/"
exit 1
fi
# Create output directories
mkdir -p output/results
mkdir -p output/logs
echo "📊 Step 1: Analytics Integration"
echo " Merging GA4, Search Console, and WordPress data..."
./venv/bin/python analytics_importer.py
echo ""
echo "🔍 Step 2: Keyword Opportunity Analysis"
echo " Identifying high-potential optimization opportunities..."
./venv/bin/python opportunity_analyzer.py \
--input output/results/posts_with_analytics.csv \
--output output/results/keyword_opportunities.csv \
--min-position 11 \
--max-position 30 \
--min-impressions 50 \
--top-n 20
echo ""
echo "📝 Step 3: Report Generation"
echo " Creating comprehensive SEO optimization report..."
./venv/bin/python report_generator.py
echo ""
echo "╔════════════════════════════════════════════════════════════╗"
echo "║ ✅ Analysis Complete! ║"
echo "╚════════════════════════════════════════════════════════════╝"
echo ""
echo "📂 Results Location:"
echo " └─ output/results/seo_optimization_report.md"
echo ""
echo "📊 Key Files:"
echo " ├─ posts_prioritized.csv (all posts ranked 0-100)"
echo " ├─ keyword_opportunities.csv (26 optimization opportunities)"
echo " └─ posts_with_analytics.csv (enriched dataset)"
echo ""
echo "📋 Logs:"
echo " └─ output/logs/"
echo ""
echo "🚀 Next Steps:"
echo " 1. Open: output/results/seo_optimization_report.md"
echo " 2. Review Top 20 Posts to Optimize"
echo " 3. Start with Quick Wins (positions 11-15)"
echo " 4. Follow 90-day action plan"
echo ""