Install

install.sh

Read it before you run it.

This is the whole script behind curl -fsSL https://prokinetic.app/install.sh | bash. Developer preview, not yet notarized — that's why it installs with a script instead of a .dmg. It never uses sudo.

[ 01 ]What it does

Five steps, in order.

  1. 01

    Checks your Mac's macOS version. That's all: it doesn't look for Xcode, which only Tuner needs.

  2. 02

    Downloads the newest release from GitHub, then checks its SHA-256 against the release manifest and its code signature against our Apple team ID. If either fails, nothing is installed.

  3. 03

    If ProKinetic is open, asks you to quit it. It never quits it for you.

  4. 04

    Puts ProKinetic.app in /Applications (~/Applications if you can't write to /Applications) and registers it with macOS.

  5. 05

    Offers to add ProKinetic's MCP server to Claude Code, for your user. Say no and nothing changes.

[ 02 ]Source

The script.

The same file /install.sh serves: the installer attached to the newest release.

SHA-256 327e686c52d2733c6d814c0e0a4f250a67d72515cd8701a1d617324c3506756b

install.shDownload
#!/bin/bash
#
# ProKinetic installer.
#
#   curl -fsSL https://prokinetic.app/install.sh | bash
#
# Installs ProKinetic.app, or updates it — run it again any time. To remove it:
#
#   curl -fsSL https://prokinetic.app/install.sh | bash -s -- --uninstall
#
# What it does, in order (it's short; read it before you run it):
#   1. checks this Mac's macOS version
#   2. downloads the latest release, then checks its SHA-256 and its code
#      signature before anything is installed
#   3. if ProKinetic is open, asks you to quit it (it never quits it for you)
#   4. puts the app in /Applications (~/Applications if you can't write to
#      /Applications) and registers it with macOS
#   5. offers to add ProKinetic's MCP server to Claude Code
# No sudo, and nothing outside the app and, if you say yes, your Claude Code
# MCP list.
#
# Options:
#   --uninstall   move ProKinetic to the Trash
#   --dir DIR     install into DIR instead of /Applications
#   --reinstall   install even when this version is already there
#   --no-open     don't open ProKinetic afterwards
#   --yes, -y     don't ask; take each question's default
#
set -euo pipefail

# Where releases live: each GitHub release carries latest.json, the zip and
# this script. PROKINETIC_MANIFEST_URL points elsewhere (a staging release, a
# local file:// for testing).
RELEASES_REPO="tonyDeesign/prokinetic-releases"
MANIFEST_URL="${PROKINETIC_MANIFEST_URL:-https://github.com/$RELEASES_REPO/releases/latest/download/latest.json}"

# Apple team IDs whose signature this installer accepts. Hard-coded here
# rather than read from the manifest, so a tampered download host can't
# vouch for its own build.
TEAM_IDS="HNZAM4C393"

APP_NAME="ProKinetic.app"
BUNDLE_ID="com.prokinetic.studio"
SITE="https://prokinetic.app"
LSREGISTER="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister"

UNINSTALL=0
DEST_DIR=""
REINSTALL=0
OPEN_AFTER=1
ASSUME_YES=0

# ---------------------------------------------------------------------------
# Output

if [ -t 1 ]; then
  BOLD=$'\033[1m'; DIM=$'\033[2m'; RED=$'\033[31m'; YELLOW=$'\033[33m'; GREEN=$'\033[32m'; RESET=$'\033[0m'
else
  BOLD=""; DIM=""; RED=""; YELLOW=""; GREEN=""; RESET=""
fi

say()  { printf '%s\n' "$*"; }
step() { printf '%s==>%s %s\n' "$BOLD" "$RESET" "$*"; }
note() { printf '    %s\n' "$*"; }
warn() { printf '%s!%s %s\n' "$YELLOW" "$RESET" "$*" >&2; }
die()  { printf '%sError:%s %s\n' "$RED" "$RESET" "$*" >&2; exit 1; }

# A terminal to ask on. When piped from curl, stdin is this script, so
# questions go to /dev/tty instead.
has_tty() { [ "$ASSUME_YES" -eq 0 ] && { : </dev/tty; } 2>/dev/null; }

# ask "Question?" y|n — succeeds on yes. With no terminal, or --yes, the
# default answers.
ask() {
  local question="$1" default="$2" hint reply
  if [ "$default" = y ]; then hint="[Y/n]"; else hint="[y/N]"; fi
  if ! has_tty; then [ "$default" = y ]; return; fi
  printf '%s %s ' "$question" "$hint" >/dev/tty
  read -r reply </dev/tty || reply=""
  case "$reply" in
    [Yy]*) return 0 ;;
    [Nn]*) return 1 ;;
    *) [ "$default" = y ] ;;
  esac
}

# ---------------------------------------------------------------------------
# Helpers

# version_ge A B — true when dotted version A >= B.
version_ge() {
  local IFS=.
  local a=($1) b=($2) i x y
  for i in 0 1 2; do
    x="${a[$i]:-0}"; y="${b[$i]:-0}"
    if ((10#$x > 10#$y)); then return 0; fi
    if ((10#$x < 10#$y)); then return 1; fi
  done
  return 0
}

manifest() { plutil -extract "$1" raw -o - "$MANIFEST" 2>/dev/null; }
info_plist() { plutil -extract "$2" raw -o - "$1/Contents/Info.plist" 2>/dev/null; }

# The copy already installed, if any: --dir, then /Applications, then
# ~/Applications.
installed_app() {
  local dir
  for dir in ${DEST_DIR:+"$DEST_DIR"} /Applications "$HOME/Applications"; do
    if [ -d "$dir/$APP_NAME" ]; then printf '%s\n' "$dir/$APP_NAME"; return 0; fi
    [ -n "$DEST_DIR" ] && return 1
  done
  return 1
}

is_running() { pgrep -f -- "^$1/Contents/MacOS/ProKinetic" >/dev/null 2>&1; }

# Waits for the user to quit the copy at $1. Never quits it for them: they may
# have unsaved work.
wait_for_quit() {
  local app="$1"
  is_running "$app" || return 0
  has_tty || die "ProKinetic is open. Quit it, then run the installer again."
  say "ProKinetic is open. Save your work, quit it (⌘Q), then press Return. (Ctrl-C cancels.)"
  while is_running "$app"; do
    read -r _ </dev/tty || die "ProKinetic is still open."
    if is_running "$app"; then say "It's still open — quit ProKinetic, then press Return."; fi
  done
}

register() {
  [ "${PROKINETIC_SKIP_REGISTER:-0}" = 1 ] && return 0
  [ -x "$LSREGISTER" ] && "$LSREGISTER" "$@" >/dev/null 2>&1 || true
}

# ---------------------------------------------------------------------------
# Checks

check_mac() {
  [ "$(uname -s)" = Darwin ] || die "ProKinetic is a Mac app."
  local have need
  have="$(sw_vers -productVersion)"
  need="$(manifest minimumSystemVersion || echo 0)"
  version_ge "$have" "$need" || die "ProKinetic needs macOS $need or later; this Mac has $have."
}

# No Xcode check here, on purpose: Motion Studio needs nothing beyond macOS, so
# a designer installs without being told about tools they'll never use. Tuner
# compiles SwiftUI and Metal on this Mac and needs Xcode for it; the site's
# requirements say so. (Running xcrun here would also make macOS offer to
# install the Command Line Tools on a Mac without them.)

# ---------------------------------------------------------------------------
# Claude Code

connect_claude_code() {
  local app="$1" mcp current
  mcp="$app/Contents/MacOS/prokinetic-mcp"
  [ -x "$mcp" ] || return 0

  if ! command -v claude >/dev/null 2>&1; then
    note "With Claude Code installed, ProKinetic's co-pilot and MCP tools work with it — run this installer again afterwards to connect them."
    return 0
  fi

  if current="$(claude mcp get prokinetic 2>/dev/null)"; then
    if printf '%s' "$current" | grep -qF "$mcp"; then
      note "Claude Code is connected to ProKinetic."
    else
      note "Claude Code's 'prokinetic' MCP server runs a different copy. To use this one:"
      note "  claude mcp remove prokinetic -s user && claude mcp add --scope user prokinetic -- \"$mcp\""
    fi
    return 0
  fi

  if ask "Connect ProKinetic to Claude Code? (adds the 'prokinetic' MCP server for your user)" y; then
    if claude mcp add --scope user prokinetic -- "$mcp" >/dev/null 2>&1; then
      note "Connected. In Claude Code, /mcp lists it."
    else
      warn "Couldn't add it. Run: claude mcp add --scope user prokinetic -- \"$mcp\""
    fi
  fi
  if command -v codex >/dev/null 2>&1; then
    note "Codex too: codex mcp add prokinetic -- \"$mcp\""
  fi
}

# ---------------------------------------------------------------------------
# Install

install_app() {
  step "Checking for the latest release"
  curl -fsSL "$MANIFEST_URL" -o "$MANIFEST" || die "Couldn't reach the release server ($MANIFEST_URL)."
  local version build url sha
  version="$(manifest version)" || die "The release manifest is unreadable."
  build="$(manifest build)" || die "The release manifest has no build number."
  url="$(manifest url)" || die "The release manifest has no download link."
  sha="$(manifest sha256)" || die "The release manifest has no checksum."

  check_mac

  # Where it goes: next to the copy already installed, else /Applications if
  # writable, else ~/Applications.
  local current="" dest
  current="$(installed_app || true)"
  if [ -n "$DEST_DIR" ]; then
    dest="$DEST_DIR"
  elif [ -n "$current" ]; then
    dest="$(dirname "$current")"
  elif [ -w /Applications ]; then
    dest="/Applications"
  else
    dest="$HOME/Applications"
  fi
  local target="$dest/$APP_NAME"

  if [ -n "$current" ] && [ "$current" = "$target" ] && [ "$REINSTALL" -eq 0 ] \
     && [ "$(info_plist "$target" CFBundleVersion || true)" = "$build" ]; then
    step "ProKinetic $version is already installed in $dest"
    connect_claude_code "$target"
    return 0
  fi

  step "Downloading ProKinetic $version"
  local zip="$TMP/ProKinetic.zip"
  curl -fL --progress-bar -o "$zip" "$url" || die "Download failed: $url"

  step "Verifying"
  local got
  got="$(shasum -a 256 "$zip" | awk '{print $1}')"
  [ "$got" = "$sha" ] || die "The download doesn't match its checksum — nothing was installed. Try again; if it keeps happening, tell us at $SITE."
  ditto -x -k "$zip" "$TMP/unpacked" || die "Couldn't unpack the download."
  local new="$TMP/unpacked/$APP_NAME"
  [ -d "$new" ] || die "The download doesn't contain $APP_NAME."
  [ "$(info_plist "$new" CFBundleIdentifier || true)" = "$BUNDLE_ID" ] || die "The download isn't ProKinetic."
  codesign --verify --deep --strict "$new" 2>/dev/null || die "The app's code signature doesn't verify — nothing was installed."
  local team
  team="$(codesign -dv "$new" 2>&1 | sed -n 's/^TeamIdentifier=//p')"
  case " $TEAM_IDS " in
    *" $team "*) ;;
    *) die "The app is signed by an unexpected developer ($team) — nothing was installed." ;;
  esac
  if [ "$(manifest notarized || true)" = true ]; then
    spctl --assess --type execute "$new" 2>/dev/null || die "Gatekeeper rejects this download — nothing was installed."
  fi

  [ -n "$current" ] && wait_for_quit "$current"
  [ -e "$target" ] && [ "$target" != "$current" ] && wait_for_quit "$target"

  step "Installing into $dest"
  mkdir -p "$dest" || die "Couldn't create $dest."
  # Copied in under a name macOS doesn't treat as an app, then swapped in
  # with renames: a fresh copy rather than files overwritten in place (an
  # in-place overwrite keeps stale code-signature caches, and the app is
  # killed at launch), and an old copy that's put back if the swap fails.
  local staging="$dest/.ProKinetic.app.installing" previous="$dest/.ProKinetic.app.previous"
  rm -rf "$staging" "$previous"
  ditto "$new" "$staging" || die "Couldn't copy the app into $dest."
  if [ -e "$target" ]; then
    mv "$target" "$previous" || {
      rm -rf "$staging"
      die "macOS wouldn't let this terminal replace $target. Allow it under System Settings → Privacy & Security → App Management, then run the installer again."
    }
  fi
  if ! mv "$staging" "$target"; then
    [ -e "$previous" ] && mv "$previous" "$target"
    rm -rf "$staging"
    die "Couldn't move the new app into place; the old one is back where it was."
  fi
  rm -rf "$previous"
  register -f "$target"

  say "${GREEN}ProKinetic $version is installed in $dest.${RESET}"
  connect_claude_code "$target"

  if [ -z "$current" ]; then
    note "Free for 14 days from the first launch. Licences: $SITE"
  fi
  note "To update, run this command again."
  if [ "$OPEN_AFTER" -eq 1 ]; then open "$target" || true; fi
}

# ---------------------------------------------------------------------------
# Uninstall

uninstall_app() {
  local app
  app="$(installed_app || true)"
  if [ -z "$app" ]; then
    say "ProKinetic isn't installed${DEST_DIR:+ in $DEST_DIR}."
    return 0
  fi
  ask "Move $app to the Trash?" y || { say "Nothing removed."; return 0; }
  wait_for_quit "$app"

  local trashed="$HOME/.Trash/ProKinetic $(date '+%Y-%m-%d %H.%M.%S').app"
  if mv "$app" "$trashed" 2>/dev/null; then
    note "Moved to the Trash."
  elif ask "Couldn't move it to the Trash. Delete it permanently instead? This can't be undone." n; then
    rm -rf "$app" || die "Couldn't delete $app."
    note "Deleted."
  else
    say "Nothing removed."
    return 0
  fi
  register -u "$app"

  local mcp="$app/Contents/MacOS/prokinetic-mcp" current
  if command -v claude >/dev/null 2>&1 \
     && current="$(claude mcp get prokinetic 2>/dev/null)" \
     && printf '%s' "$current" | grep -qF "$mcp"; then
    if ask "Remove ProKinetic's MCP server from Claude Code?" y; then
      claude mcp remove prokinetic -s user >/dev/null 2>&1 && note "Removed from Claude Code." \
        || warn "Couldn't remove it. Run: claude mcp remove prokinetic -s user"
    fi
  fi

  note "Your licence and trial stay in your Keychain, so reinstalling picks up where you left off. Your projects are untouched."
}

# ---------------------------------------------------------------------------

main() {
  while [ $# -gt 0 ]; do
    case "$1" in
      --uninstall) UNINSTALL=1; shift ;;
      --dir) [ $# -ge 2 ] || die "--dir needs a folder"; DEST_DIR="${2%/}"; shift 2 ;;
      --reinstall) REINSTALL=1; shift ;;
      --no-open) OPEN_AFTER=0; shift ;;
      -y|--yes) ASSUME_YES=1; shift ;;
      -h|--help) sed -n '3,/^set -euo/p' "$0" 2>/dev/null | sed '$d; s/^# \{0,1\}//' || say "See $SITE/install"; exit 0 ;;
      *) die "Unknown option: $1 (try --help)" ;;
    esac
  done

  TMP="$(mktemp -d "${TMPDIR:-/tmp}/prokinetic-install.XXXXXX")"
  trap 'rm -rf "$TMP"' EXIT
  MANIFEST="$TMP/latest.json"

  if [ "$UNINSTALL" -eq 1 ]; then uninstall_app; else install_app; fi
}

# Everything runs from here, so a download cut short can't run half a script.
main "$@"