Home / Command line
Command line
dispatch-run runs your Dispatch collections without the app, for CI, scripts and load checks. It uses the same code as the app.
Download dispatch-run.mjsSHA-256 9e9cd29d9df53e6b0a33d4867dc289d27b3ae3a0afb987edb63315a1fed45616
It is one file and needs Node.js 20 or newer. No install step, no dependencies to fetch.
Run a collection
node dispatch-run.mjs demo-shop.postman_collection.json -d users.csv --junit report.xml
It accepts a Dispatch backup, a Postman collection, or a collection folder of YAML files written by the desktop app. Requests run in order with their scripts and tests, once per row of the data file. The exit code is non-zero when a test fails, so a CI job fails with it.
Options
| Option | What it does |
|---|---|
-c, --collection | Collection to run (default: the only or first one) |
-f, --folder | Folder to run, like Parent/Child. Repeat to run a suite |
-e, --environment | Environment file, or a name inside the file |
--env-var key=value | Set a variable. It wins over the environment |
-d, --data | CSV or JSON data file, one iteration per row |
-n, --iterations | Number of iterations |
--delay, --timeout | Wait between requests, and per-request timeout, in milliseconds |
--bail | Stop at the first failure |
-k, --insecure | Accept self-signed TLS certificates |
-r, --reporters | cli, json, junit (with --json and --junit for the file paths) |
Load test
node dispatch-run.mjs load demo-shop.postman_collection.json --request Flaky \
--vus 20 --duration 30s --p95 800 --max-errors 1 --i-have-permission
Sends from virtual users and exits non-zero if a threshold is missed. --i-have-permission is required: use it only against servers you own or may test. Other options: --loops, --ramp-up, --think, --min-rps, --samples (write every sample as CSV).
Mock server
node dispatch-run.mjs mock demo-shop.postman_collection.json
Serves the saved examples in a collection. Run node dispatch-run.mjs --help for every option.
Flows
node dispatch-run.mjs flow my-backup.json --flow "Checkout" -e staging.json
Runs a flow from a Dispatch backup or export, with the same blocks and branches as in the app. Browser login steps need Chrome or Edge on the machine.
Serve a collection to an AI assistant (MCP)
claude mcp add dispatch -- node dispatch-run.mjs mcp ./my-collection -e staging.json --allow-methods GET,HEAD
An MCP server over stdio with three tools: list_requests, send_request and run_collection. Requests go through their auth, scripts and tests. --allow-methods limits what the assistant may send.
In GitHub Actions
- uses: actions/setup-node@v4
with: { node-version: 22 }
- run: node dispatch-run.mjs api.collection.json -e staging.json --junit report.xml