#!/usr/bin/env bash
set -euo pipefail
# Run from either checkout after starting its fresh dev server with T3CODE_DEV_SEED=0.
# Configure Antigravity in Settings > Providers with Gemini API key, then Connect.
# GOOGLE_GEMINI_BASE_URL must be present in the dev server's environment.
project_path="$1"
node apps/server/src/bin.ts project add --base-dir .t3 --title 'Compact proof' "$project_path"
started=$(node apps/server/src/bin.ts thread start --base-dir .t3 --title 'Remembered details' --provider antigravity --model gemini-4-neon --wait --json "$project_path" 'Remember this codeword for later: PURPLE-WALRUS-42. Reply with just OK.')
thread_id=$(printf '%s' "$started" | jq -r .threadId)
printf '%s\n' "$started"
node apps/server/src/bin.ts thread send --base-dir .t3 --wait --json "$thread_id" 'Also remember my favourite fruit is durian. Reply with just OK.'
printf 'Open source thread: %s\n' "$thread_id"
