#!/usr/bin/env bash # Zero-token vault sync protocol # Pulls latest, commits local changes, pushes to Gitea mirror VAULT_DIR="/c/Users/fight/AgentOS/memory-systems/agent-os" cd "$VAULT_DIR" || exit 1 echo "=== Vault Sync $(date '+%Y-%m-%d %H:%M') ===" # 1. Pull latest from remote echo "Pulling latest..." git pull --rebase 2>&1 | tail -3 # 2. Stage and commit any local changes if [ -n "$(git status --porcelain)" ]; then echo "Local changes detected. Committing..." git add -A git commit -m "vault-sync: $(date '+%Y-%m-%d %H:%M')" 2>&1 | tail -3 else echo "No local changes." fi # 3. Push to remote echo "Pushing to Gitea..." git push 2>&1 | tail -3 echo "=== Sync Complete ==="