#!/usr/bin/env bash
set -euo pipefail
# Usage: bash seed.sh <new-empty-fixture-directory>
fixture=$(realpath "$1")
mkdir -p "$fixture/home" "$fixture/npm-prefix"
curl -fsSL https://x.ai/cli/install.sh -o "$fixture/install.sh"
HOME="$fixture/home" bash "$fixture/install.sh" 1.0.77
chmod 555 "$fixture/npm-prefix"
printf '\nProvider binaryPath: %s/home/.grok/bin/grok\n' "$fixture"
printf 'Provider environment: HOME=%s/home; npm_config_prefix=%s/npm-prefix\n' "$fixture" "$fixture"
printf '%s\n' 'Launch each checkout: T3CODE_DEV_SEED=0 npm_config_user_agent="npm/11.6.2 node/v24.11.0 linux x64 workspaces/false" vp run dev' 'Open Settings > Providers; Add provider > Grok > Next > Next; use the binaryPath above.' 'Add HOME and npm_config_prefix as provider environment variables. Select Grok, open its update icon, click Update now.'
