#!/bin/sh # aipilot installer for macOS and Linux. # # curl -fsSL https://aipilot-api.ouedernidev.workers.dev/install.sh | sh # # Non-interactive: curl -fsSL .../install.sh | AIPILOT_LICENSE=AIP-XXXX-XXXX-XXXX-XXXX AIPILOT_YES=1 sh # # Installs the 'aipilot' command to ~/.aipilot/bin, activates this computer with your # license key and configures Claude Code and OpenCode (Claude Desktop on macOS needs one # manual step, which it prints). 'aipilot uninstall' undoes everything. No sudo needed. set -eu BRAND="aipilot" BASE_URL="${AIPILOT_URL:-https://aipilot-api.ouedernidev.workers.dev}" APP_DIR="${AIPILOT_HOME:-$HOME/.aipilot}" BIN="$APP_DIR/bin" printf '\n%s installer\n' "$BRAND" command -v curl >/dev/null 2>&1 || { echo "curl is required"; exit 1; } command -v python3 >/dev/null 2>&1 || { echo "python3 is required (macOS: run 'xcode-select --install')"; exit 1; } mkdir -p "$BIN" curl -fsSL "$BASE_URL/aipilot.sh" -o "$BIN/aipilot" chmod +x "$BIN/aipilot" [ -f "$APP_DIR/config.json" ] || printf '{"baseUrl": "%s"}\n' "$BASE_URL" > "$APP_DIR/config.json" printf ' [ok] Installed the aipilot command to %s\n' "$BIN" if [ -z "${AIPILOT_SKIP_PATH:-}" ]; then case ":$PATH:" in *":$BIN:"*) ;; *) line="export PATH=\"\$HOME/.aipilot/bin:\$PATH\" # aipilot" for rc in "$HOME/.zshrc" "$HOME/.bashrc"; do if [ -f "$rc" ] || [ "$(basename "${SHELL:-}")" = "$(basename "$rc" | sed 's/^\.//; s/rc$//')" ]; then grep -q '# aipilot' "$rc" 2>/dev/null || printf '\n%s\n' "$line" >> "$rc" fi done printf ' [ok] Added to your PATH (open a new terminal to use aipilot)\n' ;; esac fi yes_flag=""; [ -n "${AIPILOT_YES:-}" ] && yes_flag="--yes" "$BIN/aipilot" activate "${AIPILOT_LICENSE:-}" || { echo "Activation failed - check the key and run: aipilot activate "; exit 1; } "$BIN/aipilot" setup $yes_flag