Installing the Goofer ORM CLI
This guide will walk you through the process of installing the Goofer ORM CLI on your system.
Prerequisites
Before installing the Goofer ORM CLI, make sure you have the following prerequisites:
- Go 1.21 or later installed on your system
- Git for cloning the repository (if installing from source)
Installation Methods
There are several ways to install the Goofer ORM CLI:
- Using Go Install (recommended)
- Using Homebrew (macOS and Linux)
- Downloading Binaries
- Building from Source
Using Go Install
The easiest way to install the Goofer ORM CLI is using Go’s built-in installation tool:
go install github.com/gooferOrm/goofer/cmd/goofer@latestThis will download, compile, and install the latest version of the CLI to your $GOPATH/bin directory. Make sure this directory is in your system’s PATH to use the goofer command from anywhere.
To verify the installation, run:
goofer versionYou should see output similar to:
Goofer ORM v0.1.0Using Homebrew
If you’re using macOS or Linux with Homebrew, you can install the Goofer ORM CLI using:
brew tap gooferOrm/goofer
brew install gooferTo verify the installation, run:
goofer versionDownloading Binaries
You can download pre-compiled binaries for your operating system from the GitHub Releases page.
- Go to the Releases page
- Download the appropriate binary for your operating system and architecture
- Extract the archive
- Move the
gooferbinary to a directory in yourPATH
For example, on macOS or Linux:
# Download the binary (replace X.Y.Z with the version and OS/ARCH with your system)
curl -L https://github.com/gooferOrm/goofer/releases/download/vX.Y.Z/goofer_X.Y.Z_OS_ARCH.tar.gz -o goofer.tar.gz
# Extract the archive
tar -xzf goofer.tar.gz
# Move the binary to a directory in your PATH
sudo mv goofer /usr/local/bin/
# Verify the installation
goofer versionOn Windows, you can download the ZIP file, extract it, and add the directory to your PATH environment variable.
Building from Source
If you want to build the CLI from source, follow these steps:
- Clone the repository:
git clone https://github.com/gooferOrm/goofer.git
cd goofer- Build the CLI:
go build -o goofer ./cmd/goofer- Move the binary to a directory in your
PATH:
# On macOS/Linux
sudo mv goofer /usr/local/bin/
# On Windows, move it to a directory in your PATH- Verify the installation:
goofer versionShell Completion
The Goofer ORM CLI supports shell completion for Bash, Zsh, Fish, and PowerShell.
Bash
Add the following to your ~/.bashrc file:
source <(goofer completion bash)Zsh
Add the following to your ~/.zshrc file:
source <(goofer completion zsh)Fish
Add the following to your ~/.config/fish/config.fish file:
goofer completion fish | sourcePowerShell
Add the following to your PowerShell profile:
goofer completion powershell | Out-String | Invoke-ExpressionUpdating the CLI
To update the Goofer ORM CLI to the latest version:
Using Go Install
go install github.com/gooferOrm/goofer/cmd/goofer@latestUsing Homebrew
brew upgrade gooferUsing Binaries or Source
Follow the same installation process with the new version.
Troubleshooting
Command Not Found
If you get a “command not found” error when trying to run goofer, make sure:
- The installation was successful
- The directory containing the
gooferbinary is in yourPATH
You can check your PATH with:
echo $PATHPermission Denied
If you get a “permission denied” error, make sure the binary is executable:
chmod +x /path/to/gooferOther Issues
If you encounter any other issues, please check the GitHub Issues page or create a new issue.
Next Steps
Now that you have installed the Goofer ORM CLI, you can:
- Learn about the available commands
- See how to configure the CLI
- Start creating migrations
- Begin generating code