#!/bin/sh # Vibestrate installer - installs the `vibe` CLI (npm package `vibestrate`) globally. # # curl -fsSL https://raw.githubusercontent.com/guyshonshon/vibestrate/main/install.sh | sh # # Pin a version with VIBESTRATE_VERSION before the pipe, e.g. # curl -fsSL .../install.sh | VIBESTRATE_VERSION=0.1.1 sh # # This script only runs a global npm/pnpm install of a published package - # nothing else. It is plain text you can read before running. set -eu PKG="vibestrate" VERSION="${VIBESTRATE_VERSION:-latest}" # Must track engines.node in package.json. It did not: this sat at 22 after the # floor moved to 24, so the installer green-lit a Node the package then refused # with EBADENGINE, after telling the user they were fine. MIN_NODE_MAJOR=24 red() { printf '\033[31m%s\033[0m\n' "$*" >&2; } cyan() { printf '\033[36m%s\033[0m\n' "$*"; } if ! command -v node >/dev/null 2>&1; then red "Node.js is required but was not found." red "Install Node >= $MIN_NODE_MAJOR from https://nodejs.org and re-run this installer." exit 1 fi NODE_MAJOR="$(node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0)" if [ "${NODE_MAJOR:-0}" -lt "$MIN_NODE_MAJOR" ]; then red "Node >= $MIN_NODE_MAJOR is required (found $(node -v 2>/dev/null || echo none))." red "Upgrade from https://nodejs.org and re-run." exit 1 fi if command -v npm >/dev/null 2>&1; then cyan "Installing ${PKG}@${VERSION} globally with npm…" npm install -g "${PKG}@${VERSION}" elif command -v pnpm >/dev/null 2>&1; then cyan "Installing ${PKG}@${VERSION} globally with pnpm…" pnpm add -g "${PKG}@${VERSION}" else red "Neither npm nor pnpm was found. Install Node (it bundles npm) from https://nodejs.org." exit 1 fi cyan "" cyan "✓ Vibestrate installed. Next step:" cyan " cd your-project" cyan " vibe ui" cyan "" # One command, because the dashboard is the primary surface and it handles the # rest: in a folder with no .vibestrate/ it opens an onboarding screen with # Initialize project rather than a half-broken dashboard, and More > Setup # walks the same checks `vibe doctor` runs. The old three-command sequence # taught the CLI path to someone who had not seen the app yet. cyan " The dashboard opens on 127.0.0.1:4317 and walks you through the rest." cyan " Prefer the terminal? \`vibe init\` then \`vibe setup\`."