Skip to main content

System Requirements

  • OS: macOS, Linux, or Windows (WSL2 recommended)
  • Architecture: amd64 or arm64
  • Memory: 256MB minimum, 1GB recommended
  • Disk: 50MB for binary, plus workspace storage

Installation Methods

The fastest way to install klaw:
curl -fsSL https://klaw.sh/install.sh | sh
This script:
  • Detects your OS and architecture
  • Downloads the appropriate binary
  • Installs to /usr/local/bin/klaw
  • Verifies the checksum
You may need to use sudo if /usr/local/bin requires elevated permissions.

Manual Download

Download the appropriate binary for your platform:
curl -L https://github.com/klawsh/klaw.sh/releases/latest/download/klaw-darwin-arm64.tar.gz | tar xz
sudo mv klaw /usr/local/bin/

Build from Source

Requires Go 1.24 or later:
# Clone the repository
git clone https://github.com/klawsh/klaw.sh.git
cd klaw

# Build the binary
make build

# Install to PATH
sudo mv bin/klaw /usr/local/bin/

# Or install directly to GOPATH/bin
make install

Verify Installation

Check that klaw is installed correctly:
klaw version
Expected output:
klaw version 1.0.0
go version: go1.24.2
platform: darwin/arm64

Initial Configuration

After installation, klaw needs at least one LLM provider configured:

Option 1: Environment Variables

# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)

# each::labs Router (300+ models)
export EACHLABS_API_KEY=your-key

# Or Anthropic directly
export ANTHROPIC_API_KEY=sk-ant-...

# Or OpenRouter
export OPENROUTER_API_KEY=sk-or-...

Option 2: Configuration File

Create ~/.klaw/config.toml:
[defaults]
model = "claude-sonnet-4-20250514"

[provider.anthropic]
api_key = "sk-ant-..."
Use environment variable references in config files for security:
[provider.anthropic]
api_key = "${ANTHROPIC_API_KEY}"

Shell Completions

Enable tab completion for your shell:
# Add to ~/.bashrc
eval "$(klaw completion bash)"

Uninstallation

sudo rm /usr/local/bin/klaw
rm -rf ~/.klaw  # Remove configuration and data

Troubleshooting

If you get a permission error when installing:
sudo curl -fsSL https://klaw.sh/install.sh | sudo sh
Or install to a user directory:
mkdir -p ~/bin
curl -fsSL https://klaw.sh/install.sh | sh -s -- --prefix ~/bin
export PATH="$HOME/bin:$PATH"
Ensure the installation directory is in your PATH:
echo $PATH
# Should include /usr/local/bin

# If not, add it:
export PATH="/usr/local/bin:$PATH"
If macOS prevents running klaw:
# Allow the binary
xattr -d com.apple.quarantine /usr/local/bin/klaw
Or go to System Preferences → Security & Privacy → Allow.
When building from source, ensure you have Go 1.24+:
go version
# Should show go1.24.x or later

Next Steps