-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
58 lines (47 loc) · 1.5 KB
/
start.sh
File metadata and controls
58 lines (47 loc) · 1.5 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
#!/bin/bash
# Claude Code (Gemini 3) Launcher
# Starts the proxy and launches Claude Code CLI connected to it.
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Ensure Node.js is available
if ! command -v node &> /dev/null; then
if [ -s "$HOME/.nvm/nvm.sh" ]; then
export NVM_DIR="$HOME/.nvm"
. "$NVM_DIR/nvm.sh"
fi
fi
if ! command -v node &> /dev/null; then
echo "❌ Node.js not found. Please install Node.js."
exit 1
fi
# Kill any existing proxy on port 51200 to ensure fresh start
kill -9 $(lsof -t -i :51200) 2>/dev/null || true
# sleep 0.2
# Start proxy in background
PROXY_LOG="$HOME/.claude-code-proxy.log"
node "$SCRIPT_DIR/proxy.js" >> "$PROXY_LOG" 2>&1 &
PROXY_PID=$!
# Wait for proxy to bind port
echo "Waiting for proxy to start..."
for i in {1..50}; do
if ! kill -0 $PROXY_PID 2>/dev/null; then
echo "❌ Proxy failed to start!"
exit 1
fi
if lsof -i :51200 >/dev/null 2>&1; then
break
fi
sleep 0.1
done
echo "✅ Proxy connected."
echo "🚀 Model: Gemini 3 Pro (High Reasoning)"
echo "💡 Note: Automatically falls back to Flash if rate limited."
# Configure Claude Code to use local proxy
export ANTHROPIC_BASE_URL=http://localhost:51200
export ANTHROPIC_API_KEY=claude-code-gym-key
# Launch Claude Code
# Using --dangerously-skip-permissions to avoid constant approval prompts for read/write
claude --model gemini-3-pro --dangerously-skip-permissions
# Cleanup when Claude exits
kill $PROXY_PID 2>/dev/null
echo "Proxy stopped."