Skip to main content Skip to docs navigation
Check

Download anchor binary / source-files to any environment, local or CI.

Package Managers

Pull in anchor’s binary using popular package managers.

Homebrew

The fastest way (for macOS and Linux) to install anchor is using Homebrew:

brew install ZachiNachshon/tap/anchor

Alternatively, tap into the formula to have brew search capabilities on that tap formulas:

  1. Tap into ZachiNachshon formula

    brew tap ZachiNachshon/tap
    
  2. Install the latest anhcor binary

    brew install anchor
    

Pre-Built Release

  1. Update the download script with the following parameters:

    • VERSION: binary released version
    • OS_ARCH: operating system & architecture tuple
  2. Download and install anchor binary (copy & paste into a terminal):

bash <<'EOF'

# Change Version, OS and Architecture accordingly
VERSION=0.1.0

OS_ARCH=darwin_amd64
# Options: 
#   - darwin_arm64
#   - linux_arm64
#   - linux_armv6
#   - linux_amd64

# Create a temporary folder
repo_temp_path=$(mktemp -d ${TMPDIR:-/tmp}/anchor-repo.XXXXXX)
cwd=$(pwd)
cd ${repo_temp_path}

# Download & extract
echo -e "\nDownloading anchor to temp directory...\n"
curl -SL "https://github.com/ZachiNachshon/anchor/releases/download/v${VERSION}/anchor_${VERSION}_${OS_ARCH}.tar.gz" | tar -xz

# Create a dest directory and move the binary
echo -e "\nMoving binary to ~/.local/bin"
mkdir -p ${HOME}/.local/bin; mv anchor ${HOME}/.local/bin

# Add this line to your *rc file (zshrc, bashrc etc..) to make `anchor` available on new sessions
echo "Exporting ~/.local/bin (make sure to have it available on PATH)"
export PATH="${PATH}:${HOME}/.local/bin"

cd ${cwd}

# Cleanup
if [[ ! -z ${repo_temp_path} && -d ${repo_temp_path} && ${repo_temp_path} == *"anchor-repo"* ]]; then
	echo "Deleting temp directory"
	rm -rf ${repo_temp_path}
fi

echo -e "\nDone (type 'anchor' for help)\n"

EOF

Alternatively, you can download a release directy from GitHub

Download Specific Release

PATH awareness

Make sure ${HOME}/.local/bin exists on the PATH or sourced on every new shell session.

Build from Source

Clone anchor repository into a directory of your choice:

git clone https://github.com/ZachiNachshon/anchor.git; cd anchor

Build to Custom Path

  1. Change directory to the local anchor cloned repository

  2. Build the binary (destination: PWD)

    make build
    
  3. Copy the binary to a bin folder that exists on PATH

    cp anchor ${HOME}/.local/bin
    
  4. (Optional) Alternatively, copy directly to /usr/local/bin

    cp anchor /usr/local/bin
    

PATH awareness

Make sure ${HOME}/.local/bin exists on the PATH or sourced on every new shell session.


Build to GOPATH

  1. Change directory to the local anchor cloned repository

  2. Build the binary (destination: GOPATH/bin)

    make build-to-gopath