Reference
Command line
The slurry CLI drives Slurry from a terminal, a CI job or a coding agent. Every command takes --json and exit codes are stable, so a check can gate a build or an agent loop.
Install
npm install -g @slurry/cli # then: slurry help
npx @slurry/cli help # or without installingNode 20 or later. The package is @slurry/cli: one file, no runtime dependencies, MIT licence.
Sign in
slurry login # approve a code in the browser
export SLURRY_KEY=slurry_acct_... # or, in CI, a key from slurry.io/app/keysslurry login prints a code and a link; approve it at slurry.io as a member of the organisation, and the account key is saved in an owner-only file in your user config. Add --read-only for a key that cannot change anything. A saved key is only ever sent to the API that issued it. SLURRY_KEY takes precedence, which is what CI uses. See Connecting.
Create, call, check
slurry sims create --from jira --name "Acme Jira" --wait --write-env .env
# run your system against ACME_JIRA_BASE_URL with ACME_JIRA_API_KEY, then:
slurry requests verify acme-jira --method POST --path "/rest/api/3/issue" --times 1
slurry requests validate acme-jira
slurry state verify acme-jira --collection issue --where "fields.summary=Renewal at risk" --each fields.status.name=Done --times 1--write-env appends ACME_JIRA_BASE_URL and ACME_JIRA_API_KEY to the file instead of printing the key, so it never lands in a log or an agent transcript. New simulations accept calls from this machine only; add --allow for other addresses or --open for none. requests verify exits 1 with the near misses and the filter each one failed; requests validate exits 1 with every call the real vendor would reject.
/ is rewritten into a Windows path before the CLI sees it. Set MSYS_NO_PATHCONV=1; the CLI refuses such a path rather than check the wrong thing.In CI
name: Slurry
on: [pull_request]
jobs:
slurry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# start your system pointed at the suite's simulations here, then:
- name: Run the Slurry suite
env:
SLURRY_KEY: ${{ secrets.SLURRY_ACCOUNT_KEY }}
run: npx @slurry/cli test billing --speed 60 --junit slurry-results.xmlslurry test starts the run, waits and exits 0 only if it passed. Runs started with the CI variable set are tagged ci. If the run is still going at --timeout (default 30m) it is aborted and the simulations are put back. slurry cases pull and cases push keep a suite's cases as YAML in your repository. More in Test suites.
Coding agents
slurry agent setup # Claude Code and Cursor: MCP server and guide
slurry agent setup --dry-run
slurry guide # the same guide, printedagent setup writes .mcp.json and .claude/skills/slurry/SKILL.md for Claude Code, and .cursor/mcp.json and .cursor/rules/slurry.mdc for Cursor. No key is written: the client signs in to the MCP server with OAuth. Other servers in an existing config are kept, and a file you have changed is left alone unless you pass --force.
Grade an agent run
slurry eval takes a file of up to 20 checks across simulations and exits 1 if the run does not reach the pass mark (default: every check passes). --session limits request checks to one agent run; --junit writes one test case per check.
checks:
- name: raised one issue
type: requests
method: POST
path: /rest/api/3/issue
expect: { count: 1 }
- name: every call would pass Jira
type: valid
- name: the issue reached Done
type: state
collection: issue
where: { fields.summary: Renewal at risk }
each: { fields.status.name: Done }slurry eval slurry/eval.yaml --sim acme-jira--run-42 --session run-42 --junit eval-results.xmlCommands
slurry help lists every command; slurry <command> --help shows its options and examples.
| Commands | What they do |
|---|---|
login, logout, whoami | Sign in through the browser, forget the key, show the plan, AI allowance and usage |
library | Search the API library and read an integration guide |
sims | Create, describe, wait for, pause, reset, fast-forward and delete simulations; logs, events and records; the MCP server each simulation also is |
records import | Put your own records into a collection from JSON, JSON lines or CSV |
records defects | Plant known data defects in a collection and save the answer key |
requests | Find the requests your system sent, verify a call was made, validate them against the vendor spec |
state verify | Check the records say what they should |
eval | Grade a run: request, validity and state checks across simulations, with a pass mark |
snapshots, forks | Snapshot, restore and diff; disposable copies for one test or agent run |
scenarios, actions | Run scenario packs; fire one change as a named person |
rules | Fixed responses, errors, latency, conditional matches, chaos and connection faults; export and apply them as YAML in your repository |
webhooks | Add webhooks; find, read and replay deliveries |
keys | Simulation keys |
suites, cases, test, runs | Test suites as code (YAML pull and push), run them and wait, JUnit reports |
api | Call any management API endpoint with your key |
guide, agent | The guide for coding agents; install Slurry into Claude Code and Cursor |
Output and exit codes
--json prints the API response as JSON, and errors as JSON on stderr. Error messages never carry a whole key.
| Exit code | Meaning |
|---|---|
| 0 | OK, or the check passed |
| 1 | A check failed: verify, validate, eval, test, wait |
| 2 | Usage: an unknown command or a bad option |
| 3 | Not signed in, or the key is not allowed to do this |
| 4 | Not found |
| 5 | API or network error |
SLURRY_API points the CLI at another engine (https, or http on localhost).