CLI
Running Collections
Execute collection requests from the command line — sequential or parallel, with filtering, environment selection, and CI/CD-ready output.
Basic Usage
Run all requests in a collection with a single command:
openpost run "My API"
Runs all requests in the collection named "My API"
openpost run "My API" --env production
Run with a specific environment for variable resolution
Sequential Mode (default)
Requests execute one after another in array order, sharing environment context throughout the run.
openpost run "My API" --env staging --verbose
Parallel Mode
Run requests concurrently for faster execution of independent tests:
openpost run "My API" --mode parallel --concurrency 10
openpost run "Smoke Tests" --mode parallel --concurrency 20
Filtering Requests
Use --filter <glob> to run a subset of requests from a collection:
| Filter | Matches |
|---|---|
| --filter "GET*" | All GET requests |
| --filter "*users*" | Requests with "users" in the name |
| --filter "Auth*" | Requests starting with "Auth" |
Useful for running just login flows or specific endpoints without executing the entire collection.
Output & Reporting
Control how results are displayed and saved:
| Flag | Description |
|---|---|
| (default) | Pretty terminal output with ✓/✗ per request |
| --json | Machine-readable JSON output |
| --output-file results.json | Save full results to file |
| --verbose | Show headers, body, timing per request |
| --quiet | Minimal output (just pass/fail summary) |
Output includes: method, URL, status, time, test results, and errors.
Sample terminal output:
⚡ Running My API (12 requests, sequential)
Environment: production
✓ GET /users 200 45ms
✓ status equals 200
✓ POST /users 201 120ms
✗ GET /users/999 404 32ms
✗ status equals 200 (got: 404)
──────────────────────
11 passed 1 failed 1.2s total
CI/CD Examples
Integrate collection runs into your CI/CD pipelines. Exit code 0 = all pass, 1 = one or more failures.
GitHub Actions
- name: Install API Studio CLI
run: npm install -g openpost
- name: Run API tests
run: openpost run "My API" --env production --output-file results.json
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: api-test-results
path: results.json
GitLab CI
api-tests:
image: node:20
script:
- npm install -g openpost
- openpost run "My API" --env production --output-file results.json
artifacts:
paths:
- results.json
Tips
--output-file for artifact storage and test reporting--retry 2 for flaky tests that may need retries0 = all passed, 1 = one or more failures