#!/bin/sh # acyclic CLI installer. Reads no input, writes one binary, prints where it went. # curl -fsSL https://acyclic-website.pages.dev/install.sh | sh # curl -fsSL https://acyclic-website.pages.dev/install.sh | ACYCLIC_INSTALL_DIR=/usr/local/bin sh set -eu version="0.0.9" 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-website.pages.dev/dl/0.0.9/acyclic-0.0.9-aarch64-apple-darwin.tar.gz"; sha="bde40d8dee5581910dfa81f362224eb1c2df72da7e8789d333ff8ac3a1e08cfd" ;; Darwin:x86_64) triple="x86_64-apple-darwin"; url="https://acyclic-website.pages.dev/dl/0.0.9/acyclic-0.0.9-x86_64-apple-darwin.tar.gz"; sha="9d33bf46d59535a2aea6857b8f0a7637ff17e5308c32d91b2ae6b88d035a34f6" ;; Linux:x86_64) triple="x86_64-unknown-linux-musl"; url="https://acyclic-website.pages.dev/dl/0.0.9/acyclic-0.0.9-x86_64-unknown-linux-musl.tar.gz"; sha="ab67ab6b13b1cd5540b401fbdb2ba9c855d98baba3467fc4099ebfd2f6cfc9c3" ;; Linux:aarch64) triple="aarch64-unknown-linux-musl"; url="https://acyclic-website.pages.dev/dl/0.0.9/acyclic-0.0.9-aarch64-unknown-linux-musl.tar.gz"; sha="908bc2ff6a4e9466e111ce8d965b10bdd402e04f9fcbb497d94ce103a9cbc1c2" ;; *) 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-website.pages.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-website.pages.dev" >&2 echo "Then: acyclic swarm run --task \"fix the flaky test\" --dir . --watch" >&2