Skip to main content

Installation

Snag is a single binary built from a Rust crate. There is no runtime dependency to install alongside it.

Requirements

RequirementNotes
Rust toolchainThe crate uses edition 2024, so a recent stable toolchain is required (Rust 1.85 or newer).
A C linkerProvided by Xcode Command Line Tools on macOS, build-essential on Debian/Ubuntu.
TLSreqwest is built with its default TLS backend; no extra system package is needed on macOS or Windows. On Linux, install pkg-config and libssl-dev if the build complains about OpenSSL.

Install Rust from rustup.rs if you do not have it:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Build from source

git clone https://github.com/ShortyPing/snag.git
cd snag
cargo build --release

The binary lands at target/release/snag. Put it on your PATH:

# macOS / Linux
install -m 0755 target/release/snag /usr/local/bin/snag

Download a release binary

Every tagged release attaches a binary per platform, plus a revision.json that maps each target triple to its download URL:

curl -fsSLO https://github.com/ShortyPing/snag/releases/latest/download/snag-x86_64-unknown-linux-gnu
chmod +x snag-x86_64-unknown-linux-gnu
sudo mv snag-x86_64-unknown-linux-gnu /usr/local/bin/snag

Swap the asset name for snag-aarch64-apple-darwin on Apple Silicon, or snag-x86_64-pc-windows-msvc.exe on Windows. Once installed, snag update replaces it in place — see updating. To resolve the URL from a script instead of hardcoding it, read revision.json:

curl -fsSL https://github.com/ShortyPing/snag/releases/latest/download/revision.json \
| jq -r '.platforms["x86_64-unknown-linux-gnu"].url'

Install with cargo

From a clone, or straight from the repository:

cargo install --path .
# or
cargo install --git https://github.com/ShortyPing/snag.git

cargo install places the binary in ~/.cargo/bin, which rustup already adds to your PATH.

Verify

snag --version
# snag 0.1.1

snag --help

Run the demo suite that ships with the repository to confirm the whole pipeline works. The fast tag selects the test that needs no network:

$ snag demo/suite.toml -t fast -v
running 1 test across 1 suite
PASS assertion helpers, no network [12ms]
| running against local

test result: ok. 1 passed; 0 failed; 0 timed out; 0 skipped; finished in 13ms

Drop the -t fast to run the network tests too — they hit example.com and httpbin.org.

Shell completions

snag completions <shell> writes a completion script to stdout. Supported shells are the ones clap_complete supports: bash, zsh, fish, elvish, and powershell.

# zsh — into a directory that is on your $fpath
snag completions zsh > "${fpath[1]}/_snag"

# bash
snag completions bash > /usr/local/etc/bash_completion.d/snag

# fish
snag completions fish > ~/.config/fish/completions/snag.fish

Running in CI without installing

If a job only needs to run the suite once, building in the job is usually cheaper to maintain than distributing a binary:

- uses: dtolnay/rust-toolchain@stable
- run: cargo install --git https://github.com/ShortyPing/snag.git
- run: snag --format junit --report report.xml tests/

See CI integration for full workflow examples.

Next

Head to the quickstart for a green run against a real API.