-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·88 lines (75 loc) · 2.19 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·88 lines (75 loc) · 2.19 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
# AI Dev Tool Setup Script
echo "========================================="
echo "AI Dev Tool - Setup Script"
echo "========================================="
echo ""
# Check Python version
echo "Checking Python version..."
python3 --version
# Install python3-venv if needed
echo ""
echo "Installing python3-venv package..."
echo "Please enter your password if prompted:"
sudo apt update
sudo apt install -y python3.12-venv
# Create virtual environment
echo ""
echo "Creating virtual environment..."
python3 -m venv venv
# Activate virtual environment
echo ""
echo "Activating virtual environment..."
source venv/bin/activate
# Upgrade pip
echo ""
echo "Upgrading pip..."
pip install --upgrade pip
# Install dependencies
echo ""
echo "Installing dependencies..."
pip install -r requirements.txt
# Install package in development mode
echo ""
echo "Installing ai-dev-tool in development mode..."
pip install -e .
# Initialize configuration
echo ""
echo "Initializing configuration..."
python3 -m ai_dev.cli init
# Add alias to bashrc for convenience
echo ""
echo "Setting up ai-dev alias in ~/.bashrc..."
ALIAS_LINE="alias ai-dev='source $(pwd)/venv/bin/activate && ai-dev'"
if ! grep -q "alias ai-dev=" ~/.bashrc; then
echo "$ALIAS_LINE" >> ~/.bashrc
echo "✅ Alias added to ~/.bashrc"
else
echo "ℹ️ Alias already exists in ~/.bashrc"
fi
echo ""
echo "========================================="
echo "Setup completed successfully!"
echo "========================================="
echo ""
echo "The ai-dev alias has been added to your ~/.bashrc"
echo ""
echo "To start using ai-dev immediately, run:"
echo " source ~/.bashrc && ai-dev --help"
echo ""
echo "Or restart your terminal for the changes to take effect."
echo ""
echo "Alternative: activate the virtual environment manually:"
echo " source venv/bin/activate"
echo " ai-dev --help"
echo ""
# Ask user if they want to test ai-dev now
echo "Would you like to test ai-dev now? (Y/n): "
read -r response
if [[ "$response" =~ ^([yY][eE][sS]|[yY]|)$ ]]; then
echo ""
echo "Please run the following command to test ai-dev:"
echo " source ~/.bashrc && ai-dev status"
echo ""
echo "Copy and paste the command above to test."
fi