This repository was archived by the owner on Mar 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·190 lines (161 loc) · 4.63 KB
/
install.sh
File metadata and controls
executable file
·190 lines (161 loc) · 4.63 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
#!/bin/bash
#
# AgentsMesh Runner Installation Script
#
# Usage:
# curl -fsSL https://raw.githubusercontent.com/AgentsMesh/AgentsMeshRunner/main/install.sh | bash
#
# Options:
# VERSION=v0.1.1 curl -fsSL ... | bash # Install specific version
#
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Configuration
GITHUB_REPO="AgentsMesh/AgentsMeshRunner"
BINARY_NAME="agentsmesh-runner"
INSTALL_DIR="/usr/local/bin"
# Get latest version if not specified
VERSION="${VERSION:-}"
info() {
echo -e "${BLUE}[INFO]${NC} $1"
}
success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
warn() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
error() {
echo -e "${RED}[ERROR]${NC} $1"
exit 1
}
# Detect OS and architecture
detect_platform() {
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m)"
case "$OS" in
linux)
OS="linux"
;;
darwin)
OS="darwin"
;;
mingw*|msys*|cygwin*)
OS="windows"
;;
*)
error "Unsupported operating system: $OS"
;;
esac
case "$ARCH" in
x86_64|amd64)
ARCH="amd64"
;;
aarch64|arm64)
ARCH="arm64"
;;
*)
error "Unsupported architecture: $ARCH"
;;
esac
# macOS uses universal binary
if [ "$OS" = "darwin" ]; then
ARCH="all"
fi
info "Detected platform: ${OS}/${ARCH}"
}
# Get the latest version from GitHub
get_latest_version() {
if [ -n "$VERSION" ]; then
info "Using specified version: $VERSION"
return
fi
info "Fetching latest version..."
VERSION=$(curl -fsSL "https://api.github.com/repos/${GITHUB_REPO}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [ -z "$VERSION" ]; then
error "Failed to get latest version"
fi
info "Latest version: $VERSION"
}
# Download and install
install() {
local version_number="${VERSION#v}"
local filename="agentsmesh-runner_${version_number}_${OS}_${ARCH}.tar.gz"
local download_url="https://github.com/${GITHUB_REPO}/releases/download/${VERSION}/${filename}"
info "Downloading ${filename}..."
# Create temp directory
TMP_DIR=$(mktemp -d)
trap "rm -rf $TMP_DIR" EXIT
# Download
if ! curl -fsSL "$download_url" -o "$TMP_DIR/runner.tar.gz"; then
error "Failed to download from $download_url"
fi
# Extract
info "Extracting..."
tar -xzf "$TMP_DIR/runner.tar.gz" -C "$TMP_DIR"
# Install
info "Installing to ${INSTALL_DIR}..."
if [ -w "$INSTALL_DIR" ]; then
mv "$TMP_DIR/$BINARY_NAME" "$INSTALL_DIR/"
chmod +x "$INSTALL_DIR/$BINARY_NAME"
else
warn "Need sudo to install to $INSTALL_DIR"
sudo mv "$TMP_DIR/$BINARY_NAME" "$INSTALL_DIR/"
sudo chmod +x "$INSTALL_DIR/$BINARY_NAME"
fi
success "Installed $BINARY_NAME to $INSTALL_DIR"
}
# Verify installation
verify() {
if command -v "$BINARY_NAME" &> /dev/null; then
success "Installation verified!"
echo ""
"$BINARY_NAME" version
else
warn "Binary installed but not in PATH. Add $INSTALL_DIR to your PATH."
fi
}
# Print next steps
print_next_steps() {
echo ""
echo -e "${GREEN}============================================${NC}"
echo -e "${GREEN} AgentsMesh Runner installed successfully!${NC}"
echo -e "${GREEN}============================================${NC}"
echo ""
echo "Next steps:"
echo ""
echo " 1. Register the runner with your AgentsMesh server:"
echo " # Global: https://api.agentsmesh.ai (or your own server address)"
echo -e " ${BLUE}agentsmesh-runner register --server <SERVER_URL> --token YOUR_TOKEN${NC}"
echo ""
echo " 2. Start the runner:"
echo -e " ${BLUE}agentsmesh-runner run${NC}"
echo ""
echo " Or run in desktop mode (with system tray):"
echo -e " ${BLUE}agentsmesh-runner desktop${NC}"
echo ""
echo "For more information, visit: https://agentsmesh.ai/docs/runner"
echo ""
}
# Main
main() {
echo ""
echo " ___ _ __ __ _ "
echo " / _ \\ __ _ ___ _ _ | |_ ___|| \\/ | ___ __| |_ "
echo "| |_| / _\` |/ -_) ' \\| _(_-<|| |\\/| |/ -_)(_-<| ' \\ "
echo " \\__,_\\__, |\\___|_||_|\\__/__/||_| |_|\\___|/__/|_||_| "
echo " |___/ "
echo " Runner Installer"
echo ""
detect_platform
get_latest_version
install
verify
print_next_steps
}
main "$@"