forked from civai-technologies/cursor-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_install.sh
More file actions
executable file
·73 lines (61 loc) · 2.52 KB
/
dev_install.sh
File metadata and controls
executable file
·73 lines (61 loc) · 2.52 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
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -e
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${GREEN}=== Cursor Agent Development Installation ===${NC}"
# Check if we're in a virtual environment
if [ -z "$VIRTUAL_ENV" ]; then
echo -e "${YELLOW}Warning: Not running in a virtual environment. It's recommended to use one.${NC}"
read -p "Continue anyway? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborting installation."
exit 1
fi
fi
echo -e "${GREEN}Cleaning up previous builds...${NC}"
rm -rf build/ dist/ *.egg-info/ cursor_agent.egg-info/ cursor_agent_tools.egg-info/
echo -e "${GREEN}Installing package in development mode...${NC}"
pip install -e . # -e is for editable mode
echo -e "${GREEN}Verifying installation...${NC}"
# Check if agent package is installed
echo -en "Checking agent package... "
if python -c 'import agent; print(agent.__file__)' > /dev/null 2>&1; then
AGENT_PATH=$(python -c 'import agent; print(agent.__file__)')
echo -e "${GREEN}OK${NC} at $AGENT_PATH"
else
echo -e "${RED}FAILED${NC}"
echo "The agent package could not be imported."
fi
# Check if cursor_agent package is installed
echo -en "Checking cursor_agent package... "
if python -c 'import cursor_agent; print(cursor_agent.__file__)' > /dev/null 2>&1; then
CURSOR_AGENT_PATH=$(python -c 'import cursor_agent; print(cursor_agent.__file__)')
echo -e "${GREEN}OK${NC} at $CURSOR_AGENT_PATH"
else
echo -e "${RED}FAILED${NC}"
echo "The cursor_agent package could not be imported."
fi
# Check if cursor_agent_tools package is installed
echo -en "Checking cursor_agent_tools package... "
if python -c 'import cursor_agent_tools; print(cursor_agent_tools.__file__)' > /dev/null 2>&1; then
TOOLS_PATH=$(python -c 'import cursor_agent_tools; print(cursor_agent_tools.__file__)')
echo -e "${GREEN}OK${NC} at $TOOLS_PATH"
else
echo -e "${RED}FAILED${NC}"
echo "The cursor_agent_tools package could not be imported."
fi
# Verify import functionality
echo -en "Verifying import structure... "
if python -c 'from cursor_agent import ClaudeAgent, OpenAIAgent, create_agent; from cursor_agent_tools import ClaudeAgent, OpenAIAgent, create_agent; from agent import ClaudeAgent, OpenAIAgent, create_agent' > /dev/null 2>&1; then
echo -e "${GREEN}OK${NC}"
else
echo -e "${RED}FAILED${NC}"
echo "The import structure could not be verified."
fi
# Make the script executable
chmod +x dev_install.sh
echo -e "${GREEN}Installation process completed.${NC}"