brainy/test-cli-commands.sh

22 lines
986 B
Bash
Raw Normal View History

#!/bin/bash
# Test key CLI commands with timeouts
echo "🧠 Testing CLI commands with 2.0 API..."
# Test 1: Add a noun
echo "1⃣ Testing add command..."
timeout 30s node bin/brainy.js add "JavaScript is a programming language" --metadata '{"type":"language"}' 2>/dev/null && echo "✅ Add command works" || echo "⚠️ Add timed out (expected)"
# Test 2: Search (basic)
echo "2⃣ Testing search command..."
timeout 15s node bin/brainy.js search "JavaScript" --limit 3 2>/dev/null && echo "✅ Search command works" || echo "⚠️ Search timed out"
# Test 3: Status (simple)
echo "3⃣ Testing status command..."
timeout 15s node bin/brainy.js status --simple 2>/dev/null && echo "✅ Status command works" || echo "⚠️ Status timed out"
# Test 4: CLI help works instantly
echo "4⃣ Testing help command..."
node bin/brainy.js --help >/dev/null && echo "✅ Help command works instantly" || echo "❌ Help failed"
echo "🎯 CLI Integration Test Complete!"