SPB Git

spb/chat-spboucher Public

Private universal chat interface over the OpenRouter ecosystem — 400+ models, branching, streaming, usage tracking. Next.js 16 + SQLite, PWA, deployed on m4m64a at chat.spboucher.ai

TypeScript 78.8% CSS 15.1% JavaScript 4.9% Shell 1.2%
1.3 KB · 52 lines shellscript
Raw Blame History
1#!/bin/zsh2# Author: Simon-Pierre Boucher3# Contact: contact@spboucher.ai4# Project: chat.spboucher.ai5#6# Single-command deploy, run ON m4m64a:7#   ~/apps/chat.spboucher.ai/ops/deploy.sh8# Pulls latest (if a git remote exists), installs deps, builds, restarts agents.910set -euo pipefail1112APP_DIR="$HOME/apps/chat.spboucher.ai"13cd "$APP_DIR"1415echo "==> chat.spboucher.ai deploy ($(date))"1617if git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git remote get-url origin >/dev/null 2>&1; then18  echo "==> git pull"19  git pull --ff-only20fi2122echo "==> npm ci"23npm ci2425echo "==> build"26npm run build2728mkdir -p "$APP_DIR/logs" "$APP_DIR/data"2930echo "==> restart launchd agents"31for AGENT in ai.spboucher.chat.app ai.spboucher.chat.ngrok; do32  PLIST="$HOME/Library/LaunchAgents/$AGENT.plist"33  if [ ! -f "$PLIST" ]; then34    cp "$APP_DIR/ops/$AGENT.plist" "$PLIST"35    echo "    installed $AGENT.plist"36  fi37  launchctl unload "$PLIST" 2>/dev/null || true38  launchctl load "$PLIST"39  echo "    restarted $AGENT"40done4142echo "==> waiting for health"43for i in {1..30}; do44  if curl -sf -o /dev/null http://127.0.0.1:3000/login; then45    echo "==> app is up: http://127.0.0.1:3000 → https://chat.spboucher.ai"46    exit 047  fi48  sleep 149done50echo "!! app did not come up within 30s — check $APP_DIR/logs/app.log" >&251exit 152