Installation
This guide will walk you through installing Goca on your system using various methods.
Prerequisites
Before installing Goca, ensure you have:
- Go 1.21 or higher (Goca itself requires Go 1.25.1 to build) - Download Go
- Git - For version control and cloning repositories
- Terminal or Command Prompt - To run installation commands
Check Your Go Version
go versionYou should see go version go1.21 or higher (Goca itself requires Go 1.25.1 to build).
Installation Methods
Method 1: go install (Recommended)
This is the fastest and simplest method:
go install github.com/sazardev/goca@latestVerify the installation:
goca versionExpected output:
Goca v1.18.2
Build: 2025-10-11T10:00:00Z
Go Version: go1.24.5
OS/Arch: linux/amd64Troubleshooting: Command Not Found
If you get command not found, ensure $GOPATH/bin is in your PATH:
Linux/macOS:
export PATH=$PATH:$(go env GOPATH)/binAdd this to your ~/.bashrc, ~/.zshrc, or ~/.profile to make it permanent.
Windows: Add %USERPROFILE%\go\bin to your system PATH environment variable.
Method 2: Binary Downloads
Download pre-compiled binaries directly from GitHub Releases.
# Download the binary
wget https://github.com/sazardev/goca/releases/latest/download/goca-linux-amd64
# Make it executable
chmod +x goca-linux-amd64
# Move to PATH
sudo mv goca-linux-amd64 /usr/local/bin/goca
# Verify
goca version# Download the binary
curl -L https://github.com/sazardev/goca/releases/latest/download/goca-darwin-amd64 -o goca
# Make it executable
chmod +x goca
# Move to PATH
sudo mv goca /usr/local/bin/goca
# Verify
goca version# Download the binary
curl -L https://github.com/sazardev/goca/releases/latest/download/goca-darwin-arm64 -o goca
# Make it executable
chmod +x goca
# Move to PATH
sudo mv goca /usr/local/bin/goca
# Verify
goca version# Download the binary
Invoke-WebRequest -Uri "https://github.com/sazardev/goca/releases/latest/download/goca-windows-amd64.exe" -OutFile "goca.exe"
# Move to a directory in PATH (requires admin)
Move-Item goca.exe C:\Windows\System32\goca.exe
# Verify
goca versionMethod 3: Homebrew (macOS)
If you're on macOS and use Homebrew:
# Add the Goca tap
brew tap sazardev/tools
# Install Goca
brew install goca
# Verify
goca versionUpdating via Homebrew
brew upgrade gocaMethod 4: Build from Source
For developers who want the latest development version or want to contribute:
# Clone the repository
git clone https://github.com/sazardev/goca.git
cd goca
# Build the binary
go build -o goca
# (Optional) Install globally
sudo mv goca /usr/local/bin/goca
# Verify
goca versionBuilding for Different Platforms
# Linux
GOOS=linux GOARCH=amd64 go build -o goca-linux-amd64
# macOS Intel
GOOS=darwin GOARCH=amd64 go build -o goca-darwin-amd64
# macOS Apple Silicon
GOOS=darwin GOARCH=arm64 go build -o goca-darwin-arm64
# Windows
GOOS=windows GOARCH=amd64 go build -o goca-windows-amd64.exeVerify Installation
After installation, run:
goca --helpYou should see the help menu with all available commands:
Goca - Go Clean Architecture Code Generator
Usage:
goca [command]
Available Commands:
init Initialize a new Clean Architecture project
feature Generate a complete feature with all layers
entity Generate a domain entity
usecase Generate use cases
repository Generate repositories
handler Generate handlers
di Generate dependency injection
integrate Integrate existing features
interfaces Generate interfaces
messages Generate messages
template Manage templates
middleware Generate middleware
analyze Analyze project structure
config Manage configuration
ci Generate CI/CD configuration
doctor Diagnose project issues
upgrade Upgrade project structure
mcp-server Start MCP server
version Show version information
Flags:
-h, --help help for goca
-v, --version version for goca
Use "goca [command] --help" for more information about a command.Shell Completion (Optional)
Enable command auto-completion for your shell:
# Generate completion script
goca completion bash > /etc/bash_completion.d/goca
# Or for current user only
goca completion bash > ~/.bash_completion
source ~/.bash_completion# Generate completion script
goca completion zsh > "${fpath[1]}/_goca"
# Reload completions
autoload -U compinit && compinit# Generate completion script
goca completion fish > ~/.config/fish/completions/goca.fish# Generate completion script
goca completion powershell | Out-String | Invoke-Expression
# To make permanent, add to profile
goca completion powershell >> $PROFILEUpdate Goca
If installed via go install:
go install github.com/sazardev/goca@latestIf installed via Homebrew:
brew upgrade gocaIf installed from binary:
Download the latest binary and replace the existing one following the Binary Downloads steps.
Uninstall Goca
If installed via go install:
rm $(which goca)If installed via Homebrew:
brew uninstall goca
brew untap sazardev/toolsIf installed from binary:
# Linux/macOS
sudo rm /usr/local/bin/goca
# Windows (as Administrator)
del C:\Windows\System32\goca.exeNext Steps
Now that you have Goca installed, you're ready to start building!
- Quick Start Guide - Create your first project
- Learn Clean Architecture - Understand the principles
- Complete Tutorial - Build a real application
Troubleshooting
Permission Denied
If you get permission errors on Linux/macOS:
sudo chmod +x /usr/local/bin/gocaCommand Not Found After Installation
Make sure your $PATH includes Go's bin directory:
echo $PATH | grep -q "go/bin" && echo " Go bin in PATH" || echo "✗ Add Go bin to PATH"Version Mismatch
If goca version shows an old version:
# Clear Go cache
go clean -modcache
# Reinstall
go install github.com/sazardev/goca@latestWindows: goca is not recognized
Ensure you've added Go's bin directory to your system PATH:
- Open System Properties → Environment Variables
- Edit the
Pathvariable - Add
%USERPROFILE%\go\bin - Restart your terminal
Need Help?
- GitHub Issues - Report bugs
- Discussions - Ask questions
- Documentation - Read the docs