CLI: cartero run
The CLI runs collections from the terminal or your continuous integration (GitHub Actions, GitLab CI, Jenkins…). It’s the equivalent of Newman.
Run a file
Section titled “Run a file”cartero run collection.postman_collection.json \ -e production.postman_environment.json \ -d data.csv \ -r cli,junit,htmlIt accepts Postman, Insomnia, OpenAPI and cURL collections, as well as ZIP files or a URL.
Run a collection from your server
Section titled “Run a collection from your server”export CARTERO_SERVER=https://cartero.example.comexport CARTERO_TOKEN=crt_… # Settings → API tokensexport CARTERO_WORKSPACE=<id>
cartero run <collection-id> -e <environment-id> --reportWith --report, the result shows up in Cartero’s Runs section.
Options
Section titled “Options”| Option | Description |
|---|---|
-e, --environment |
Environment (file or id) |
-g, --globals |
Globals file |
-d, --iteration-data |
CSV or JSON with iteration data |
-n, --iteration-count |
Number of iterations |
--folder |
Run only one folder or request (name or id) |
--env-var key=value |
Override a variable (repeatable) |
--delay-request, --timeout-request |
Pause and timeout per request (ms) |
--bail |
Stop on first failure |
--strict-ssl |
Verify certificates |
-r, --reporters |
cli, json, junit, html |
--reporter-junit-export, --reporter-html-export, --reporter-json-export |
Report paths |
--silent |
No console output |
Exit codes: 0 if everything passes, 1 if any test or request fails, 2 on usage errors.
GitHub Actions
Section titled “GitHub Actions”- name: API tests run: npx @cartero/cli run ${{ vars.COLLECTION_ID }} -e ${{ vars.ENVIRONMENT_ID }} -r cli,junit --report env: CARTERO_SERVER: https://cartero.example.com CARTERO_TOKEN: ${{ secrets.CARTERO_TOKEN }} CARTERO_WORKSPACE: ${{ vars.CARTERO_WORKSPACE }}Until the package is published on npm, use the CLI from the repository:
node packages/cli/dist/index.js run ….