#!/bin/bash

# Test script for MCP Memory CLI
# Tests all CLI commands without making actual changes

set -e

echo "🧪 Testing MCP Memory CLI"
echo "=========================="
echo ""

# Test 1: Help command
echo "✅ Test 1: Main help"
mcp-memory --help > /dev/null
echo "   PASSED: Main help works"
echo ""

# Test 2: Claude Desktop help
echo "✅ Test 2: Claude Desktop help"
mcp-memory claude-desktop --help > /dev/null
echo "   PASSED: Claude Desktop subcommand help works"
echo ""

# Test 3: Status command
echo "✅ Test 3: Status command"
mcp-memory claude-desktop status > /dev/null
echo "   PASSED: Status command works"
echo ""

# Test 4: Config command (should show not found initially)
echo "✅ Test 4: Config command"
mcp-memory config > /dev/null || true
echo "   PASSED: Config command works"
echo ""

# Test 5: List types
echo "✅ Test 5: List types"
mcp-memory list-types > /dev/null
echo "   PASSED: List types works"
echo ""

# Test 6: Export help
echo "✅ Test 6: Export vCard help"
mcp-memory export-vcard --help > /dev/null
echo "   PASSED: Export vCard help works"
echo ""

# Test 7: Import help
echo "✅ Test 7: Import vCard help"
mcp-memory import-vcard --help > /dev/null
echo "   PASSED: Import vCard help works"
echo ""

echo "=========================="
echo "✅ All CLI tests passed!"
echo ""
echo "Next steps:"
echo "  1. Run 'mcp-memory init' to configure"
echo "  2. Run 'mcp-memory claude-desktop install' to install"
echo "  3. Restart Claude Desktop"
