#!/bin/sh # acyclic CLI installer. Reads no input, writes one binary, prints where it went. # curl -fsSL https://acyclic.dev/install.sh | sh # curl -fsSL https://acyclic.dev/install.sh | ACYCLIC_INSTALL_DIR=/usr/local/bin sh set -eu version="0.0.6" os="$(uname -s)" arch="$(uname -m)" # Apple reports arm64; Linux reports aarch64. Normalise to what the manifest uses per-OS. if [ "$os" = "Linux" ] && [ "$arch" = "arm64" ]; then arch="aarch64"; fi if [ "$os" = "Darwin" ] && [ "$arch" = "aarch64" ]; then arch="arm64"; fi triple="" url="" sha="" case "$os:$arch" in Darwin:arm64) triple="aarch64-apple-darwin"; url="https://acyclic.dev/dl/0.0.6/acyclic-0.0.6-aarch64-apple-darwin.tar.gz"; sha="ad2d08a8760388d722920b0f55dae8130582336e55b6da26954983d0877a52d9" ;; Darwin:x86_64) triple="x86_64-apple-darwin"; url="https://acyclic.dev/dl/0.0.6/acyclic-0.0.6-x86_64-apple-darwin.tar.gz"; sha="5622a77b80c5b08c1ba6312861a3b5967da860e7be491738845bf4cc542254e9" ;; Linux:x86_64) triple="x86_64-unknown-linux-musl"; url="https://acyclic.dev/dl/0.0.6/acyclic-0.0.6-x86_64-unknown-linux-musl.tar.gz"; sha="f636f7dcb8055cbfb3eb4fa4166d76a0513e5f33a08f493b40c076db1065f9ec" ;; Linux:aarch64) triple="aarch64-unknown-linux-musl"; url="https://acyclic.dev/dl/0.0.6/acyclic-0.0.6-aarch64-unknown-linux-musl.tar.gz"; sha="609b13ae4bec6b504a4ecd4c33c89c50e18559c9fb92bddea8eff9a30ff59641" ;; *) echo "acyclic: no published build for $os $arch." >&2 echo "Supported: Darwin arm64, Darwin x86_64, Linux x86_64, Linux aarch64" >&2 echo "You can use swarms over MCP with nothing installed: https://acyclic.dev/dashboard" >&2 exit 1 ;; esac dir="${ACYCLIC_INSTALL_DIR:-$HOME/.local/bin}" tmp="$(mktemp -d)" # Clean up whatever happens, including a failed download or a failed checksum. trap 'rm -rf "$tmp"' EXIT INT TERM echo "acyclic $version — downloading $triple" >&2 if command -v curl >/dev/null 2>&1; then curl -fsSL "$url" -o "$tmp/archive.tar.gz" elif command -v wget >/dev/null 2>&1; then wget -qO "$tmp/archive.tar.gz" "$url" else echo "acyclic: need curl or wget." >&2 exit 1 fi # The expected digest is baked in above, from the same manifest that produced the URL, so there is # no second request to fail and nothing to skip. if command -v sha256sum >/dev/null 2>&1; then actual="$(sha256sum "$tmp/archive.tar.gz" | cut -d' ' -f1)" elif command -v shasum >/dev/null 2>&1; then actual="$(shasum -a 256 "$tmp/archive.tar.gz" | cut -d' ' -f1)" else actual="" fi if [ -z "$actual" ]; then echo "acyclic: no sha256sum or shasum available; installing unverified." >&2 elif [ "$actual" != "$sha" ]; then echo "acyclic: checksum mismatch — refusing to install." >&2 echo " expected $sha" >&2 echo " actual $actual" >&2 exit 1 else echo "acyclic: checksum verified" >&2 fi tar -xzf "$tmp/archive.tar.gz" -C "$tmp" [ -f "$tmp/acyclic" ] || { echo "acyclic: archive did not contain the binary." >&2; exit 1; } mkdir -p "$dir" mv "$tmp/acyclic" "$dir/acyclic" chmod +x "$dir/acyclic" echo "" >&2 echo "acyclic installed to $dir/acyclic" >&2 case ":$PATH:" in *":$dir:"*) ;; *) echo " $dir is not on your PATH — add it, or run $dir/acyclic directly." >&2 ;; esac echo "" >&2 echo "Next: acyclic swarm login --site https://acyclic.dev" >&2 echo "Then: acyclic swarm run --task \"fix the flaky test\" --dir . --watch" >&2