-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·38 lines (28 loc) · 850 Bytes
/
setup.sh
File metadata and controls
executable file
·38 lines (28 loc) · 850 Bytes
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
#!/bin/bash
echo "🚀 Setting up Terminal AI Assistant..."
# Ensure script runs from repo root
cd "$(dirname "$0")"
# Create config folder
mkdir -p ~/.ai_config
# Prompt API key
echo "🔑 Get your OpenRouter API key at https://openrouter.ai/keys"
read -s -p "👇 Paste it below (input hidden): " API_KEY
echo
echo "OPENROUTER_API_KEY=\"$API_KEY\"" > ~/.ai_config/.env
echo "🔐 API key saved to ~/.ai_config/.env"
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
# Create ~/bin if it doesn’t exist
mkdir -p ~/bin
# Create wrapper script
cat > ~/bin/ai <<EOF
#!/bin/bash
source ~/ai-terminal/venv/bin/activate
python ~/ai-terminal/ai.py "\$@"
EOF
chmod +x ~/bin/ai
echo "✅ Installation complete! Run with: ai \"your prompt\""