#!/bin/sh # Fleet installer — https://fleetctl.ai/install # # Usage (the advertised one): # curl -fsSL https://fleetctl.ai/install | sh # # What this does: # 1. Detects your OS and architecture (darwin/linux × amd64/arm64) # 2. Fetches the latest fleet version from https://fleetctl.ai/releases/latest # 3. Downloads the matching prebuilt binary tar.gz # 4. Verifies its SHA-256 against the published SHA256SUMS # 5. Extracts the binary and installs it to ~/.local/bin/fleet # 6. Prints the next step: `fleet admin register` to connect your account # # Fleet is a paid product. The binary is free to install and inspect, but # every command that starts agents or daemons refuses to run until you have # registered an active entitlement. This script NEVER bypasses license # enforcement. # # Start a trial at https://app.fleetctl.ai set -eu # ────────────────────────────────────────────────────────────────────── # Configuration # ────────────────────────────────────────────────────────────────────── RELEASE_BASE="${RELEASE_BASE:-https://fleetctl.ai/releases}" INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}" # ────────────────────────────────────────────────────────────────────── # Output helpers # ────────────────────────────────────────────────────────────────────── if [ -t 1 ] && [ -z "${NO_COLOR:-}" ]; then BOLD="$(printf '\033[1m')" DIM="$(printf '\033[2m')" RED="$(printf '\033[31m')" GREEN="$(printf '\033[32m')" YELLOW="$(printf '\033[33m')" BLUE="$(printf '\033[34m')" RESET="$(printf '\033[0m')" else BOLD=""; DIM=""; RED=""; GREEN=""; YELLOW=""; BLUE=""; RESET="" fi step() { printf "%s==>%s %s\n" "$BLUE$BOLD" "$RESET$BOLD" "$1$RESET"; } ok() { printf "%s ✓%s %s\n" "$GREEN" "$RESET" "$1"; } warn() { printf "%s !%s %s\n" "$YELLOW" "$RESET" "$1"; } fail() { printf "%s ✗%s %s\n" "$RED" "$RESET" "$1" >&2; exit 1; } info() { printf "%s %s%s\n" "$DIM" "$1" "$RESET"; } # ────────────────────────────────────────────────────────────────────── # Header # ────────────────────────────────────────────────────────────────────── cat <
/dev/null 2>&1; then DL="curl -fsSL" elif command -v wget >/dev/null 2>&1; then DL="wget -qO-" else fail "Neither curl nor wget found. Install one and re-run the installer." fi ok "download tool: ${DL%% *}" if command -v shasum >/dev/null 2>&1; then SHA="shasum -a 256" elif command -v sha256sum >/dev/null 2>&1; then SHA="sha256sum" else fail "Neither shasum nor sha256sum found. Install one and re-run the installer." fi ok "checksum tool: ${SHA%% *}" echo # ────────────────────────────────────────────────────────────────────── # Fetch latest version pointer # ────────────────────────────────────────────────────────────────────── step "Resolving latest version" if [ -n "${FLEET_VERSION:-}" ]; then VERSION="$FLEET_VERSION" info "FLEET_VERSION override: $VERSION" else VERSION="$($DL "${RELEASE_BASE}/latest" 2>/dev/null | tr -d '[:space:]')" if [ -z "$VERSION" ]; then fail "Could not fetch ${RELEASE_BASE}/latest. Is fleetctl.ai reachable?" fi fi ok "latest: v${VERSION}" echo # ────────────────────────────────────────────────────────────────────── # Download binary + checksums # ────────────────────────────────────────────────────────────────────── step "Downloading fleet v${VERSION} for ${PLATFORM}" ARCHIVE="fleet_${PLATFORM}.tar.gz" ARCHIVE_URL="${RELEASE_BASE}/v${VERSION}/${ARCHIVE}" SUMS_URL="${RELEASE_BASE}/v${VERSION}/SHA256SUMS" TMP_DIR="$(mktemp -d)" trap 'rm -rf "$TMP_DIR"' EXIT info "$ARCHIVE_URL" if ! $DL "$ARCHIVE_URL" > "$TMP_DIR/$ARCHIVE" 2>/dev/null; then fail "Failed to download $ARCHIVE_URL" fi # Verify checksum $DL "$SUMS_URL" 2>/dev/null > "$TMP_DIR/SHA256SUMS" || { fail "Failed to download $SUMS_URL" } EXPECTED="$(grep " ${ARCHIVE}\$" "$TMP_DIR/SHA256SUMS" | awk '{print $1}')" if [ -z "$EXPECTED" ]; then fail "Checksum for ${ARCHIVE} not found in SHA256SUMS" fi ACTUAL="$(cd "$TMP_DIR" && $SHA "$ARCHIVE" | awk '{print $1}')" if [ "$EXPECTED" != "$ACTUAL" ]; then fail "Checksum mismatch for ${ARCHIVE} expected: $EXPECTED actual: $ACTUAL This is a hard failure. Report it at https://fleetctl.ai/#contact" fi ok "sha256 verified: ${ACTUAL}" echo # ────────────────────────────────────────────────────────────────────── # Extract + install # ────────────────────────────────────────────────────────────────────── step "Installing to ${INSTALL_DIR}/fleet" mkdir -p "$INSTALL_DIR" tar -xzf "$TMP_DIR/$ARCHIVE" -C "$TMP_DIR" if [ ! -f "$TMP_DIR/fleet" ]; then fail "Archive did not contain a 'fleet' binary. This is a packaging error." fi chmod +x "$TMP_DIR/fleet" mv "$TMP_DIR/fleet" "$INSTALL_DIR/fleet" ok "installed: $INSTALL_DIR/fleet" echo # ────────────────────────────────────────────────────────────────────── # Verify # ────────────────────────────────────────────────────────────────────── step "Verifying installation" if ! "$INSTALL_DIR/fleet" version >/dev/null 2>&1; then fail "The installed binary did not respond to 'fleet version'. Try running: $INSTALL_DIR/fleet version" fi INSTALLED_VERSION="$("$INSTALL_DIR/fleet" version 2>/dev/null | awk '{print $2}')" ok "fleet $INSTALLED_VERSION responds to commands" echo # ────────────────────────────────────────────────────────────────────── # Next steps # ────────────────────────────────────────────────────────────────────── PATH_HINT="" case ":$PATH:" in *":$INSTALL_DIR:"*) ;; *) PATH_HINT=" ${DIM}1a.${RESET} Add ${INSTALL_DIR} to your PATH: ${BLUE}export PATH=\"\$PATH:${INSTALL_DIR}\"${RESET} ${DIM}Add that line to your ~/.zshrc or ~/.bashrc to make it permanent.${RESET} " ;; esac cat <