claude-all-config 3.1.13 → 3.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/claude-all +256 -69
  2. package/package.json +1 -1
package/claude-all CHANGED
@@ -2396,94 +2396,281 @@ EOF
2396
2396
  exec "$0"
2397
2397
  ;;
2398
2398
  20)
2399
- # Add/Edit/Delete Models
2400
- echo -e "${BLUE}⚙️ Model Management${NC}"
2399
+ # Advanced Model Manager - Integrated with Claude, GLM, Letta
2400
+ clear
2401
+ echo -e "${CYAN}╔═══════════════════════════════════════════════════════════╗${NC}"
2402
+ echo -e "${CYAN}║ 🛠️ ADVANCED MODEL MANAGER ║${NC}"
2403
+ echo -e "${CYAN}╚═══════════════════════════════════════════════════════════╝${NC}"
2401
2404
  echo ""
2402
-
2403
- # Find model directory
2404
- MODEL_DIR=""
2405
- for path in "$SCRIPT_DIR/models" "$HOME/ClaudeAll/models" "/data/data/com.termux/files/home/ClaudeAll/models"; do
2406
- if [[ -d "$path" ]]; then
2407
- MODEL_DIR="$path"
2408
- break
2409
- fi
2410
- done
2411
-
2412
- [[ -z "$MODEL_DIR" ]] && MODEL_DIR="$HOME/.claude-all/models" && mkdir -p "$MODEL_DIR"
2413
-
2414
- echo "Pilih operasi:"
2415
- echo " 1) ➕ Tambah model baru"
2416
- echo " 2) 📋 Lihat semua model"
2417
- echo " 3) ❌ Hapus model"
2418
- echo " 4) 🔙 Kembali"
2405
+ echo -e "${YELLOW}📌 PROVIDER MANAGEMENT:${NC}"
2406
+ echo " 1) 🤖 Claude/Anthropic - Edit model & API key"
2407
+ echo " 2) 🇨🇳 ZhipuAI/GLM - Edit model & API key"
2408
+ echo " 3) 🧠 Letta AI - Edit agent & API key"
2409
+ echo ""
2410
+ echo -e "${YELLOW}🔧 CONFIGURATION:${NC}"
2411
+ echo " 4) 📋 View All Configs - Lihat semua konfigurasi"
2412
+ echo " 5) 🔑 API Key Manager - Kelola semua API keys"
2413
+ echo " 6) 🗑️ Reset Config - Reset ke default"
2414
+ echo ""
2415
+ echo " 0) 🔙 Kembali ke menu utama"
2419
2416
  echo ""
2420
- read -p "Pilih [1-4]: " model_op
2417
+ read -p "Pilih [0-6]: " mgr_choice
2421
2418
 
2422
- case $model_op in
2419
+ case $mgr_choice in
2423
2420
  1)
2421
+ # Claude/Anthropic Manager
2424
2422
  echo ""
2425
- read -p "Nama provider (contoh: MyAI): " provider_name
2426
- read -p "Model ID (contoh: gpt-4): " model_id
2427
- read -p "API Base URL: " api_base
2428
- read -p "Deskripsi: " description
2429
-
2430
- filename=$(echo "$provider_name" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/_/g').json
2431
-
2432
- cat > "$MODEL_DIR/$filename" << EOFMODEL
2433
- {
2434
- "provider_name": "$provider_name",
2435
- "description": "$description",
2436
- "api_base": "$api_base",
2437
- "model": "$model_id",
2438
- "created": "$(date -Iseconds)"
2439
- }
2440
- EOFMODEL
2441
- echo -e "${GREEN}✓ Model disimpan: $MODEL_DIR/$filename${NC}"
2423
+ echo -e "${BLUE}═══ CLAUDE/ANTHROPIC CONFIG ═══${NC}"
2424
+ echo ""
2425
+ echo -e "${CYAN}Current Config:${NC}"
2426
+ [[ -f "$HOME/.anthropic_api_key" ]] && echo " API Key: ****$(tail -c 8 $HOME/.anthropic_api_key 2>/dev/null)" || echo " API Key: Not set"
2427
+ echo ""
2428
+ echo "1) Set/Update API Key"
2429
+ echo "2) Test Connection"
2430
+ echo "3) View Available Models"
2431
+ echo "0) Back"
2432
+ echo ""
2433
+ read -p "Pilih: " claude_op
2434
+ case $claude_op in
2435
+ 1)
2436
+ echo ""
2437
+ echo "Get key: https://console.anthropic.com/settings/keys"
2438
+ read -p "Enter Anthropic API Key: " new_key
2439
+ if [[ -n "$new_key" ]]; then
2440
+ echo "$new_key" > "$HOME/.anthropic_api_key"
2441
+ chmod 600 "$HOME/.anthropic_api_key"
2442
+ echo -e "${GREEN}✓ API Key saved!${NC}"
2443
+ fi
2444
+ ;;
2445
+ 2)
2446
+ echo ""
2447
+ echo "Testing connection..."
2448
+ if [[ -f "$HOME/.anthropic_api_key" ]]; then
2449
+ key=$(cat "$HOME/.anthropic_api_key")
2450
+ resp=$(curl -s -w "%{http_code}" -o /dev/null -X POST "https://api.anthropic.com/v1/messages" \
2451
+ -H "x-api-key: $key" \
2452
+ -H "anthropic-version: 2023-06-01" \
2453
+ -H "content-type: application/json" \
2454
+ -d '{"model":"claude-3-haiku-20240307","max_tokens":10,"messages":[{"role":"user","content":"hi"}]}')
2455
+ [[ "$resp" == "200" ]] && echo -e "${GREEN}✓ Connection OK!${NC}" || echo -e "${RED}✗ Error (HTTP $resp)${NC}"
2456
+ else
2457
+ echo -e "${RED}No API key set${NC}"
2458
+ fi
2459
+ ;;
2460
+ 3)
2461
+ echo ""
2462
+ echo -e "${CYAN}Available Claude Models:${NC}"
2463
+ echo " • claude-sonnet-4-20250514 (Latest Sonnet)"
2464
+ echo " • claude-3-5-sonnet-20241022 (Sonnet 3.5)"
2465
+ echo " • claude-3-5-haiku-20241022 (Haiku - Fast)"
2466
+ echo " • claude-3-opus-20240229 (Opus - Best)"
2467
+ ;;
2468
+ esac
2442
2469
  ;;
2443
2470
  2)
2471
+ # GLM Manager
2444
2472
  echo ""
2445
- echo -e "${CYAN}Model tersedia:${NC}"
2446
- if ls "$MODEL_DIR"/*.json &>/dev/null; then
2447
- for f in "$MODEL_DIR"/*.json; do
2448
- name=$(basename "$f" .json)
2449
- desc=$(grep -o '"description"[^,]*' "$f" 2>/dev/null | cut -d'"' -f4)
2450
- echo " $name - $desc"
2451
- done
2452
- else
2453
- echo " (belum ada model custom)"
2454
- fi
2473
+ echo -e "${BLUE}═══ ZHIPUAI/GLM CONFIG ═══${NC}"
2474
+ echo ""
2475
+ echo -e "${CYAN}Current Config:${NC}"
2476
+ [[ -f "$HOME/.glm_api_key" ]] && echo " API Key: ****$(tail -c 8 $HOME/.glm_api_key 2>/dev/null)" || echo " API Key: Not set"
2477
+ echo ""
2478
+ echo "1) Set/Update API Key"
2479
+ echo "2) Test GLM-4.7"
2480
+ echo "3) Test GLM-4.6V (Vision)"
2481
+ echo "4) View Available Models"
2482
+ echo "0) Back"
2483
+ echo ""
2484
+ read -p "Pilih: " glm_op
2485
+ case $glm_op in
2486
+ 1)
2487
+ echo ""
2488
+ echo "Get key: https://open.bigmodel.cn/usercenter/apikeys"
2489
+ read -p "Enter GLM API Key: " new_key
2490
+ if [[ -n "$new_key" ]]; then
2491
+ echo "$new_key" > "$HOME/.glm_api_key"
2492
+ chmod 600 "$HOME/.glm_api_key"
2493
+ echo -e "${GREEN}✓ API Key saved!${NC}"
2494
+ fi
2495
+ ;;
2496
+ 2)
2497
+ echo ""
2498
+ echo "Testing GLM-4.7..."
2499
+ if [[ -f "$HOME/.glm_api_key" ]]; then
2500
+ key=$(cat "$HOME/.glm_api_key")
2501
+ resp=$(curl -s "https://open.bigmodel.cn/api/paas/v4/chat/completions" \
2502
+ -H "Authorization: Bearer $key" \
2503
+ -H "Content-Type: application/json" \
2504
+ -d '{"model":"glm-4.7","messages":[{"role":"user","content":"hi"}],"max_tokens":10}')
2505
+ if echo "$resp" | grep -q "choices"; then
2506
+ echo -e "${GREEN}✓ GLM-4.7 OK!${NC}"
2507
+ else
2508
+ echo -e "${RED}✗ Error: $(echo "$resp" | grep -o '"message":"[^"]*"' | head -1)${NC}"
2509
+ fi
2510
+ else
2511
+ echo -e "${RED}No API key set${NC}"
2512
+ fi
2513
+ ;;
2514
+ 3)
2515
+ echo ""
2516
+ echo "Testing GLM-4.6V..."
2517
+ if [[ -f "$HOME/.glm_api_key" ]]; then
2518
+ key=$(cat "$HOME/.glm_api_key")
2519
+ resp=$(curl -s "https://open.bigmodel.cn/api/paas/v4/chat/completions" \
2520
+ -H "Authorization: Bearer $key" \
2521
+ -H "Content-Type: application/json" \
2522
+ -d '{"model":"glm-4.6v","messages":[{"role":"user","content":"hi"}],"max_tokens":10}')
2523
+ if echo "$resp" | grep -q "choices"; then
2524
+ echo -e "${GREEN}✓ GLM-4.6V OK!${NC}"
2525
+ else
2526
+ echo -e "${RED}✗ Error: $(echo "$resp" | grep -o '"message":"[^"]*"' | head -1)${NC}"
2527
+ fi
2528
+ else
2529
+ echo -e "${RED}No API key set${NC}"
2530
+ fi
2531
+ ;;
2532
+ 4)
2533
+ echo ""
2534
+ echo -e "${CYAN}Available GLM Models:${NC}"
2535
+ echo " • glm-4.7 (Flagship - Coding Plan) ⭐"
2536
+ echo " • glm-4.6v (Vision/Multimodal) 👁️"
2537
+ ;;
2538
+ esac
2455
2539
  ;;
2456
2540
  3)
2541
+ # Letta Manager
2457
2542
  echo ""
2458
- if ls "$MODEL_DIR"/*.json &>/dev/null; then
2459
- echo -e "${CYAN}Model yang bisa dihapus:${NC}"
2460
- i=1
2461
- declare -a model_files
2462
- for f in "$MODEL_DIR"/*.json; do
2463
- model_files[$i]="$f"
2464
- echo " $i) $(basename "$f" .json)"
2465
- ((i++))
2466
- done
2467
- echo ""
2468
- read -p "Pilih nomor untuk hapus (0=batal): " del_num
2469
- if [[ "$del_num" =~ ^[0-9]+$ ]] && [[ "$del_num" -gt 0 ]] && [[ -n "${model_files[$del_num]}" ]]; then
2470
- rm -f "${model_files[$del_num]}"
2471
- echo -e "${GREEN}✓ Model dihapus${NC}"
2472
- else
2473
- echo "Batal"
2474
- fi
2475
- else
2476
- echo "Tidak ada model untuk dihapus"
2543
+ echo -e "${BLUE}═══ LETTA AI CONFIG ═══${NC}"
2544
+ echo ""
2545
+ echo -e "${CYAN}Current Config:${NC}"
2546
+ [[ -f "$HOME/.letta_api_key" ]] && echo " API Key: ****$(tail -c 8 $HOME/.letta_api_key 2>/dev/null)" || echo " API Key: Not set"
2547
+ [[ -f "$HOME/.letta_agent_id" ]] && echo " Agent ID: $(cat $HOME/.letta_agent_id 2>/dev/null)" || echo " Agent ID: Not set"
2548
+ echo ""
2549
+ echo "1) Set/Update API Key"
2550
+ echo "2) Set Agent ID"
2551
+ echo "3) List My Agents"
2552
+ echo "4) Create New Agent"
2553
+ echo "0) Back"
2554
+ echo ""
2555
+ read -p "Pilih: " letta_op
2556
+ case $letta_op in
2557
+ 1)
2558
+ echo ""
2559
+ echo "Get key: https://app.letta.com/settings/keys"
2560
+ read -p "Enter Letta API Key: " new_key
2561
+ if [[ -n "$new_key" ]]; then
2562
+ echo "$new_key" > "$HOME/.letta_api_key"
2563
+ chmod 600 "$HOME/.letta_api_key"
2564
+ echo -e "${GREEN}✓ API Key saved!${NC}"
2565
+ fi
2566
+ ;;
2567
+ 2)
2568
+ echo ""
2569
+ read -p "Enter Agent ID: " agent_id
2570
+ if [[ -n "$agent_id" ]]; then
2571
+ echo "$agent_id" > "$HOME/.letta_agent_id"
2572
+ echo -e "${GREEN}✓ Agent ID saved!${NC}"
2573
+ fi
2574
+ ;;
2575
+ 3)
2576
+ echo ""
2577
+ echo "Fetching agents..."
2578
+ if [[ -f "$HOME/.letta_api_key" ]]; then
2579
+ key=$(cat "$HOME/.letta_api_key")
2580
+ curl -s "https://api.letta.com/v1/agents" \
2581
+ -H "Authorization: Bearer $key" | \
2582
+ python3 -c "import sys,json; d=json.load(sys.stdin); [print(f' {i+1}) {a.get(\"name\",\"?\")} - {a.get(\"id\",\"?\")}') for i,a in enumerate(d)]" 2>/dev/null || echo " No agents or error"
2583
+ else
2584
+ echo -e "${RED}No API key set${NC}"
2585
+ fi
2586
+ ;;
2587
+ 4)
2588
+ echo ""
2589
+ if [[ -f "$HOME/.letta_api_key" ]]; then
2590
+ key=$(cat "$HOME/.letta_api_key")
2591
+ read -p "Agent name: " aname
2592
+ [[ -z "$aname" ]] && aname="claude-agent"
2593
+ echo "Creating agent '$aname'..."
2594
+ resp=$(curl -s -X POST "https://api.letta.com/v1/agents" \
2595
+ -H "Authorization: Bearer $key" \
2596
+ -H "Content-Type: application/json" \
2597
+ -d "{\"name\":\"$aname\",\"model\":\"anthropic/claude-sonnet-4-20250514\",\"embedding\":\"openai/text-embedding-3-small\"}")
2598
+ agent_id=$(echo "$resp" | python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))" 2>/dev/null)
2599
+ if [[ -n "$agent_id" ]]; then
2600
+ echo "$agent_id" > "$HOME/.letta_agent_id"
2601
+ echo -e "${GREEN}✓ Agent created: $agent_id${NC}"
2602
+ else
2603
+ echo -e "${RED}✗ Failed to create agent${NC}"
2604
+ fi
2605
+ else
2606
+ echo -e "${RED}No API key set${NC}"
2607
+ fi
2608
+ ;;
2609
+ esac
2610
+ ;;
2611
+ 4)
2612
+ # View All Configs
2613
+ echo ""
2614
+ echo -e "${BLUE}═══ ALL CONFIGURATIONS ═══${NC}"
2615
+ echo ""
2616
+ echo -e "${CYAN}🤖 Claude/Anthropic:${NC}"
2617
+ [[ -f "$HOME/.anthropic_api_key" ]] && echo " ✓ API Key set" || echo " ✗ API Key not set"
2618
+ echo ""
2619
+ echo -e "${CYAN}🇨🇳 ZhipuAI/GLM:${NC}"
2620
+ [[ -f "$HOME/.glm_api_key" ]] && echo " ✓ API Key set" || echo " ✗ API Key not set"
2621
+ echo ""
2622
+ echo -e "${CYAN}🧠 Letta AI:${NC}"
2623
+ [[ -f "$HOME/.letta_api_key" ]] && echo " ✓ API Key set" || echo " ✗ API Key not set"
2624
+ [[ -f "$HOME/.letta_agent_id" ]] && echo " ✓ Agent ID: $(cat $HOME/.letta_agent_id)" || echo " ✗ Agent ID not set"
2625
+ echo ""
2626
+ echo -e "${CYAN}Other Keys:${NC}"
2627
+ for kf in "$HOME"/.{openai,groq,perplexity,cohere,deepseek,mistral,moonshot,openrouter}_api_key; do
2628
+ [[ -f "$kf" ]] && echo " ✓ $(basename $kf .api_key | sed 's/^\.//')"
2629
+ done
2630
+ ;;
2631
+ 5)
2632
+ # API Key Manager
2633
+ echo ""
2634
+ echo -e "${BLUE}═══ API KEY MANAGER ═══${NC}"
2635
+ echo ""
2636
+ echo "1) Delete Claude API Key"
2637
+ echo "2) Delete GLM API Key"
2638
+ echo "3) Delete Letta API Key"
2639
+ echo "4) Delete ALL API Keys"
2640
+ echo "0) Back"
2641
+ echo ""
2642
+ read -p "Pilih: " key_op
2643
+ case $key_op in
2644
+ 1) rm -f "$HOME/.anthropic_api_key" && echo -e "${GREEN}✓ Deleted${NC}" ;;
2645
+ 2) rm -f "$HOME/.glm_api_key" && echo -e "${GREEN}✓ Deleted${NC}" ;;
2646
+ 3) rm -f "$HOME/.letta_api_key" "$HOME/.letta_agent_id" && echo -e "${GREEN}✓ Deleted${NC}" ;;
2647
+ 4)
2648
+ read -p "Are you sure? (yes/no): " confirm
2649
+ if [[ "$confirm" == "yes" ]]; then
2650
+ rm -f "$HOME"/.*_api_key "$HOME/.letta_agent_id"
2651
+ echo -e "${GREEN}✓ All API keys deleted${NC}"
2652
+ fi
2653
+ ;;
2654
+ esac
2655
+ ;;
2656
+ 6)
2657
+ # Reset Config
2658
+ echo ""
2659
+ echo -e "${RED}⚠️ This will delete all configurations!${NC}"
2660
+ read -p "Type 'RESET' to confirm: " confirm
2661
+ if [[ "$confirm" == "RESET" ]]; then
2662
+ rm -f "$HOME"/.*_api_key "$HOME/.letta_agent_id" "$HOME/.claude.json"
2663
+ echo -e "${GREEN}✓ All configs reset${NC}"
2477
2664
  fi
2478
2665
  ;;
2479
- *)
2666
+ 0|*)
2480
2667
  echo "Kembali ke menu utama..."
2668
+ exec "$0"
2481
2669
  ;;
2482
2670
  esac
2483
2671
  echo ""
2484
2672
  echo -e "${YELLOW}Press Enter untuk kembali...${NC}"
2485
2673
  read
2486
- # Restart the menu
2487
2674
  exec "$0"
2488
2675
  ;;
2489
2676
  21)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-all-config",
3
- "version": "3.1.13",
3
+ "version": "3.1.14",
4
4
  "description": "🤖 Universal AI CLI Config with Advanced Skills System - Quality Scoring, Scaffolding, Testing, Hooks & Multi-Agent Support (Claude Code, Cursor, Copilot, Gemini & 20+ More)",
5
5
  "main": "index.js",
6
6
  "bin": {