docs
Installation

Installation

Installing Go

Before installing GSwarm, you need to have Go 1.21 or higher installed. Here's how to install Go on your system:

macOS

Using Homebrew (Recommended)

brew install go

Manual Installation

  1. Download Go from golang.org/dl (opens in a new tab)
  2. Run the installer and follow the prompts
  3. Verify installation:
    go version

Linux

Ubuntu/Debian

sudo apt update
sudo apt install golang-go

CentOS/RHEL/Fedora

# CentOS/RHEL
sudo yum install golang
 
# Fedora
sudo dnf install golang

Manual Installation

# Download and extract Go
wget https://golang.org/dl/go1.21.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.linux-amd64.tar.gz
 
# Add to PATH
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
 
# Verify installation
go version

Windows

Using Chocolatey

choco install golang

Using Scoop

scoop install go

Manual Installation

  1. Download Go from golang.org/dl (opens in a new tab)
  2. Run the installer and follow the prompts
  3. Restart your command prompt
  4. Verify installation:
    go version

Verify Go Installation

After installing Go, verify it's working correctly:

go version
go env GOPATH
go env GOROOT

You should see output similar to:

go version go1.21.0 darwin/amd64
/Users/username/go
/usr/local/go

Prerequisites

Before installing GSwarm, ensure you have the following prerequisites:

Installation Methods

Option 1: Install with Go (Recommended)

The easiest way to install GSwarm is using Go's install command:

go install github.com/Deep-Commit/gswarm/cmd/gswarm@latest

This will place the gswarm binary in your $GOPATH/bin or $HOME/go/bin. Make sure this directory is in your PATH.

Verify Installation

After installation, verify that GSwarm is working correctly:

gswarm --version

Option 2: Clone and Build from Source

If you prefer to build from source or want to contribute to the project:

git clone https://github.com/Deep-Commit/gswarm.git
cd gswarm
make build
make install

After building, you can run gswarm from anywhere (if your Go bin directory is in your PATH).

PATH Configuration

After installing GSwarm, you need to add the Go bin directory to your PATH so you can run gswarm from anywhere. Here are instructions for each operating system:

macOS

Using bash/zsh (default shell)

  1. Find your Go bin directory:

    go env GOPATH

    This will show something like /Users/username/go

  2. Add to your shell configuration file:

    For zsh (default on modern macOS):

    echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrc
    source ~/.zshrc

    For bash:

    echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.bash_profile
    source ~/.bash_profile
  3. Verify the setup:

    gswarm --version

Using fish shell

set -gx PATH $PATH (go env GOPATH)/bin
echo 'set -gx PATH $PATH (go env GOPATH)/bin' >> ~/.config/fish/config.fish

Linux

Using bash (most common)

  1. Find your Go bin directory:

    go env GOPATH
  2. Add to your shell configuration:

    echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.bashrc
    source ~/.bashrc
  3. Verify the setup:

    gswarm --version

Using zsh

echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrc
source ~/.zshrc

Using fish shell

set -gx PATH $PATH (go env GOPATH)/bin
echo 'set -gx PATH $PATH (go env GOPATH)/bin' >> ~/.config/fish/config.fish

Windows

Using Command Prompt

  1. Find your Go bin directory:

    go env GOPATH
  2. Add to PATH permanently:

    • Press Win + R, type sysdm.cpl, and press Enter
    • Click "Environment Variables"
    • Under "User variables", find "Path" and click "Edit"
    • Click "New" and add: %GOPATH%\bin
    • Click "OK" on all dialogs
  3. Or add via command line (requires admin):

    setx PATH "%PATH%;%GOPATH%\bin"
  4. Restart your command prompt and verify:

    gswarm --version

Using PowerShell

  1. Find your Go bin directory:

    go env GOPATH
  2. Add to PATH for current session:

    $env:PATH += ";$(go env GOPATH)\bin"
  3. Add to PATH permanently:

    [Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$(go env GOPATH)\bin", "User")
  4. Restart PowerShell and verify:

    gswarm --version

Alternative: Manual PATH Addition

If the above methods don't work, you can manually add the path:

  1. Find your Go bin directory:

    go env GOPATH
  2. Add the /bin suffix to that path

  3. Add to your PATH manually:

    macOS/Linux:

    # Replace /path/to/your/gopath with the actual path
    export PATH=$PATH:/path/to/your/gopath/bin

    Windows:

    set PATH=%PATH%;C:\path\to\your\gopath\bin

Troubleshooting PATH Issues

"gswarm command not found" after installation

  1. Check if the binary exists:

    ls $(go env GOPATH)/bin/gswarm
  2. Check your current PATH:

    echo $PATH
  3. Check if Go bin is in PATH:

    echo $PATH | grep $(go env GOPATH)/bin
  4. If not found, add it manually:

    export PATH=$PATH:$(go env GOPATH)/bin

Common PATH locations

If go env GOPATH doesn't work, try these common locations:

  • macOS/Linux: $HOME/go/bin
  • Windows: %USERPROFILE%\go\bin

Verify Go installation

If you're having trouble, verify Go is properly installed:

go version
go env GOPATH
go env GOROOT

Development Setup

If you're developing GSwarm or want to build specific versions:

git clone https://github.com/Deep-Commit/gswarm.git
cd gswarm
 
# Build the application
make build
 
# Build all platforms
make build-all
 
# Install to your system
make install
 
# Run tests
make test
 
# Run tests with coverage
make test-coverage
 
# Format code
make fmt
 
# Lint code
make lint

Troubleshooting Installation

Common Issues

"gswarm command not found"

  • Ensure Go is installed and $GOPATH/bin is in your PATH
  • Reinstall with: go install github.com/Deep-Commit/gswarm/cmd/gswarm@latest
  • Follow the PATH configuration instructions above

"python3 not found"

  • Ensure Python 3.10+ is installed and in PATH
  • Use python3 --version to verify

"Requirements installation failed"

  • Ensure requirements.txt exists in your RL Swarm directory
  • Check network connectivity for pip install

"Permission denied"

  • Make sure all files are executable as needed
  • Ensure proper file permissions

PATH Configuration

If you're having trouble with the gswarm command not being found, you may need to add Go's bin directory to your PATH:

For bash/zsh:

export PATH=$PATH:$(go env GOPATH)/bin

For fish:

set -gx PATH $PATH (go env GOPATH)/bin

Add this to your shell configuration file (.bashrc, .zshrc, config.fish) to make it permanent.

Next Steps

Once GSwarm is installed, you can:

  1. Navigate to your Gensyn RL Swarm directory
  2. Run gswarm to start the supervisor
  3. Check out the Getting Started guide for detailed usage instructions