Synthesis Hackathon submission. Built on IronClaw fork. 26 tools: Locus payments (6), Uniswap DeFi (3), onchain reads (3), security scanning (2), wallet analytics (3), OpenRouter LLM (2), self-hosted scraping (3), portfolio (2), synthesis (2). 3 defense hooks: spending limits ($5/tx, $25/session), contract guard (SCONE-bench vulnerability patterns), credential guard (blocks private key/seed phrase leaks). Payment system (Polar.sh), landing page, license key gating (Free/Pro/ Unlimited tiers), brand rename from IronClaw to Steelbot. 9,669 lines of code. 3,665 tests passing. Zero clippy warnings. Real USDC transactions on Base chain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
129 lines
3.8 KiB
Bash
Executable File
129 lines
3.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Steelbot installer — downloads the correct binary for the current platform
|
|
# and verifies the installation.
|
|
#
|
|
# Usage:
|
|
# curl -sSL https://steelbot.dev/install.sh | bash
|
|
#
|
|
# Environment variables (optional):
|
|
# STEELBOT_VERSION — specific version to install (default: latest)
|
|
# INSTALL_DIR — destination directory (default: /usr/local/bin)
|
|
|
|
set -euo pipefail
|
|
|
|
REPO="ArhansSubasi/ironclaw"
|
|
BINARY_NAME="steelbot"
|
|
INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}"
|
|
|
|
# ── Detect OS ──────────────────────────────────────────────────────────
|
|
|
|
detect_os() {
|
|
case "$(uname -s)" in
|
|
Darwin) echo "apple-darwin" ;;
|
|
Linux) echo "unknown-linux-gnu" ;;
|
|
*)
|
|
echo "Error: Unsupported operating system: $(uname -s)" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# ── Detect architecture ───────────────────────────────────────────────
|
|
|
|
detect_arch() {
|
|
case "$(uname -m)" in
|
|
x86_64|amd64) echo "x86_64" ;;
|
|
arm64|aarch64) echo "aarch64" ;;
|
|
*)
|
|
echo "Error: Unsupported architecture: $(uname -m)" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# ── Resolve version ───────────────────────────────────────────────────
|
|
|
|
resolve_version() {
|
|
if [ -n "${STEELBOT_VERSION:-}" ]; then
|
|
echo "$STEELBOT_VERSION"
|
|
return
|
|
fi
|
|
|
|
local latest
|
|
latest=$(curl -sSL "https://api.github.com/repos/${REPO}/releases/latest" \
|
|
| grep '"tag_name"' \
|
|
| sed -E 's/.*"tag_name": *"([^"]+)".*/\1/')
|
|
|
|
if [ -z "$latest" ]; then
|
|
echo "Error: Could not determine latest version from GitHub." >&2
|
|
exit 1
|
|
fi
|
|
echo "$latest"
|
|
}
|
|
|
|
# ── Main ───────────────────────────────────────────────────────────────
|
|
|
|
main() {
|
|
echo "Steelbot Installer"
|
|
echo "=================="
|
|
echo
|
|
|
|
local os arch version target download_url tmp_dir
|
|
|
|
os=$(detect_os)
|
|
arch=$(detect_arch)
|
|
version=$(resolve_version)
|
|
target="${arch}-${os}"
|
|
|
|
echo " OS: $(uname -s)"
|
|
echo " Arch: ${arch}"
|
|
echo " Version: ${version}"
|
|
echo " Target: ${target}"
|
|
echo
|
|
|
|
download_url="https://github.com/${REPO}/releases/download/${version}/${BINARY_NAME}-${target}.tar.gz"
|
|
|
|
echo "Downloading ${download_url} ..."
|
|
|
|
tmp_dir=$(mktemp -d)
|
|
trap 'rm -rf "$tmp_dir"' EXIT
|
|
|
|
if ! curl -sSL --fail -o "${tmp_dir}/steelbot.tar.gz" "$download_url"; then
|
|
echo "Error: Download failed. Check that version ${version} has a release for ${target}." >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Extracting..."
|
|
tar -xzf "${tmp_dir}/steelbot.tar.gz" -C "${tmp_dir}"
|
|
|
|
echo "Installing to ${INSTALL_DIR}/${BINARY_NAME} ..."
|
|
|
|
# Create install directory if needed
|
|
if [ ! -d "$INSTALL_DIR" ]; then
|
|
mkdir -p "$INSTALL_DIR"
|
|
fi
|
|
|
|
# Move binary into place
|
|
if [ -w "$INSTALL_DIR" ]; then
|
|
mv "${tmp_dir}/${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}"
|
|
else
|
|
echo "(requires sudo for ${INSTALL_DIR})"
|
|
sudo mv "${tmp_dir}/${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}"
|
|
fi
|
|
|
|
chmod +x "${INSTALL_DIR}/${BINARY_NAME}"
|
|
|
|
# Verify
|
|
echo
|
|
if "${INSTALL_DIR}/${BINARY_NAME}" --version; then
|
|
echo
|
|
echo "Installation successful!"
|
|
echo "Run 'steelbot onboard' to get started."
|
|
else
|
|
echo "Error: Verification failed. The binary may not be compatible with your system." >&2
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
main "$@"
|