#!/usr/bin/env bash # AgentLayer's setup guide: curl -fsSL https://agentlayer.one/install.sh | bash # It checks this machine and shows each step to do. It runs nothing itself: you run every command. # By hand instead: https://agentlayer.one/docs/getting-started/install [ -n "${BASH_VERSION:-}" ] || { echo "install: pipe this to bash, not sh." >&2; exit 1; } set -euo pipefail RELEASE="v1.0.9" SOURCE_URL="https://raw.githubusercontent.com/AgentLayer1/agentlayer-agent/$RELEASE/install" DOCS_URL="https://agentlayer.one/docs/getting-started/install" die() { printf 'install: %s\n' "$1" >&2 exit "${2:-1}" } guide_for_this_system() { case "$(uname -s)" in Darwin) printf 'macos' ;; Linux) printf 'linux' ;; MINGW* | MSYS* | CYGWIN*) die "On Windows, run this in PowerShell instead: irm https://agentlayer.one/install.ps1 | iex" ;; *) die "This guide covers macOS and Linux. Elsewhere, follow $DOCS_URL" ;; esac } # From a checkout the guides sit beside this file; piped from curl, they're fetched from the same repository. local_guides() { local here [[ -n ${BASH_SOURCE[0]:-} && -f ${BASH_SOURCE[0]} ]] || return 1 here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/install" [[ -f $here/lib.sh ]] || return 1 printf '%s' "$here" } fetch_guides() { local guide=$1 dir=$2 file for file in lib.sh "$guide.sh"; do curl --proto '=https' --proto-redir '=https' --tlsv1.2 -fsSL "$SOURCE_URL/$file" -o "$dir/$file" /dev/null; then bash "$dir/$guide.sh" "$@"