-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_client.sh
More file actions
executable file
Β·45 lines (37 loc) Β· 1.08 KB
/
Copy pathrun_client.sh
File metadata and controls
executable file
Β·45 lines (37 loc) Β· 1.08 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
#!/bin/bash
set -e
echo "π§ Setting up ChatSQL Client Environment..."
# 1. π§Ό Clean old virtual env
if [ -d ".venv" ]; then
echo "π§Ή Removing existing virtual environment..."
rm -rf .venv
fi
# 2. π Create new virtual environment
echo "π¦ Creating Python 3.11 virtual environment..."
python3.11 -m venv .venv
echo "βοΈ Activating virtual environment..."
source .venv/bin/activate
# 3. π¦ Install dependencies
echo "π₯ Installing Python dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
# 4. π Load .env if present
if [ -f ".env" ]; then
echo "π .env found. Loading environment variables..."
export $(grep -v '^#' .env | xargs)
else
echo "βοΈ Creating default .env..."
cat <<EOF > .env
DB_NAME=chattosql
DB_USER=postgres
DB_PASS=yourpassword
DB_HOST=localhost
DB_PORT=5432
GEMINI_API_KEY=your_gemini_api_key_here
EOF
echo "π Please update '.env' with actual database credentials and Gemini API key."
export $(grep -v '^#' .env | xargs)
fi
# 5. π Run the CLI
echo "π Running ChatSQL Client..."
python cli.py