forked from gkamradt/SnakeBench
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·63 lines (52 loc) · 2.12 KB
/
dev.sh
File metadata and controls
executable file
·63 lines (52 loc) · 2.12 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
#!/bin/bash
# LLMSnake Development Environment Launcher
# This script starts both frontend and backend in a tmux session
SESSION_NAME="llmsnake-dev"
# Check if tmux is installed
if ! command -v tmux &> /dev/null; then
echo "Error: tmux is not installed. Please install it first:"
echo " macOS: brew install tmux"
echo " Linux: sudo apt-get install tmux"
exit 1
fi
# Kill existing session if it exists
tmux has-session -t $SESSION_NAME 2>/dev/null
if [ $? -eq 0 ]; then
echo "Killing existing session: $SESSION_NAME"
tmux kill-session -t $SESSION_NAME
fi
# Create new session with backend
echo "Starting $SESSION_NAME tmux session..."
tmux new-session -d -s $SESSION_NAME -n dev
# Start backend in first pane (activate venv first)
tmux send-keys -t $SESSION_NAME:dev "cd backend && source venv/bin/activate && python3 app.py" C-m
# Split window vertically and start frontend in the right pane
tmux split-window -h -t $SESSION_NAME:dev
tmux send-keys -t $SESSION_NAME:dev "cd frontend && npm run dev" C-m
# Split the right pane horizontally to add Celery worker at bottom
# COMMENTED OUT: Using Railway worker instead of local worker
# tmux split-window -v -t $SESSION_NAME:dev.1
# tmux send-keys -t $SESSION_NAME:dev "cd backend && source venv/bin/activate && python3.11 -m celery -A celery_app worker --loglevel=info --concurrency=2 --max-tasks-per-child=10" C-m
# Select the left pane (backend) by default
tmux select-pane -t $SESSION_NAME:dev.0
# Attach to the session
echo ""
echo "====================================="
echo "LLMSnake Dev Environment Started!"
echo "====================================="
echo ""
echo "Backend API: Running in left pane"
echo "Frontend: Running in top-right pane"
echo "Celery Worker: Running in bottom-right pane"
echo ""
echo "Tmux Controls:"
echo " - Switch panes: Ctrl+b then arrow keys or o"
echo " - Detach session: Ctrl+b then d"
echo " - Kill session: tmux kill-session -t $SESSION_NAME"
echo ""
echo "Note: Redis must be running for Celery worker"
echo " Start Redis: brew services start redis"
echo ""
echo "Attaching to tmux session..."
sleep 2
tmux attach-session -t $SESSION_NAME