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
- Download Go from golang.org/dl (opens in a new tab)
- Run the installer and follow the prompts
- 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
- Download Go from golang.org/dl (opens in a new tab)
- Run the installer and follow the prompts
- Restart your command prompt
- 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:
- Go 1.21+ (for building the supervisor) - Installation instructions above
- Python 3.10+ (for the RL Swarm application)
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)
-
Find your Go bin directory:
go env GOPATH
This will show something like
/Users/username/go
-
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
-
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)
-
Find your Go bin directory:
go env GOPATH
-
Add to your shell configuration:
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.bashrc source ~/.bashrc
-
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
-
Find your Go bin directory:
go env GOPATH
-
Add to PATH permanently:
- Press
Win + R
, typesysdm.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
- Press
-
Or add via command line (requires admin):
setx PATH "%PATH%;%GOPATH%\bin"
-
Restart your command prompt and verify:
gswarm --version
Using PowerShell
-
Find your Go bin directory:
go env GOPATH
-
Add to PATH for current session:
$env:PATH += ";$(go env GOPATH)\bin"
-
Add to PATH permanently:
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$(go env GOPATH)\bin", "User")
-
Restart PowerShell and verify:
gswarm --version
Alternative: Manual PATH Addition
If the above methods don't work, you can manually add the path:
-
Find your Go bin directory:
go env GOPATH
-
Add the
/bin
suffix to that path -
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
-
Check if the binary exists:
ls $(go env GOPATH)/bin/gswarm
-
Check your current PATH:
echo $PATH
-
Check if Go bin is in PATH:
echo $PATH | grep $(go env GOPATH)/bin
-
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:
- Navigate to your Gensyn RL Swarm directory
- Run
gswarm
to start the supervisor - Check out the Getting Started guide for detailed usage instructions