#!/usr/bin/env bash # LockIn MCP — bootstrap installer # Preferred: npx -y lockin-mcp install # Alternative: curl -fsSL https://www.lockinmcp.com/install | bash set -euo pipefail MDB_APP_URL="https://www.lockinmcp.com" MDB_LICENSE_API_URL="https://www.lockinmcp.com/api/v1" die() { printf '✗ %s\n' "$*" >&2; exit 1; } ensure_node() { if command -v node >/dev/null 2>&1; then local major major="$(node -p "process.versions.node.split('.')[0]")" [ "$major" -ge 18 ] || die "Node.js 18+ required (found $(node -v))" return 0 fi die "Node.js 18+ required. Install from https://nodejs.org/" } case "$(uname -s)" in MINGW*|MSYS*|CYGWIN*) die "On Windows: iwr -useb https://www.lockinmcp.com/install.ps1 | iex" ;; esac ensure_node export MDB_APP_URL export MDB_LICENSE_API_URL NPX=(npx -y -p "lockin-mcp" install --browser-login "$@") # curl | bash pipes stdin — re-attach to the real terminal for interactive TUI if [ ! -t 0 ] && [ -r /dev/tty ]; then exec /dev/tty 2>&1 "${NPX[@]}" else exec "${NPX[@]}" fi