CAPYSQUASH

capysquash-cli Installation

Install the free, open-source capysquash-cli command-line tool

capysquash-cli INSTALLATION

Install the free, open-source command-line tool for PostgreSQL migration optimization

capysquash-cli is powered by pgsquash-engine and provides full migration optimization capabilities from your terminal.

New to CAPYSQUASH? The CLI is perfect for local development and CI/CD. For team collaboration and visual workflows, check out the CAPYSQUASH Platform.

QUICK INSTALL

Homebrew (Recommended):

brew install capysquash/tap/capysquash-cli

Go Install:

go install github.com/CAPYSQUASH/capysquash-cli/cmd/capysquash@latest

Verify:

capysquash --version
# capysquash-cli version 0.9.7

Using WSL (Recommended):

# Install Go first if not already installed
go install github.com/CAPYSQUASH/capysquash-cli/cmd/capysquash@latest

Using Scoop:

scoop bucket add capysquash https://github.com/CAPYSQUASH/scoop-bucket
scoop install capysquash-cli

Verify:

capysquash --version

Pull the image:

docker pull capysquash/capysquash-cli:latest

Run analysis:

docker run -v $(pwd)/migrations:/migrations \
  capysquash/capysquash-cli analyze /migrations

WHAT YOU NEED

REQUIREMENTS

  • ☑ Go 1.25.3 or later
  • ☑ SQL migration files (any format)
  • ☑ Docker (optional, for validation)

💡 Coming Soon: Package managers (APT, Scoop) and NPM packages are planned for v1.0 release.

DOCKER INSTALLATION (for validation)

The pgsquash-engine uses Docker for schema validation. Install Docker if you want to use the capysquash validate command:

macOS

brew install --cask docker

Or download Docker Desktop

Linux

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Verify Docker

docker --version
docker ps

PLATFORM-SPECIFIC NOTES

macOS

Security warning: On first run, macOS may block the binary.

Solution:

# Remove quarantine attribute
xattr -d com.apple.quarantine /usr/local/bin/capysquash

# Or allow in System Preferences
# System Preferences → Security & Privacy → Allow

Windows

Using WSL (recommended):

Install via Go in WSL:

go install github.com/CAPYSQUASH/capysquash-cli/cmd/pgsquash@latest

UPDATING

Homebrew

brew upgrade capysquash

Go Install

# Update to latest version
go install github.com/CAPYSQUASH/capysquash-cli/cmd/pgsquash@latest

# Check current version
capysquash --version

UNINSTALLING

Homebrew

brew uninstall capysquash
brew untap CAPYSQUASH/tap

Go Install

# Remove binary
rm $(which capysquash)

# Remove config (optional)
rm ~/.capysquash.config.json

TROUBLESHOOTING

Command not found

# Check if Go bin is in PATH
echo $PATH | grep go/bin

# Add Go bin to PATH (add to ~/.zshrc or ~/.bashrc)
export PATH=$PATH:$(go env GOPATH)/bin

# Reload shell
source ~/.zshrc

Permission denied

# Make executable
chmod +x $(which capysquash)

Docker not found

# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

# Validation is optional - you can skip it
capysquash squash migrations/*.sql --output clean/

NEXT STEPS

How is this guide?

On this page