#!/bin/bash
set -euo pipefail
cd /home/claude/repos/openclaw
F=.claude/skills/curogram/scripts/setup_account_from_invite.py

echo "=== SECRET SCAN (must find NONE) ==="
if grep -nE 'Exult-Hlth|CHPWD-[0-9a-f]|CUROGRAM_AGENT_PASSWORD=|AGENT_MS_TOTP_SECRET=|46556c|4656c006' "$F"; then
  echo "ABORT: secret-like content found in committed file"; exit 1
fi
echo "clean"

git stash push -- "$F" >/dev/null 2>&1 || true
git stash pop >/dev/null 2>&1 || true

git checkout -b feat/ai-curogram-account-setup 2>/dev/null || git checkout feat/ai-curogram-account-setup
git add "$F"
git status --short

export GIT_AUTHOR_NAME="Gautam AI"
export GIT_AUTHOR_EMAIL=gautamai@icloud.com
export GIT_COMMITTER_NAME="Gautam AI"
export GIT_COMMITTER_EMAIL=gautamai@icloud.com
git commit -F /tmp/amdwork/curo_commit_msg.txt
git log -1 --format='AUTHOR:%an <%ae> | %s'
echo "=== FILES IN COMMIT ==="
git show --stat --format='' HEAD
