-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtwitter-agent.sh
More file actions
48 lines (39 loc) · 1.23 KB
/
Copy pathtwitter-agent.sh
File metadata and controls
48 lines (39 loc) · 1.23 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
#!/bin/bash
# Twitter Agent Launcher - Activates venv and runs the agent
# Usage: ./twitter-agent.sh "<twitter task>" [max_steps]
# Get the directory where this script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"
# Check if venv exists
if [ ! -f ".venv/bin/activate" ]; then
echo "[ERROR] Virtual environment not found!"
echo "Please run: python run_agent.py \"x.com\" \"test\" 0"
echo "This will create the venv automatically."
exit 1
fi
# Activate virtual environment
source .venv/bin/activate
# Check if task argument is provided
if [ -z "$1" ]; then
echo "Usage: ./twitter-agent.sh \"<twitter task>\" [max_steps]"
echo ""
echo "Examples:"
echo " ./twitter-agent.sh \"search for AI accounts and follow 10\" 0"
echo " ./twitter-agent.sh \"post a tweet about crypto\" 0"
echo " ./twitter-agent.sh \"find crypto tweets and like 5 of them\" 0"
echo ""
exit 1
fi
# Get task and steps
TASK="$1"
STEPS="${2:-0}" # Default to 0 (unlimited) if not provided
# Run the agent
echo "Starting Twitter Agent..."
echo "Task: $TASK"
echo "Steps: $STEPS"
echo ""
python run_agent.py "x.com" "$TASK" "$STEPS"
# Deactivate venv
deactivate
echo ""
echo "Agent finished."