-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-sync.sh
More file actions
84 lines (66 loc) · 2.16 KB
/
test-sync.sh
File metadata and controls
84 lines (66 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# Test the sync functionality
echo "🧪 Testing AI Command Sync"
echo "========================="
# Create test directories
TEST_DIR="/tmp/ai-command-test"
CLAUDE_DIR="$TEST_DIR/.claude/commands"
GEMINI_DIR="$TEST_DIR/.gemini/commands"
# Clean up any existing test
rm -rf "$TEST_DIR"
# Create test Claude command
echo "📁 Creating test directories..."
mkdir -p "$CLAUDE_DIR"
echo "📝 Creating test Claude command..."
cat > "$CLAUDE_DIR/test-command.md" << 'EOF'
---
title: "Test Command"
description: "A test command for sync demo"
params:
- name: input
type: string
required: true
description: "Input text"
---
# Instructions
Process the {{input}} and return a result.
EOF
echo "📄 Initial state:"
echo " Claude commands: $(find $CLAUDE_DIR -name '*.md' | wc -l)"
echo " Gemini commands: $(find $GEMINI_DIR -name '*.toml' 2>/dev/null | wc -l || echo 0)"
# Run sync
echo -e "\n🔄 Running sync..."
node /Users/dtannen/Code/ai-command-converter/cli/sync.js sync \
--claude-dir "$CLAUDE_DIR" \
--gemini-dir "$GEMINI_DIR" \
--verbose
echo -e "\n📄 After sync:"
echo " Claude commands: $(find $CLAUDE_DIR -name '*.md' | wc -l)"
echo " Gemini commands: $(find $GEMINI_DIR -name '*.toml' | wc -l)"
# Show the converted file
if [ -f "$GEMINI_DIR/test-command.toml" ]; then
echo -e "\n📋 Converted Gemini command:"
cat "$GEMINI_DIR/test-command.toml"
fi
# Test bi-directional sync
echo -e "\n\n📝 Creating new Gemini command..."
cat > "$GEMINI_DIR/gemini-only.toml" << 'EOF'
description = "A Gemini-specific command"
prompt = """
This is a test command created in Gemini.
# USAGE:
# This command accepts the following arguments:
#
# REQUIRED:
# - topic (position 1): The topic to discuss
# Example: {{args.0}} or {{args.topic}}
"""
EOF
echo -e "\n🔄 Running sync again (bi-directional)..."
node /Users/dtannen/Code/ai-command-converter/cli/sync.js sync \
--claude-dir "$CLAUDE_DIR" \
--gemini-dir "$GEMINI_DIR"
echo -e "\n📄 Final state:"
echo " Claude commands: $(find $CLAUDE_DIR -name '*.md' | wc -l)"
echo " Gemini commands: $(find $GEMINI_DIR -name '*.toml' | wc -l)"
echo -e "\n✅ Test complete! Check $TEST_DIR for results."