Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated setup of agent-zero in Windows and Unix based sytems. #107

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions setup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
@echo off
setlocal enabledelayedexpansion

:: Clone the repository
set REPO_URL=https://github.com/frdel/agent-zero.git
set REPO_DIR=agent-zero

if not exist %REPO_DIR% (
echo Cloning the repository...
git clone %REPO_URL%
if %errorlevel% neq 0 (
echo Failed to clone the repository.
exit /b 1
)
echo Repository cloned successfully.
) else (
echo Repository already exists. Pulling latest changes...
cd %REPO_DIR%
git pull
if %errorlevel% neq 0 (
echo Failed to pull the latest changes.
exit /b 1
)
echo Repository updated successfully.
cd ..
)

cd %REPO_DIR%

:: Set up environment variables
echo Setting up environment variables...
if not exist .env (
echo .env file not found, copying from example.env...
copy example.env .env
)
echo Environment variables set up.

:: Install Python dependencies
echo Checking for Python installation...
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo Python is not installed. Please install Python and try again.
exit /b 1
)

echo Installing Python dependencies...
pip install --upgrade pip
pip install -r requirements.txt
if %errorlevel% neq 0 (
echo Failed to install Python dependencies.
exit /b 1
)
echo Python dependencies installed.

:: Install Docker (optional)
echo Checking for Docker installation...
docker --version >nul 2>&1
if %errorlevel% neq 0 (
echo Docker is not installed. You can download and install Docker Desktop from https://www.docker.com/products/docker-desktop
echo Skipping Docker setup.
) else (
echo Docker is installed. Setting up Docker container...
docker pull frdel/agent-zero-exe
if %errorlevel% neq 0 (
echo Failed to pull Docker image.
exit /b 1
)
echo Docker container setup complete.
)

:: Run the main program
echo Running the Agent Zero framework...
python main.py

:: Keep the command prompt open after execution
echo Agent Zero setup and execution complete.
pause
63 changes: 63 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

# Enable exit on error
set -e

# Define variables
REPO_URL="https://github.com/frdel/agent-zero.git"
REPO_DIR="agent-zero"

# Clone the repository if it doesn't exist
if [ ! -d "$REPO_DIR" ]; then
echo "Cloning the repository..."
git clone "$REPO_URL"
echo "Repository cloned successfully."
else
echo "Repository already exists. Pulling latest changes..."
cd "$REPO_DIR"
git pull
echo "Repository updated successfully."
cd ..
fi

# Change to the repository directory
cd "$REPO_DIR"

# Set up environment variables
echo "Setting up environment variables..."
if [ ! -f ".env" ]; then
echo ".env file not found, copying from example.env..."
cp example.env .env
fi
echo "Environment variables set up."

# Install Python dependencies
echo "Checking for Python installation..."
if ! command -v python3 &> /dev/null; then
echo "Python is not installed. Please install Python and try again."
exit 1
fi

echo "Installing Python dependencies..."
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
echo "Python dependencies installed."

# Install Docker (optional)
echo "Checking for Docker installation..."
if ! command -v docker &> /dev/null; then
echo "Docker is not installed. You can download and install Docker from https://www.docker.com/products/docker-desktop"
echo "Skipping Docker setup."
else
echo "Docker is installed. Setting up Docker container..."
docker pull frdel/agent-zero-exe
echo "Docker container setup complete."
fi

# Run the main program
echo "Running the Agent Zero framework..."
python3 main.py

# Keep the terminal open after execution
echo "Agent Zero setup and execution complete."
exec "$SHELL"