forked from Josh-XT/AGiXT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AGiXT.sh
executable file
·189 lines (164 loc) · 4.89 KB
/
AGiXT.sh
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#!/bin/bash
# Define colors and formatting
BOLD=$(tput bold)
GREEN=$(tput setaf 2)
CYAN=$(tput setaf 6)
YELLOW=$(tput setaf 3)
RED=$(tput setaf 1)
MAGENTA=$(tput setaf 5)
BLUE=$(tput setaf 4)
RESET=$(tput sgr0)
# Function to display a show opening style animation
display_animation() {
# More dynamic smoke animation above ASCII art
for i in {1..10}; do
clear
echo " ( )"
echo " ( ) ( )"
echo " ( ) ("
echo " _____________"
echo " <_____________> ___"
echo " | |/ _ \\"
echo " | | | |"
echo " | |_| |"
echo " ___| |\\___/"
echo " / \\___________/ \\"
echo " \\_____________________/"
sleep 0.2
clear
echo " ( ) ("
echo " ) ( )"
echo " ( ) ( )"
echo " _____________"
echo " <_____________> ___"
echo " | |/ _ \\"
echo " | | | |"
echo " | |_| |"
echo " ___| |\\___/"
echo " / \\___________/ \\"
echo " \\_____________________/"
sleep 0.2
clear
echo " ( ) ("
echo " ) ( )"
echo " ( ) ( )"
echo " _____________"
echo " <_____________> ___"
echo " | |/ _ \\"
echo " | | | |"
echo " | |_| |"
echo " ___| |\\___/"
echo " / \\___________/ \\"
echo " \\_____________________/"
sleep 0.2
clear
echo " ( ) ("
echo " ) ( )"
echo " ( ) ( )"
echo " _____________"
echo " <_____________> ___"
echo " | |/ _ \\"
echo " | | | |"
echo " | |_| |"
echo " ___| |\\___/"
echo " / \\___________/ \\"
echo " \\_____________________/"
sleep 0.2
done
# Spinning loading indicator
echo "${BOLD}${GREEN}Loading...${RESET}"
for i in {1..10}; do
for s in / - \\ \|; do
printf "\r${BOLD}${GREEN}Loading %s${RESET}" "$s"
sleep 0.1
done
done
echo
}
# Function to display the menu
display_menu() {
clear
echo "${BOLD}${CYAN}"
echo " ___ _______ _ ________"
echo " / | / ____(_) |/ /_ __/"
echo " / /| |/ / __/ /| / / / "
echo " / ___ / /_/ / // | / / "
echo "/_/ |_\____/_//_/|_|/_/ "
echo " "
echo "----------------------------------------------------${RESET}"
echo "${BOLD}${MAGENTA}Welcome to the AGiXT Installer!${RESET}"
echo "${BOLD}${GREEN}Please choose an option:${RESET}"
echo " ${BOLD}${YELLOW}1.${RESET} ${YELLOW}Local Install/Run${RESET}"
echo " ${BOLD}${YELLOW}2.${RESET} ${YELLOW}Docker Install/Run${RESET}"
echo " ${BOLD}${YELLOW}3.${RESET} ${YELLOW}Update pulls latest from repo & pulls latest docker${RESET}"
echo " ${BOLD}${RED}4.${RESET} ${RED}Exit${RESET}"
echo ""
}
# Function to perform the local install
local_install() {
echo "${BOLD}${GREEN}Running local install...${RESET}"
display_animation
echo "${BOLD}${YELLOW}Step 1: Updating the repository...${RESET}"
git pull
sleep 1
echo "${BOLD}${YELLOW}Step 2: Upgrading pip...${RESET}"
pip install --upgrade pip
sleep 1
echo "${BOLD}${YELLOW}Step 3: Installing requirements...${RESET}"
pip install -r static-requirements.txt
sleep 1
pip install -r requirements.txt
sleep 1
echo "${BOLD}${YELLOW}Step 4: Installing Playwright dependencies...${RESET}"
playwright install --with-deps
sleep 1
echo "${BOLD}${YELLOW}Step 5: Running AGiXT Back End...${RESET}"
cd agixt && uvicorn app:app --host 0.0.0.0 --port 7437 --workers 4 &
sleep 1
echo "${BOLD}${YELLOW}Step 6: Running Streamlit Front End...${RESET}"
cd streamlit && streamlit run Main.py
}
# Function to perform the Docker install
docker_install() {
echo "${BOLD}${GREEN}Running Docker install...${RESET}"
display_animation
echo "${BOLD}${YELLOW}Step 1: Starting Docker Compose...${RESET}"
docker-compose up
}
# Function to perform the Update
update() {
echo "${BOLD}${GREEN}Running Update...${RESET}"
display_animation
echo "${BOLD}${YELLOW}Step 1: Updating the repository...${RESET}"
git pull
echo "${BOLD}${YELLOW}Step 2: Pulling latest Docker Images...${RESET}"
docker compose pull
}
# Main loop to display the menu and handle user input
while true; do
display_menu
read -p "${BOLD}${CYAN}Enter your choice:${RESET} " choice
case "$choice" in
1)
local_install
break
;;
2)
docker_install
break
;;
3)
update
echo "${BOLD}${GREEN}Update complete.${RESET}"
sleep 2
;;
4)
echo "${BOLD}${MAGENTA}Thank you for using AGiXT Installer. Goodbye!${RESET}"
break
;;
*)
echo "${RED}Invalid option. Please try again.${RESET}"
sleep 2
;;
esac
done