-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtau_ai_setup.sh
More file actions
226 lines (206 loc) · 7.62 KB
/
tau_ai_setup.sh
File metadata and controls
226 lines (206 loc) · 7.62 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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
#!/bin/bash
# ============================================================================
# Universal Taubyte AI Setup Script
# Detects OS and runs the appropriate installation logic - ALL IN ONE FILE
# ============================================================================
echo "=========================================="
echo "Taubyte AI Setup - Universal Installer"
echo "=========================================="
echo ""
# Detect the operating system
detect_os() {
case "$(uname -s)" in
Linux*)
echo "linux"
;;
Darwin*)
echo "macos"
;;
CYGWIN*|MINGW*|MSYS*)
echo "windows"
;;
*)
echo "unknown"
;;
esac
}
# Function to check command availability (for Unix-like systems)
check_cmd() {
command -v "$1" >/dev/null 2>&1
}
OS=$(detect_os)
echo "Detected OS: $OS"
echo ""
# ============================================================================
# LINUX INSTALLATION
# ============================================================================
if [ "$OS" = "linux" ]; then
echo "Running Linux setup..."
echo ""
# Check for Go (Mandatory)
if ! check_cmd go; then
echo "[ERROR] Go is not installed."
echo "Go is a MANDATORY dependency for this project."
read -p "Would you like to install Go now? (y/n): " install_go
if [[ "$install_go" =~ ^[Yy]$ ]]; then
if check_cmd apt; then
echo "Installing Go using apt..."
sudo apt update && sudo apt install -y golang
elif check_cmd dnf; then
echo "Installing Go using dnf..."
sudo dnf install -y golang
elif check_cmd pacman; then
echo "Installing Go using pacman..."
sudo pacman -S --noconfirm go
else
echo "No supported package manager found (apt, dnf, pacman). Please install Go manually."
exit 1
fi
else
echo "Go is mandatory. Cannot proceed without it."
exit 1
fi
else
echo "[OK] Go is installed."
fi
# Check for Node.js (Recommended)
if ! check_cmd node; then
echo ""
echo "[NOTICE] Node.js is not installed."
echo "Node.js is NOT mandatory but is VERY NEEDED for full functionality."
read -p "Would you like to install Node.js now? (y/n): " install_node
if [[ "$install_node" =~ ^[Yy]$ ]]; then
if check_cmd apt; then
sudo apt install -y nodejs npm
elif check_cmd dnf; then
sudo dnf install -y nodejs
elif check_cmd pacman; then
sudo pacman -S --noconfirm nodejs npm
else
echo "No supported package manager found. Skipping Node.js installation."
fi
else
echo "Skipping Node.js installation."
fi
else
echo "[OK] Node.js is installed."
fi
echo ""
echo "Cloning github.com/taubyte/agents.doc..."
git clone https://github.com/taubyte/agents.doc
# ============================================================================
# MACOS INSTALLATION
# ============================================================================
elif [ "$OS" = "macos" ]; then
echo "Running macOS setup..."
echo ""
# Check for Go (Mandatory)
if ! check_cmd go; then
echo "[ERROR] Go is not installed."
echo "Go is a MANDATORY dependency for this project."
read -p "Would you like to install Go now? (y/n): " install_go
if [[ "$install_go" =~ ^[Yy]$ ]]; then
if check_cmd brew; then
brew install go
else
echo "Homebrew not found. Cannot auto-install. Please install Go manually."
exit 1
fi
else
echo "Go is mandatory. Cannot proceed without it."
exit 1
fi
else
echo "[OK] Go is installed."
fi
# Check for Node.js (Recommended)
if ! check_cmd node; then
echo ""
echo "[NOTICE] Node.js is not installed."
echo "Node.js is NOT mandatory but is VERY NEEDED for full functionality."
read -p "Would you like to install Node.js now? (y/n): " install_node
if [[ "$install_node" =~ ^[Yy]$ ]]; then
if check_cmd brew; then
brew install node
else
echo "Homebrew not found. Cannot auto-install Node.js."
fi
else
echo "Skipping Node.js installation."
fi
else
echo "[OK] Node.js is installed."
fi
echo ""
echo "Cloning github.com/taubyte/agents.doc..."
git clone https://github.com/taubyte/agents.doc
# ============================================================================
# WINDOWS INSTALLATION (Git Bash/WSL)
# ============================================================================
elif [ "$OS" = "windows" ]; then
echo "Running Windows setup..."
echo ""
echo "[NOTE] This script is running in a Unix-like environment (Git Bash/WSL)."
echo "[NOTE] For native Windows, some commands may not work as expected."
echo ""
# Check for Go (Mandatory)
if ! check_cmd go; then
echo "[ERROR] Go is not installed."
echo "Go is a MANDATORY dependency for this project."
echo ""
read -p "Would you like to install Go now? (Y/N): " install_go
if [[ "$install_go" =~ ^[Yy]$ ]]; then
echo "Installing Go via Winget..."
echo "[NOTE] This requires running in a proper Windows environment."
cmd.exe /c "winget install -e --id GoLang.Go"
if [ $? -ne 0 ]; then
echo "Failed to install Go. Please install it manually from https://go.dev/dl/"
exit 1
fi
echo "Go installed successfully. You may need to restart your terminal."
else
echo "Go is mandatory. Cannot proceed without it."
exit 1
fi
else
echo "[OK] Go is installed."
fi
# Check for Node.js (Recommended)
if ! check_cmd node; then
echo ""
echo "[NOTICE] Node.js is not installed."
echo "Node.js is NOT mandatory but is VERY NEEDED for full functionality."
echo ""
read -p "Would you like to install Node.js now? (Y/N): " install_node
if [[ "$install_node" =~ ^[Yy]$ ]]; then
echo "Installing Node.js via Winget..."
cmd.exe /c "winget install -e --id OpenJS.NodeJS"
if [ $? -ne 0 ]; then
echo "Failed to install Node.js. Proceeding without it..."
fi
else
echo "Skipping Node.js installation."
fi
else
echo "[OK] Node.js is installed."
fi
echo ""
echo "Cloning github.com/taubyte/agents.doc..."
git clone https://github.com/taubyte/agents.doc
# ============================================================================
# UNKNOWN OS
# ============================================================================
else
echo "[ERROR] Unsupported or unknown operating system."
echo "This script supports: Linux, macOS, and Windows (via Git Bash/WSL)"
echo ""
echo "Please install dependencies manually:"
echo " 1. Go (mandatory): https://go.dev/dl/"
echo " 2. Node.js (recommended): https://nodejs.org/"
echo " 3. Clone: git clone https://github.com/taubyte/agents.doc"
exit 1
fi
echo ""
echo "=========================================="
echo "Setup completed successfully!"
echo "=========================================="