install.sh
AArch64 (ARM64) architecture stringReferences curl flags and HTTP URL
SHA-25679c3d4d3f7d929dd1bc90f090c16cc45064fc755d50f2430510ec1a37dd328e0
Evidence
1#!/bin/sh
2# Mu installer — downloads and runs Mu with one command.
3# Usage: curl -fsSL https://micro.mu/install.sh | sh
4set -e
5
6REPO="micro/mu"
7INSTALL_DIR="${MU_INSTALL_DIR:-$HOME/.mu}"
8BIN_DIR="${MU_BIN_DIR:-$HOME/.local/bin}"
9
10# Detect OS and architecture
11OS=$(uname -s | tr '[:upper:]' '[:lower:]')
12ARCH=$(uname -m)
13case "$ARCH" in
14 x86_64|amd64) ARCH="amd64" ;;
15 aarch64|arm64) ARCH="arm64" ;;
16 *) echo "Unsupported architecture: $ARCH"; exit 1 ;;
17esac
18
19echo "Installing Mu for ${OS}/${ARCH}..."
20
21# Check for Go
22if command -v go >/dev/null 2>&1; then
23 echo "Go found — building from source..."
24 TMPDIR=$(mktemp -d)
25 git clone --depth 1 https://github.com/${REPO}.git "$TMPDIR/mu" 2>/dev/null
26 cd "$TMPDIR/mu"
27 go build -o mu .
28 mkdir -p "$BIN_DIR"
29 mv mu "$BIN_DIR/mu"
30 rm -rf "$TMPDIR"
31else
32 # Download prebuilt binary from GitHub releases
33 echo "Downloading prebuilt binary..."
34 LATEST=$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name"' | head -1 | cut -d'"' -f4)
35 if [ -z "$LATEST" ]; then
36 echo "No releases found. Install Go and run: go install github.com/${REPO}@latest"
37 exit 1
38 fi
39 URL="https://github.com/${REPO}/releases/download/${LATEST}/mu-${OS}-${ARCH}"
40 mkdir -p "$BIN_DIR"
41 # Say what went wrong. A release can exist and still have no binary attached
42 # to it — v1.5.0 did, because the cross-compile step failed before the upload
43 # ran — and with -s and set -e the only thing on screen was "Downloading
44 # prebuilt binary..." followed by nothing at all …
46:12… ry branch here now ends in a sentence and a way forward.
47 if ! curl -fsSL "$URL" -o "$BIN_DIR/mu"; then
48 rm -f "$BIN_DIR/mu"
49 echo ""
50 echo "No ${OS}/${ARCH} binary in ${LATEST}."
51 echo " ${URL}"
52 echo ""
53 echo "Install Go 1.26+ and …
54:25… https://github.com/${REPO}/issues"
55 exit 1
56 fi
57 chmod +x "$BIN_DIR/mu"
58fi
59
60# Create data directory
61mkdir -p "$INSTALL_DIR"
62
63# Add to PATH if needed
64case ":$PATH:" in
65 *":$BIN_DIR:"*) ;;
66 *)
67 SHELL_NAME=$(basename "$SHELL")
68 case "$SHELL_NAME" in
69 zsh) RC="$HOME/.zshrc" ;;
70 bash) RC="$HOME/.bashrc" ;;
71 *) RC="" ;;
72 esac
73 if [ -n "$RC" ] && ! grep -q "$BIN_DIR" "$RC" 2>/dev/null; then
74 echo "export PATH=\"$BIN_DIR:\$PATH\"" >> "$RC"
75 echo "Added $BIN_DIR to PATH in $RC"
76 fi
77 export PATH="$BIN_DIR:$PATH"
78 ;;
79esac
⋯5 lines
85echo ""
86echo " mu --serve"
87echo " # then open http://localhost:8080 — Mu walks you through"
88echo " # creating an admin account and picking an AI provider."
89echo ""
90echo " # Prefer the ter …