#!/bin/bash
# Drop this in your .zshrc: source ~/path/to/openclaw-safe.sh
# Wraps `openclaw configure` with auto-backup

openclaw() {
    if [[ "$1" == "configure" || ("$1" == "config" && "$2" == "set") ]]; then
        echo "⚠️  Config change detected — backing up first..."
        bash ~/.openclaw/workspace/tools/config-guard.sh backup
        echo ""
    fi
    command openclaw "$@"
}
