#!/usr/bin/env bash # Miss Minutes installer. # # curl -fsSL https://getmissminutes.netlify.app/install.sh | bash # curl -fsSL https://getmissminutes.netlify.app/install.sh | bash -s -- 0.2.0 # specific version # curl -fsSL https://getmissminutes.netlify.app/install.sh | bash -s -- --from-source # build locally (needs repo access + Command Line Tools) # # Installs: # ~/Applications/MissMinutes.app # ~/.local/bin/missminutes -> the app's binary (the CLI) set -euo pipefail REPO="${MISSMINUTES_REPO:-Shridhar2104/missminutes}" BASE_URL="${MISSMINUTES_BASE_URL:-https://getmissminutes.netlify.app/download}" APP_DIR="${MISSMINUTES_APP_DIR:-$HOME/Applications}" BIN_DIR="${MISSMINUTES_BIN_DIR:-$HOME/.local/bin}" VERSION="latest" MODE="release" LOCAL_APP="" NO_VOICE=0 while [ $# -gt 0 ]; do case "$1" in --from-source) MODE="source" ;; --no-voice) NO_VOICE=1 ;; --local) MODE="local"; LOCAL_APP="$2"; shift ;; -h|--help) sed -n '2,12p' "$0" 2>/dev/null || true; exit 0 ;; *) VERSION="${1#v}" ;; esac shift done c() { printf '\033[%sm%s\033[0m' "$1" "$2"; } say() { printf '%s %s\n' "$(c '38;5;208' '◷')" "$*"; } die() { printf '%s %s\n' "$(c 31 'error:')" "$*" >&2; exit 1; } # Anonymous install counts (a random ID, versions, success/failure step; nothing personal). # Opt out: MISSMINUTES_NO_TELEMETRY=1 or DO_NOT_TRACK=1 (the app then stays quiet too). MM_HOME="$HOME/.missminutes" TELEMETRY_URL="${MISSMINUTES_TELEMETRY_URL:-https://getmissminutes.netlify.app/api/t}" TELEMETRY=1 if [ -n "${MISSMINUTES_NO_TELEMETRY:-}" ] || [ "${DO_NOT_TRACK:-}" = "1" ]; then TELEMETRY=0 mkdir -p "$MM_HOME" 2>/dev/null && touch "$MM_HOME/.no-telemetry" 2>/dev/null || true fi [ -n "${CI:-}" ] && TELEMETRY=0 [ -f "$MM_HOME/.no-telemetry" ] && TELEMETRY=0 ANON_ID="" if [ "$TELEMETRY" = 1 ]; then ANON_ID="$(cat "$MM_HOME/.anon-id" 2>/dev/null || true)" if [ -z "$ANON_ID" ]; then ANON_ID="$(uuidgen 2>/dev/null | tr 'A-Z' 'a-z' || true)" mkdir -p "$MM_HOME" 2>/dev/null && printf '%s\n' "$ANON_ID" > "$MM_HOME/.anon-id" 2>/dev/null || true fi fi STEP="start" DONE=0 ping() { # ping [key=value ...] (values are plain version/step strings) [ "$TELEMETRY" = 1 ] && [ -n "$ANON_ID" ] || return 0 local q="s=install&e=$1&id=$ANON_ID"; shift for kv in "$@"; do q="$q&$kv"; done curl -fsS -m 4 -o /dev/null "$TELEMETRY_URL?$q" >/dev/null 2>&1 || true } KIND="install" [ -d "${MISSMINUTES_APP_DIR:-$HOME/Applications}/MissMinutes.app" ] && KIND="update" OSV="$(sw_vers -productVersion 2>/dev/null || echo '?')" ARCH="$(uname -m)" ping install_start "kind=$KIND" "os=$OSV" "arch=$ARCH" "want=$VERSION" "mode=$MODE" "voice=$([ "$NO_VOICE" = 1 ] && echo off || echo on)" trap 'rc=$?; rm -rf "${TMP:-/nonexistent-mm}"; if [ "$DONE" != 1 ] && [ "$rc" != 0 ]; then ping install_fail "kind=$KIND" "step=$STEP" "os=$OSV" "arch=$ARCH" "rc=$rc"; fi' EXIT [ "$(uname -s)" = "Darwin" ] || die "Miss Minutes only runs on macOS." MAJOR="$(sw_vers -productVersion | cut -d. -f1)" [ "$MAJOR" -ge 14 ] || die "macOS 14 (Sonoma) or newer is required (you have $(sw_vers -productVersion))." STEP="download" TMP="$(mktemp -d)" case "$MODE" in release) if [ "$VERSION" = "latest" ]; then URL="$BASE_URL/MissMinutes-macos.zip" else URL="$BASE_URL/v$VERSION/MissMinutes-macos.zip" fi say "Downloading Miss Minutes ($VERSION)…" if ! curl -fSL --progress-bar "$URL" -o "$TMP/mm.zip"; then if xcrun --find swift >/dev/null 2>&1; then say "No prebuilt release found; building from source instead." MODE="source" else die "Download failed ($URL). If no release is published yet, install the Command Line Tools (xcode-select --install) and re-run with --from-source." fi else if curl -fsSL "$URL.sha256" -o "$TMP/mm.sha256" 2>/dev/null; then [ "$(shasum -a 256 "$TMP/mm.zip" | awk '{print $1}')" = "$(tr -d '[:space:]' < "$TMP/mm.sha256")" ] || die "Checksum mismatch, aborting." fi ditto -x -k "$TMP/mm.zip" "$TMP/unzipped" LOCAL_APP="$TMP/unzipped/MissMinutes.app" fi ;; esac if [ "$MODE" = "source" ]; then xcrun --find swift >/dev/null 2>&1 || die "Swift not found. Run: xcode-select --install" say "Fetching source…" git clone --depth 1 "https://github.com/$REPO.git" "$TMP/missminutes" || die "Couldn't clone $REPO (it's private: you need access)." SRC="$TMP/missminutes" [ -n "$SRC" ] || die "Couldn't unpack source." (cd "$SRC" && ./scripts/build.sh) LOCAL_APP="$SRC/dist/MissMinutes.app" fi [ -d "$LOCAL_APP" ] || die "App bundle not found at $LOCAL_APP" STEP="copy" # Stop a running copy before replacing it. if [ -x "$BIN_DIR/missminutes" ]; then "$BIN_DIR/missminutes" stop >/dev/null 2>&1 || true; fi pkill -f "MissMinutes.app/Contents/MacOS/MissMinutes" 2>/dev/null || true mkdir -p "$APP_DIR" "$BIN_DIR" rm -rf "$APP_DIR/MissMinutes.app" ditto "$LOCAL_APP" "$APP_DIR/MissMinutes.app" xattr -dr com.apple.quarantine "$APP_DIR/MissMinutes.app" 2>/dev/null || true ln -sf "$APP_DIR/MissMinutes.app/Contents/MacOS/MissMinutes" "$BIN_DIR/missminutes" INSTALLED="$("$BIN_DIR/missminutes" --version 2>/dev/null || echo '?')" DONE=1 ping install_ok "kind=$KIND" "v=$(printf '%s' "$INSTALLED" | cut -d' ' -f1)" "os=$OSV" "arch=$ARCH" say "Installed Miss Minutes $INSTALLED" echo " app: $APP_DIR/MissMinutes.app" echo " cli: $BIN_DIR/missminutes" case ":$PATH:" in *":$BIN_DIR:"*) ;; *) SHELL_RC="$HOME/.zshrc"; [ "${SHELL##*/}" = "bash" ] && SHELL_RC="$HOME/.bashrc" if ! grep -qs "$BIN_DIR" "$SHELL_RC"; then printf '\n# Miss Minutes\nexport PATH="%s:$PATH"\n' "$BIN_DIR" >> "$SHELL_RC" say "Added $BIN_DIR to PATH in $SHELL_RC (open a new terminal)." fi ;; esac if ! command -v claude >/dev/null 2>&1 && [ ! -x "$HOME/.local/bin/claude" ] && [ ! -x "$HOME/.claude/local/claude" ]; then echo say "Miss Minutes runs on Claude Code + your Claude subscription. Install it with:" echo " curl -fsSL https://claude.ai/install.sh | bash && claude (then log in)" fi if [ "$NO_VOICE" = 1 ]; then "$BIN_DIR/missminutes" voice system >/dev/null 2>&1 || true else say "On first launch she downloads her natural voice (Kokoro, about 400 MB, runs on this Mac). Skip with --no-voice." fi echo "$BIN_DIR/missminutes" start || true echo echo " Next: $(c 1 'missminutes doctor') · talk: ⌥Space · chat: ⌥⇧Space · $(c 1 'missminutes --help')"