#!/bin/bash
# EchoNodeSync API memory retrieval test
# This script fetches a memory key from the EdgeHub API and demonstrates the desktop/mobile bridge

export ECHONODESYNC_API_URL="https://edgehub.click/api/memory"
KEY="redstones:img"

# Fetch the memory key from the API and archive it locally
npx echonodesync@0.2.3 get-memory --key "$KEY"

# Check if the memory was archived locally
if [ -f ".mia/${KEY}.Gpt.md" ]; then
  echo "✅ Memory archived locally: .mia/${KEY}.Gpt.md"
else
  echo "❌ Memory was not archived locally."
fi

