Repository navigation
Expand file tree
/
Copy pathinstall_and_setup.sh
More file actions
executable file
·64 lines (57 loc) · 2.2 KB
/
Copy pathinstall_and_setup.sh
File metadata and controls
executable file
·64 lines (57 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Installation and setup script for Project Vectorizer v0.2.0
set -euo pipefail
echo "🚀 Installing Project Vectorizer v0.2.0"
echo "========================================"
# Check Python version
echo "📋 Checking Python version..."
python_version=$(python3 --version 2>&1 | awk '{print $2}' | cut -d. -f1,2)
required_version="3.9"
if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" = "$required_version" ]; then
echo "✅ Python $python_version detected (>= 3.9 required)"
else
echo "❌ Python $python_version detected, but >= 3.9 is required"
exit 1
fi
# Install dependencies
echo "📦 Installing dependencies..."
pip install -e .
# Setup environment variables
echo "⚙️ Setting up environment configuration..."
if [ ! -f .env ]; then
echo "📄 Creating .env file from template..."
cp .env.example .env
echo "✅ Created .env file. Please edit it with your preferences."
echo ""
echo "🔧 Key settings to configure in .env:"
echo " - OPENAI_API_KEY: If you want to use OpenAI embeddings"
echo " - CHUNK_SIZE: Recommended 128-256 for precise search"
echo " - EMBEDDING_MODEL: Choose your preferred model"
echo ""
else
echo "⚠️ .env file already exists. Skipping creation."
fi
# Test installation
echo "🧪 Testing installation..."
if pv --version >/dev/null 2>&1; then
echo "✅ Project Vectorizer CLI installed successfully!"
echo ""
echo "🎉 Installation Complete!"
echo "========================"
echo ""
echo "Next steps:"
echo "1. Edit .env file with your preferences"
echo "2. Initialize a project: pv init /path/to/your/project"
echo "3. Index your code: pv index /path/to/your/project"
echo "4. Search your code: pv search /path/to/your/project \"your query\""
echo ""
echo "For enhanced single-word search, use high thresholds:"
echo " pv search /path/to/your/project \"async\" --threshold 0.9"
echo ""
echo "📖 For more information, see:"
echo " - README.md: Complete documentation"
echo " - docs/ENVIRONMENT.md: Environment variable guide"
else
echo "❌ Installation test failed. Please check for errors above."
exit 1
fi