Quickstart

Install

curl -fsSL https://sankh.dev/install.sh | sh                 # latest
curl -fsSL https://sankh.dev/install.sh | SANKH_VERSION=0.1.1 sh

The installer downloads the release archive for your platform from GitHub, verifies its sha256 checksum, and installs sankh into ~/.local/bin (override with SANKH_INSTALL_DIR). No root required.

Other options:

brew install sankh-dev/tap/sankh
powershell -c "irm https://github.com/sankh-dev/sankh/releases/latest/download/sankh-installer.ps1 | iex"

Or build from source (needs Rust and Node 22):

(cd frontend && npm ci && npm run build)
cargo install --path crates/sankh-cli

Sankh needs curl and a POSIX shell at run time. On Windows use Git Bash or WSL.

Your first collection

sankh init my-api              # scaffold a collection
sankh trust my-api             # request files are scripts: trust before running
sankh run my-api --env dev     # run everything, exit non-zero on failure
sankh serve my-api             # web UI on http://localhost:4747

A collection is a plain folder of .sh files, each holding one curl command:

#!/usr/bin/env bash
# @name Create pet
# @tags smoke
# @expect status 201
# @expect json .name == "Rex"
# @capture PET_ID=.id
curl -sS "$BASE_URL/pets" \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name":"Rex"}'

Every file still runs on its own, with or without Sankh:

set -a; . environments/dev.env; set +a
sh pets/02-create.sh

The full file format, including every annotation, is described in Collection format.

Try the bundled example

The repository ships a petstore collection and an in-memory mock server:

cargo run --example petstore_mock &        # http://localhost:4010
cp examples/petstore/.env.example examples/petstore/.env.local
sankh trust examples/petstore
sankh run examples/petstore

How it runs a file

Sankh never modifies a request file. It sources the file in a shell (bash if the shebang names it, else sh) after defining a curl function that adds -o, -D and -w '%{json}' to record the body, headers and timing. If a raw-mode file calls curl several times, the last response is checked.

Next steps