#!/bin/sh # raea's installer: curl -fsSL https://raea.io/install | sh # # Puts the raea engine (the `raea` CLI that renders, plays and checks compositions written in React and # TypeScript) under ~/.raea, links it into ~/.local/bin, and adds raea's agent skills to ~/.claude/skills so a coding # agent (Claude Code, or anything that reads that folder) knows how to write and render with it. Run it again to # update. macOS on Apple Silicon, or Linux on x86_64 (Windows: install.ps1 beside this, in PowerShell). # # RAEA_VERSION=0.1.0-canary.1 picks a release (the latest by default); RAEA_PREFIX moves ~/.raea; RAEA_NO_SKILLS=1 # leaves the skills out; RAEA_DOWNLOAD serves the releases from somewhere else (a mirror, or a local folder to test). set -eu repo="shinyobjectz/raea" prefix="${RAEA_PREFIX:-$HOME/.raea}" bindir="$HOME/.local/bin" say() { printf '%s\n' "raea: $*"; } fail() { printf '%s\n' "raea: $*" >&2; exit 1; } case "$(uname -s)/$(uname -m)" in Darwin/arm64) platform=macos-arm64 ;; Darwin/*) fail "raea needs Apple Silicon (this Mac is $(uname -m))." ;; Linux/x86_64) platform=linux-x86_64 ;; Linux/*) fail "raea runs on x86_64 Linux for now (this is $(uname -m))." ;; MINGW*|MSYS*|CYGWIN*) fail "on Windows, install raea from PowerShell: irm https://raea.io/install.ps1 | iex" ;; *) fail "raea runs on macOS, Linux and Windows for now (this is $(uname -s))." ;; esac command -v curl >/dev/null || fail "curl is needed." if [ -n "${RAEA_VERSION:-}" ]; then tag="v$RAEA_VERSION" else tag=$(curl -fsSL "https://api.github.com/repos/$repo/releases?per_page=1" | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p' | head -n 1) [ -n "$tag" ] || fail "couldn't find a release of $repo." fi version="${tag#v}" asset="raea-$version-$platform.tar.gz" url="${RAEA_DOWNLOAD:-https://github.com/$repo/releases/download}/$tag/$asset" tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT say "downloading raea $version" curl -fL --progress-bar "$url" -o "$tmp/$asset" || fail "couldn't download $url" curl -fsSL "$url.sha256" -o "$tmp/$asset.sha256" || fail "couldn't download the checksum" if command -v sha256sum >/dev/null; then sum="sha256sum"; else sum="shasum -a 256"; fi (cd "$tmp" && $sum -c "$asset.sha256" >/dev/null) || fail "the download's checksum doesn't match." tar -xzf "$tmp/$asset" -C "$tmp" # replace the old install whole (a release's files go together) mkdir -p "$prefix" rm -rf "$prefix/bin" "$prefix/share" mv "$tmp/raea/bin" "$tmp/raea/share" "$prefix/" xattr -dr com.apple.quarantine "$prefix" 2>/dev/null || true mkdir -p "$bindir" # raea is the command (releases before 10-24 named it raea-motion: their `raea` links to that); an earlier install's # raea-motion link goes if [ -e "$prefix/bin/raea" ]; then ln -sf "$prefix/bin/raea" "$bindir/raea"; else ln -sf "$prefix/bin/raea-motion" "$bindir/raea"; fi if [ -L "$bindir/raea-motion" ] && [ -e "$prefix/bin/raea" ]; then rm -f "$bindir/raea-motion"; fi say "installed raea $version in $prefix (linked from $bindir)" # Linux: kanji and kana come from a system CJK font (the bundled faces are Latin), as on a Mac; without one raea warns # and draws those characters as boxes if [ "$platform" = linux-x86_64 ] && ! { command -v fc-list >/dev/null && [ -n "$(fc-list :lang=ja 2>/dev/null)" ]; }; then say "no CJK font found: Japanese, Chinese and Korean text will draw as boxes. Install one, e.g.: sudo apt install fonts-noto-cjk" fi if [ -z "${RAEA_NO_SKILLS:-}" ]; then skills="$HOME/.claude/skills" mkdir -p "$skills" for s in "$prefix/share/raea/skills/"*; do n=$(basename "$s") rm -rf "$skills/$n" cp -R "$s" "$skills/$n" done say "added the raea and raea-bevy skills to $skills" fi case ":$PATH:" in *":$bindir:"*) ;; *) say "add $bindir to your PATH, e.g.: echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> ~/.$(basename "${SHELL:-sh}")rc" ;; esac say "try it: raea render your-composition.tsx -o out.mp4" say "agents: ask your coding agent to make something with raea; the skill tells it how."