-
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
/
run_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