Skip to content

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

terminal
npm install -g @slurry/cli    # then: slurry help
npx @slurry/cli help          # or without installing

Node 20 or later. The package is @slurry/cli: one file, no runtime dependencies, MIT licence.

Sign in

terminal
slurry login                        # approve a code in the browser
export SLURRY_KEY=slurry_acct_...   # or, in CI, a key from slurry.io/app/keys

slurry 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

terminal
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.

In Git Bash on Windows, a path argument that starts with / 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

.github/workflows/slurry.yml
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.xml

slurry 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

terminal
slurry agent setup          # Claude Code and Cursor: MCP server and guide
slurry agent setup --dry-run
slurry guide                # the same guide, printed

agent 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.

slurry/eval.yaml
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 }
terminal
slurry eval slurry/eval.yaml --sim acme-jira--run-42 --session run-42 --junit eval-results.xml

Commands

slurry help lists every command; slurry <command> --help shows its options and examples.

CommandsWhat they do
login, logout, whoamiSign in through the browser, forget the key, show the plan, AI allowance and usage
librarySearch the API library and read an integration guide
simsCreate, describe, wait for, pause, reset, fast-forward and delete simulations; logs, events and records; the MCP server each simulation also is
records importPut your own records into a collection from JSON, JSON lines or CSV
records defectsPlant known data defects in a collection and save the answer key
requestsFind the requests your system sent, verify a call was made, validate them against the vendor spec
state verifyCheck the records say what they should
evalGrade a run: request, validity and state checks across simulations, with a pass mark
snapshots, forksSnapshot, restore and diff; disposable copies for one test or agent run
scenarios, actionsRun scenario packs; fire one change as a named person
rulesFixed responses, errors, latency, conditional matches, chaos and connection faults; export and apply them as YAML in your repository
webhooksAdd webhooks; find, read and replay deliveries
keysSimulation keys
suites, cases, test, runsTest suites as code (YAML pull and push), run them and wait, JUnit reports
apiCall any management API endpoint with your key
guide, agentThe 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 codeMeaning
0OK, or the check passed
1A check failed: verify, validate, eval, test, wait
2Usage: an unknown command or a bad option
3Not signed in, or the key is not allowed to do this
4Not found
5API or network error

SLURRY_API points the CLI at another engine (https, or http on localhost).