-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
55 lines (47 loc) · 1.32 KB
/
install.sh
File metadata and controls
55 lines (47 loc) · 1.32 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
#!/bin/bash
set -e
echo "🚀 Installing Kodus CLI..."
# Detect OS
OS="$(uname -s)"
case "${OS}" in
Linux*) MACHINE=Linux;;
Darwin*) MACHINE=Mac;;
*) MACHINE="UNKNOWN:${OS}"
esac
if [ "$MACHINE" = "UNKNOWN:${OS}" ]; then
echo "❌ Unsupported OS: ${OS}"
exit 1
fi
# Check if npm is installed
if ! command -v npm &> /dev/null; then
echo "❌ npm is required but not installed."
echo "Please install Node.js from https://nodejs.org"
exit 1
fi
# Check Node.js major version (Kodus CLI requires Node.js 20+)
NODE_VERSION="$(node -v 2>/dev/null || true)"
if [ -z "$NODE_VERSION" ]; then
echo "❌ Node.js is required but not installed."
echo "Please install Node.js 20+ from https://nodejs.org"
exit 1
fi
NODE_MAJOR="$(echo "$NODE_VERSION" | sed -E 's/^v([0-9]+).*/\1/')"
if [ "$NODE_MAJOR" -lt 20 ]; then
echo "❌ Node.js $NODE_VERSION detected. Kodus CLI requires Node.js 20+."
echo "Please upgrade Node.js from https://nodejs.org"
exit 1
fi
# Install globally
echo "📦 Installing @kodus/cli..."
npm install -g @kodus/cli
# Verify installation
if command -v kodus &> /dev/null; then
echo "✅ Kodus CLI installed successfully!"
echo ""
kodus --version
echo ""
echo "Get started with: kodus auth login"
else
echo "❌ Installation failed"
exit 1
fi