{
"event": "PostToolUse",
"tool_name": "Read",
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/migration\/content-pipeline\/scripts\/setup.sh",
"content": "#!\/bin\/bash\n# =============================================================================\n# Content Pipeline - Setup Script\n# =============================================================================\n\nset -e\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\nPROJECT_DIR=\"$(dirname \"$SCRIPT_DIR\")\"\n\necho \"=== Content Pipeline Setup ===\"\necho \"\"\n\n# Check Python\necho \"[1\/6] Checking Python...\"\nif ! command -v python3 &> \/dev\/null; then\n echo \"ERROR: Python 3 not found. Please install Python 3.11+\"\n exit 1\nfi\nPYTHON_VERSION=$(python3 -c 'import sys; print(f\"{sys.version_info.major}.{sys.version_info.minor}\")')\necho \" Found Python $PYTHON_VERSION\"\n\n# Create virtual environment\necho \"\"\necho \"[2\/6] Creating virtual environment...\"\nif [ ! -d \"$PROJECT_DIR\/venv\" ]; then\n python3 -m venv \"$PROJECT_DIR\/venv\"\n echo \" Created venv\/\"\nelse\n echo \" venv\/ already exists\"\nfi\n\n# Activate and install dependencies\necho \"\"\necho \"[3\/6] Installing Python dependencies...\"\nsource \"$PROJECT_DIR\/venv\/bin\/activate\"\npip install --quiet --upgrade pip\npip install --quiet -r \"$PROJECT_DIR\/src\/requirements.txt\"\necho \" Dependencies installed\"\n\n# Check configuration\necho \"\"\necho \"[4\/6] Checking configuration...\"\nif [ ! -f \"$PROJECT_DIR\/.env\" ]; then\n cp \"$PROJECT_DIR\/config\/settings.env.example\" \"$PROJECT_DIR\/.env\"\n echo \" Created .env from template\"\n echo \" IMPORTANT: Edit .env with your settings!\"\nelse\n echo \" .env already exists\"\nfi\n\n# Check external services\necho \"\"\necho \"[5\/6] Checking external services...\"\n\n# Check MariaDB\/MySQL\nif command -v mariadb &> \/dev\/null; then\n echo \" MariaDB: installed\"\nelif command -v mysql &> \/dev\/null; then\n echo \" MySQL: installed\"\nelse\n echo \" WARNING: MariaDB\/MySQL not found\"\nfi\n\n# Check Qdrant\nif curl -s http:\/\/localhost:6333\/collections > \/dev\/null 2>&1; then\n echo \" Qdrant: running at localhost:6333\"\nelse\n echo \" WARNING: Qdrant not accessible at localhost:6333\"\n echo \" Start with: docker run -p 6333:6333 qdrant\/qdrant\"\nfi\n\n# Check Ollama\nif curl -s http:\/\/localhost:11434\/api\/tags > \/dev\/null 2>&1; then\n echo \" Ollama: running at localhost:11434\"\nelse\n echo \" WARNING: Ollama not accessible at localhost:11434\"\nfi\n\n# Check Tesseract\nif command -v tesseract &> \/dev\/null; then\n echo \" Tesseract OCR: installed\"\nelse\n echo \" WARNING: Tesseract not found (OCR disabled)\"\nfi\n\n# Summary\necho \"\"\necho \"[6\/6] Setup complete!\"\necho \"\"\necho \"=== Next Steps ===\"\necho \"\"\necho \"1. Edit configuration:\"\necho \" nano $PROJECT_DIR\/.env\"\necho \"\"\necho \"2. Create database and import schema:\"\necho \" mariadb -e \\\"CREATE DATABASE content_pipeline CHARACTER SET utf8mb4\\\"\"\necho \" mariadb content_pipeline < $PROJECT_DIR\/sql\/schema.sql\"\necho \"\"\necho \"3. Pull required Ollama models:\"\necho \" ollama pull mxbai-embed-large\"\necho \" ollama pull llama3.2:3b\"\necho \"\"\necho \"4. Create Qdrant collections (Python):\"\necho \" python3 -c \\\"\"\necho \" from qdrant_client import QdrantClient\"\necho \" from qdrant_client.models import VectorParams, Distance\"\necho \" client = QdrantClient(host='localhost', port=6333)\"\necho \" client.create_collection('documents', VectorParams(size=1024, distance=Distance.COSINE))\"\necho \" client.create_collection('entities', VectorParams(size=1024, distance=Distance.COSINE))\"\necho \" \\\"\"\necho \"\"\necho \"5. Run the pipeline:\"\necho \" source venv\/bin\/activate\"\necho \" export \\$(cat .env | xargs)\"\necho \" python src\/pipeline.py\"\necho \"\"\n",
"numLines": 118,
"startLine": 1,
"totalLines": 118
}
}
}