Skip to content
EN · PT

Installing the Anchors CLI

The Anchors CLI (anchors) is distributed as a single static binary with zero external runtime dependencies. It runs seamlessly on local developer machines, inside AI pair programming environments (such as Claude Code, Cursor, Windsurf, or terminal agents), and within continuous integration (CI/CD) pipelines.


The simplest and most automated way to install and maintain Anchors on macOS and Linux is through Homebrew:

Terminal window
# Add the official CO2 Lab tap
brew tap co2-lab/tap
# Install Anchors
brew install anchors
# Verify installation
anchors version

If you do not use Homebrew, you can install the latest release directly via our secure installer script:

Terminal window
curl -fsSL https://raw.githubusercontent.com/co2-lab/anchors/main/install.sh | bash

The installer detects your operating system and architecture (amd64 or arm64), downloads the latest verified GitHub release binary, verifies checksums, and places it in /usr/local/bin (or ~/.local/bin).


If you have Go (1.23+) installed on your machine:

Terminal window
go install github.com/co2-lab/anchors/cmd/anchors@latest

Ensure that $GOPATH/bin (typically ~/go/bin) is in your system’s PATH:

Terminal window
export PATH="$HOME/go/bin:$PATH"

3. Direct Binary Download (GitHub Releases)

Section titled “3. Direct Binary Download (GitHub Releases)”

You can download pre-compiled, signed standalone binaries directly from GitHub Releases:

Operating System Architecture Binary Package
macOS Apple Silicon (M1/M2/M3/M4) anchors_darwin_arm64.tar.gz
macOS Intel (x86_64) anchors_darwin_amd64.tar.gz
Linux 64-bit x86 (amd64) anchors_linux_amd64.tar.gz
Linux ARM64 (aarch64) anchors_linux_arm64.tar.gz
Windows 64-bit (x86_64) anchors_windows_amd64.zip
Terminal window
# Example for Linux AMD64
curl -LO https://github.com/co2-lab/anchors/releases/latest/download/anchors_linux_amd64.tar.gz
tar -xzf anchors_linux_amd64.tar.gz
sudo mv anchors /usr/local/bin/
sudo chmod +x /usr/local/bin/anchors

Open PowerShell as Administrator:

Terminal window
Invoke-WebRequest -Uri "https://github.com/co2-lab/anchors/releases/latest/download/anchors_windows_amd64.zip" -OutFile "$env:TEMPnchors.zip"
Expand-Archive -Path "$env:TEMPnchors.zip" -DestinationPath "$env:ProgramFiles\Anchors" -Force
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:ProgramFiles\Anchors", "Machine")
Terminal window
scoop bucket add co2-lab https://github.com/co2-lab/scoop-bucket.git
scoop install anchors

Anchors is available on GitHub Packages as a minimal, scratch-based container:

Terminal window
docker pull ghcr.io/co2-lab/anchors:latest
# Run against current directory
docker run --rm -v $(pwd):/workspace -w /workspace ghcr.io/co2-lab/anchors:latest check

To run Anchors in your GitHub Actions CI workflows, add the official setup action:

name: Anchors Quality Gates
on: [push, pull_request]
jobs:
anchors-gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: co2-lab/setup-anchors@v1
with:
version: 'latest'
- name: Run Anchors Pipeline
run: anchors check
anchors_check:
image: ghcr.io/co2-lab/anchors:latest
stage: test
script:
- anchors check

Enable tab autocompletions for all commands and flags in your shell:

Terminal window
anchors completion zsh > "${fpath[1]}/_anchors"
# Or append to your .zshrc:
echo 'source <(anchors completion zsh)' >> ~/.zshrc
Terminal window
anchors completion bash > /etc/bash_completion.d/anchors
# Or local profile:
echo 'source <(anchors completion bash)' >> ~/.bashrc
Terminal window
anchors completion fish > ~/.config/fish/completions/anchors.fish

Once installed, run:

Terminal window
# Print installed version and build metadata
anchors version
# Run ecosystem diagnostic
anchors doctor

If you see the output with no errors, you’re ready to proceed to The Workflow or inspect the Commands Reference!