#!/bin/bash
# Initialize a new ad video project with Remotion + MCP config

set -e

PROJECT_NAME="${1:-ad-video}"
OUTPUT_DIR="${2:-.}"

echo "🎬 Creating ad video project: $PROJECT_NAME"

# Create Remotion project
cd "$OUTPUT_DIR"
npx create-video@latest "$PROJECT_NAME" --template blank

cd "$PROJECT_NAME"

# Add MCP configuration for Chrome Devtools
cat > .mcp.json << 'EOF'
{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-chrome-devtools@latest"]
    }
  }
}
EOF

# Create public folder for assets
mkdir -p public

# Create placeholder for assets
echo "Place your brand assets here:" > public/README.md
echo "- logo.png (your logo)" >> public/README.md
echo "- product.png (product image)" >> public/README.md
echo "- music.mp3 (optional background music)" >> public/README.md

echo ""
echo "✅ Project created: $PROJECT_NAME"
echo ""
echo "Next steps:"
echo "  1. cd $PROJECT_NAME"
echo "  2. Add your assets to public/"
echo "  3. npx remotion studio (start preview)"
echo "  4. Edit src/Root.tsx to build your ad"
echo ""
echo "Render commands:"
echo "  npx remotion render src/index.ts <CompositionId> out/ad.mp4"
