-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathinstall_globally.sh
More file actions
executable file
·37 lines (28 loc) · 1.04 KB
/
install_globally.sh
File metadata and controls
executable file
·37 lines (28 loc) · 1.04 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
#!/bin/bash
# Script to install the agent-cli globally
# Get the absolute path to the virtual environment
VENV_PATH="$(pwd)/.venv"
ACTIVATE_PATH="$VENV_PATH/bin/activate"
AGENT_CLI_PATH="$VENV_PATH/bin/agent-cli"
# Check if the virtual environment exists
if [ ! -f "$ACTIVATE_PATH" ]; then
echo "Virtual environment not found. Running setup first..."
./setup.sh
fi
# Create a wrapper script in /usr/local/bin
WRAPPER_SCRIPT="/usr/local/bin/agent-cli"
echo "Creating wrapper script at $WRAPPER_SCRIPT..."
cat > /tmp/agent-cli-wrapper << EOF
#!/bin/bash
# Wrapper script for agent-cli
# Source the virtual environment
source "$ACTIVATE_PATH"
# Run the agent-cli with all arguments passed to this script
"$AGENT_CLI_PATH" "\$@"
EOF
# Make the wrapper script executable
chmod +x /tmp/agent-cli-wrapper
# Move the wrapper script to /usr/local/bin (requires sudo)
echo "Installing wrapper script to $WRAPPER_SCRIPT (requires sudo)..."
sudo mv /tmp/agent-cli-wrapper "$WRAPPER_SCRIPT"
echo "Installation complete! You can now run 'agent-cli' from anywhere."