Files
NewsAgent/setup.sh
2026-01-26 13:09:32 +01:00

64 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# Setup script for News Agent
set -e
echo "========================================="
echo "News Agent Setup"
echo "========================================="
echo ""
# Check if config.yaml exists
if [ -f "config.yaml" ]; then
echo "✓ config.yaml already exists - skipping"
else
echo "Creating config.yaml from config.yaml.example..."
cp config.yaml.example config.yaml
echo "✓ Created config.yaml"
echo ""
echo "IMPORTANT: Edit config.yaml and update:"
echo " - email.to: your email address"
echo " - email.from: sender address"
echo " - smtp settings: your mail server"
echo ""
fi
# Check if .env exists
if [ -f ".env" ]; then
echo "✓ .env already exists - skipping"
else
echo "Creating .env from .env.example..."
cp .env.example .env
echo "✓ Created .env"
echo ""
echo "IMPORTANT: Edit .env and add:"
echo " - OPENROUTER_API_KEY=your-api-key"
echo " - SMTP_USERNAME=your-email@domain.com"
echo " - SMTP_PASSWORD=your-password"
echo ""
fi
echo "========================================="
echo "Next Steps:"
echo "========================================="
echo "1. Edit .env file:"
echo " nano .env"
echo ""
echo "2. Edit config.yaml file:"
echo " nano config.yaml"
echo ""
echo "3. Create virtual environment:"
echo " python3.11 -m venv .venv"
echo " source .venv/bin/activate"
echo ""
echo "4. Install dependencies:"
echo " pip install feedparser httpx openai pydantic pydantic-settings jinja2 premailer python-dotenv pyyaml aiosqlite"
echo ""
echo "5. Test run:"
echo " python -m src.main"
echo ""
echo "6. Set up systemd timer:"
echo " See SETUP.md for instructions"
echo ""
echo "========================================="