Skip to main content

CLI Runner

rosty-cli lets you run Rostyman collections from the command line — useful for CI/CD pipelines, automated testing, and scripting. It ships bundled inside the Rostyman desktop app — no separate install or build step needed.

Full parity with the app

rosty-cli runs requests through the same engine cores as the desktop app, so a collection behaves identically in CI and in the GUI:

  • All auth types — Bearer, Basic, API Key, OAuth 2.0, OAuth 1.0 (HMAC-SHA1 / PLAINTEXT), Digest (401 challenge), AWS Signature v4, NTLM (NTLMv2 handshake), Hawk, JWT Bearer, Akamai EdgeGrid, and ASAP, plus inherit up the folder/collection chain.
  • Dynamic variables{{$timestamp}}, {{$randomUUID}}, {{$guid}}, {{$randomInt}}, and the rest, resolved exactly as in the app.
  • Cookie jar — Set-Cookie responses are stored and replayed across the run (domain/path/secure/expiry aware).
  • Scripts — pre-request and post-response scripts run with the full rm.* API and Postman-compatible pm.* aliases (pm.response.headers.get(), pm.test, pm.environment/pm.globals/pm.variables with .has(), pm.request, pm.info).
  • Raw-body Content-Type — auto-set from the body language when no explicit header is present.
  • TLS, redirects & proxy — skip TLS verification, cap or disable redirects, and route through HTTP/HTTPS/SOCKS5 proxies.
  • mTLS client certificates — honored in database mode from the workspace's configured certificates.

Location

rosty-cli is available as a global command after installing Rostyman. On Windows it is added to PATH automatically by the installer. On macOS and Linux, symlink it or call it directly from the app bundle if needed.

Supported inputs

rosty-cli run <collection> accepts:

  • A native .rostyman collection export
  • A Postman v2.1 JSON collection export
  • A collection stored directly in the live rostyman.db database (use --db-path + --workspace; list available collections with rosty-cli list)

If the argument ends in .json/.rostyman or contains a path separator it is treated as a file; otherwise it is looked up by name in the database.

Basic Usage

Run a collection file:

rosty-cli run my-collection.rostyman

Run a collection from the database with an environment:

rosty-cli run "Users API" --environment Staging --db-path /shared/rostyman.db --workspace Production

List collections saved in the database:

rosty-cli list --workspace Staging

Options

FlagDescriptionDefault
--environment <name|file>Activate an environment by name (DB) or path to a Postman environment JSONNone
--globals <file>Path to a Postman globals JSON fileNone
--iteration-data <file>CSV or JSON file for data-driven runs — iterates the collection once per rowNone
--iteration-count <n>Number of times to run the full collection (ignored when --iteration-data is set)1
--delay-request <ms>Pause between requests in milliseconds0
--timeout <ms>Per-request timeout in milliseconds30000
--bailAbort the run on the first test failurefalse
--insecureSkip TLS certificate verification (self-signed / internal hosts)false
--max-redirects <n>Maximum redirects to follow10
--no-follow-redirectsDo not follow redirects (same as --max-redirects 0)
--proxy <url>Route requests through a proxy (http://, https://, socks5://)None
--reporters <list>Comma-separated reporters: cli, json, junitcli
--reporter-json-export <file>Write the JSON report to a fileNone
--reporter-junit-export <file>Write the JUnit XML report to a fileNone
--db-path <path>Path to rostyman.db (database mode)App data dir
--workspace <name|id>Target a specific workspace by name or IDDefault workspace
-v, --versionPrint version number and exit
-h, --helpPrint help and exit

In database mode, rosty-cli also reads the workspace's request settings — ssl_verify, follow_redirects, http_timeout, the configured proxy, and client certificates — so runs match the app's behavior without extra flags.

Reporters

Combine reporters with a comma. The CLI reporter prints to stdout; JSON/JUnit can print to stdout or be written to a file.

rosty-cli run "Users API" --reporters cli,json,junit \
--reporter-json-export results.json \
--reporter-junit-export results.xml

CLI Reporter (default)

Human-readable output with colors and pass/fail indicators:

Running: My Collection (3 requests)

GET /users ...................... 200 OK (45ms)
✓ Status is 200
✓ Response has users array

POST /users ..................... 201 Created (62ms)
✓ User created successfully

GET /users/1 ................... 200 OK (38ms)
✓ Response contains user data

Results: 4/4 passed | 0 failed | 145ms total

JSON Reporter

Machine-readable JSON, suitable for parsing in scripts:

rosty-cli run collection.rostyman --reporters json --reporter-json-export results.json

JUnit Reporter

XML output compatible with CI systems (Jenkins, GitHub Actions, GitLab CI):

rosty-cli run collection.rostyman --reporters junit --reporter-junit-export results.xml

Test Scripts

The CLI executes pre-request and post-response scripts defined in your collection using the same rm.* API as the desktop app, with Postman-compatible pm.* aliases:

// Pre-request script
rm.environment.set("timestamp", Date.now());

// Test script (full Chai BDD supported)
rm.test("Status is 200", () => {
rm.expect(rm.response.code).to.equal(200);
});

// pm.* aliases work too — collections written against Postman run unchanged
pm.test("Response has id", () => {
const body = pm.response.json();
pm.expect(body).to.have.property("id").that.is.a("number");
});

Data-Driven Runs

Pass a CSV or JSON file with --iteration-data to iterate the collection once per row, substituting column values as variables:

rosty-cli run collection.rostyman --iteration-data test-cases.csv

CSV example (test-cases.csv):

email,expectedStatus
user@example.com,200
invalid@,400
,422

Each row runs the full collection with {{email}} and {{expectedStatus}} resolved from that row's values.

Iterations

Run a collection multiple times with --iteration-count:

rosty-cli run load-test.rostyman --iteration-count 100 --delay-request 500

Runs the collection 100 times with a 500ms delay between requests.

CI/CD Integration

Example GitHub Actions step (pointing at a committed .rostyman export or a copy of rostyman.db):

- name: Run API tests
run: |
rosty-cli run tests/api-collection.rostyman \
--environment ci \
--reporters junit \
--reporter-junit-export test-results/api.xml \
--bail

- name: Publish test results
uses: mikepenz/action-junit-report@v3
with:
report_paths: test-results/api.xml

Exit Codes

CodeMeaning
0All tests passed
1One or more tests/requests failed
2Runtime error (file not found, invalid config, etc.)