Docs · DialCatz

Command line (CLI)

The DialCatz CLI runs a workspace folder, a DialCatz, Postman, Insomnia, Bruno, Hoppscotch or Yaak collection or an OpenAPI file from a terminal or a CI job — scripts and tests, data files, sockets, gRPC, the --spec contract check, OAuth 2.0, client certificates, retries, GitHub, HTML, JSON and JUnit reports, exit codes and CI.

The DialCatz CLI runs your collections without the app: in a terminal, a pre-push hook or a CI job. It sends every request with its scripts and tests, in the order the app’s runner takes them, and with --spec checks each response against your OpenAPI contract. It is on npm today, as dialcatz.

npx dialcatz run ./api-workspace --var baseUrl=https://staging.example.com --env-file .env.ci
npx dialcatz run shop.postman_collection.json -r cli -r junit=results.xml -r html=report.html
npx dialcatz run ./bruno-collection --env Local
npx dialcatz run openapi.yaml --spec openapi.yaml --var baseUrl=http://localhost:3000
npx dialcatz run ./api-workspace -c Orders --data orders.csv --file avatar=./fixtures/cat.png

Install

It needs Node.js 20 or later, and nothing else — not the app, not an account.

npx dialcatz run <path>        # no install: npx fetches it
npm install -g dialcatz        # or install it once, then: dialcatz run <path>

dialcatz --help prints every option; dialcatz --version the version. The CLI has one command, run.

What it runs

dialcatz run <path> takes one of these:

<path> What it is
A workspace folder The folder with dialcatz.yml in it — a workspace kept in a folder, usually in your repository
A collection file A collection exported from DialCatz, or one from Postman, Insomnia, Hoppscotch or Yaak
A Bruno folder A Bruno collection, .bru or OpenCollection YAML, or a folder that holds several — read as it is, see below
A Yaak folder The folder a Yaak workspace syncs to
An OpenAPI / Swagger file Every operation becomes a request, as on import

A workspace folder may hold several collections: all of them run, one after the other, unless you name one with --collection.

How a run goes:

  • Order. The requests of a collection from top to bottom, folders in place — the order the app’s runner takes.
  • Scripts and tests. Each request runs with its pre-request and test scripts — the collection’s, then each folder’s, then its own — with the same dc.* API as the app, the Postman-compatible pm.*, Bruno’s bru, req and res, Hoppscotch’s pw and hopp, and insomnia. A script is stopped after 10 seconds. A variable a script sets is there for the requests after it.
  • Auth. A request uses the auth it inherits from its folder or collection, as in the app.
  • Kinds of request. HTTP in every body (JSON, form, multipart, binary), GraphQL, JSON-RPC, Server-Sent Events (the first 3 seconds of events) and gRPC. WebSocket, Socket.IO and Pusher requests connect, send their first message and listen.
  • Passed or failed. A request passes when it got an answer and all its tests passed. It fails on a failed test, a script that threw, no answer, or a {{variable}} without a value. Without tests, an error 500 passes too: it is an answer.

Options

Option What it does
-c, --collection <name> Only this collection (a workspace folder may hold several)
-f, --folder <name> Only the requests under this folder, or one request of this name
-v, --var <name=value> A variable’s value; repeat for more
--env <name> An environment the collection brings (Bruno, Insomnia, Yaak)
--env-file <file> Variables from a file of NAME=value lines (a .env file)
-d, --data <file> Run once per row of a CSV (with a header row) or a JSON array of objects
--file <field=path> The file for a multipart field, or body=<path> for a binary body; repeat for more
--spec <file> Check every response against this OpenAPI file (status, content type, body schema)
--proto <file> .proto files for gRPC requests whose server has no reflection; repeat for more
--ws-wait <seconds> How long a WebSocket request listens after connecting (default 2)
--cert <file>, --key <file> A client certificate and its key, in PEM
--pfx <file> A client certificate as one PKCS#12 file
--passphrase <text> The key’s passphrase; or set DIALCATZ_CERT_PASSPHRASE
--cert-host <name> Show the certificate to this host only (api.example.com, *.example.com)
--bail Stop at the first failure
--insecure Skip TLS certificate checks
--timeout <seconds> Per request (default 30)
--retries <n> Try a failed request again, up to n times (default 0, at most 20)
--retry-delay <seconds> The wait between the tries (default 1)
-r, --reporter <kind> cli (default), github, html, json or junit; repeat for more than one. kind=<file> says where it goes: -r html=report.html
-o, --output <file> Where the report is written (default: the terminal)
--details The HTML report also holds headers and bodies, credentials hidden
--no-github No GitHub summary by itself on GitHub Actions
--verbose Passed tests and script logs too
--no-color Plain text
-h, --help, --version The help page; the version

Names given to --collection and --folder match whatever their upper or lower case.

Variables and secrets

A {{name}} takes its value from the first of these that has one:

  1. --var name=value
  2. --env-file — NAME=value lines; quotes around a value are dropped, a line starting with # is a comment
  3. An environment variable of the same name
  4. What the file itself defines: an OpenAPI document’s server as baseUrl, a Postman collection’s own variables, an environment picked with --env

A workspace folder never holds values — that is what makes it safe to commit — so on a CI job every value comes from outside: plain ones with --var, secrets from your CI’s secret store as environment variables.

A variable nobody gave a value fails its request before anything is sent, and the message names it: No value for {{token}}: pass –var name=value, –env-file, a data file column, or set an environment variable of that name. Nothing leaves your computer with {{token}} written in it.

Collections of other apps

npx dialcatz run ./bruno-collection --env Local
npx dialcatz run shop.insomnia.yaml --env Staging
npx dialcatz run ./yaak-workspace --env Staging
npx dialcatz run hoppscotch-shop.json --var baseUrl=https://staging.example.com

They are read as they are, with no import. --env picks an environment that came along, for Bruno, Insomnia and Yaak; without it, give the values yourself. Hoppscotch keeps environments in a file of their own, so it takes --var or --env-file. Secret values are not in any of these files: they come from --var, --env-file or environment variables, and Bruno’s {{process.env.API_KEY}} is {{API_KEY}}.

What a collection uses that DialCatz does not do is printed as a note before the run. What that can be is on the page of each app: Postman, Insomnia, Bruno, Hoppscotch, Yaak. --env does not go with a DialCatz workspace folder, which holds no values.

Data files

--data orders.csv runs each collection once per row. A CSV needs a header row; a JSON file is an array of objects. A row’s columns become {{variables}} that win over every other value for that run, and scripts read the row as dc.data and pm.iterationData. The terminal says row 2 of 10 above each run, and a JUnit report names the suite Orders (row 2).

Files to upload

A multipart field of type file, or a binary body, needs a real file:

  • --file avatar=./fixtures/cat.png gives the field avatar its file; --file body=./payload.bin gives a binary body its file.
  • Without it, the CLI tries the path saved with the request — relative paths start at the workspace folder, or at the collection file’s folder.
  • When no file is found the request fails and says which --file to pass.

WebSocket, Socket.IO and Pusher

A ws:// or wss:// request in a run does four things: it connects (with the request’s headers and auth; a Pusher request joins its saved channels), sends the first message kept with the request, listens for --ws-wait seconds (2 by default), and closes. It passes when it connected and its tests passed.

What arrived while it listened goes to the request’s tests as dc.messages, a list of { data, event?, channel? } — event is the Socket.IO event’s name or the Pusher event, channel the Pusher channel:

dc.test('the server greets', () => {
  dc.expect(dc.messages.length).toBeGreaterThan(0);
  dc.expect(dc.messages[0].data).toContain('welcome');
});

The first message is kept in the app: in a WebSocket tab’s Message pane, write the message and press Keep with the request (it then reads Kept with the request). A request without a kept message just connects and listens.

gRPC

A grpc:// or grpcs:// request is called with its service, method and message. The CLI learns the service from the server’s reflection; for a server without it, pass the .proto files with --proto. A call that does not end with OK fails its request, with the gRPC status as the reason.

–spec: the contract check

--spec openapi.yaml checks every response against an OpenAPI file: the status, the content type and the body’s shape. Each request gets one more test, Response matches the spec, and a response the contract does not describe fails the run — so the build breaks when the API drifts from its contract.

  • A request is matched to the spec by its method and path; {parameters} in the spec’s path stand for the values in the URL.
  • A request whose path the spec does not have fails too: The spec has no GET /orders/{}.
  • WebSocket and gRPC requests are not checked against the spec.

It is the same check as the app’s Responses checked against the spec, with the spec file given on the command line. To run the spec’s own operations against a server, give the same file twice:

npx dialcatz run openapi.yaml --spec openapi.yaml --var baseUrl=http://localhost:3000

OAuth 2.0 and client certificates

OAuth 2.0. A request whose auth is OAuth 2.0 gets its token in the run:

Grant In the CLI
Client credentials, Password The token is got by itself — what a CI job wants. Give the client secret as a variable.
Device code Offered when a person is at the terminal: the CLI prints the page to open and the code, then waits. On a CI job it fails and says so.
Authorization code Not in the CLI: it needs the app’s browser round trip. Use device code with a person at the terminal, or client credentials without one.

A token is kept for the run only and reused by the requests that share its settings. OAuth 2.0 set in the DialCatz app, in a Postman collection or in an OpenAPI file all work.

Client certificates. For an API that uses mutual TLS, give the certificate on the command line: --cert with --key (PEM), or --pfx alone (PKCS#12). The passphrase comes from --passphrase or, better on a CI job, the DIALCATZ_CERT_PASSPHRASE environment variable. --cert-host api.example.com shows it to that host only; without it, it goes to every host of the run. The CLI checks the certificate before the run starts, and does not read the certificates set in the app.

npx dialcatz run ./api-workspace --cert client.pem --key client.key --cert-host api.example.com

--insecure is another matter: it skips the check of the server’s certificate, for a local server with a self-signed one. A collection that skips certificate checks in the app does so in the CLI too.

Reports and exit codes

Reporter What you get
cli The default: a line per request with its status and time, failed tests under it, and a summary line. --verbose adds passed tests and script logs.
github A summary on the page of a GitHub Actions run, and an error for each failed request (the first ten). On by itself on GitHub Actions; --no-github turns it off.
html One HTML file with every request and its tests. It loads nothing and runs no script, so it opens anywhere. --details adds headers and bodies.
json Everything, as JSON: the totals, passed, and every collection’s requests with their tests and logs
junit JUnit XML for CI tools: a suite per collection, a case per request

Repeat -r for more than one, each with its own file: -r cli -r junit=results.xml -r html=report.html. -o names the file instead; when several reports share one -o, each takes its own ending. Without a file the report goes to the terminal’s standard output, and the progress lines move to standard error so the report stays clean. github goes to the run’s page.

Retries

--retries 2 tries a failed request up to two more times, --retry-delay seconds apart. The last try counts, and the reports say how many it took. A failure another try cannot change — a variable without a value, a missing file — is not tried again. A request that changes data is sent again too, so use retries with that in mind.

What reports hide

A report leaves the computer, as a CI artifact or on a pull request’s page. These are replaced with ••• in github, html, json and junit:

  • the values of variables named like a secret (token, key, password, session …)
  • values that look generated: long, letters and digits mixed, no spaces
  • tokens OAuth handed out, and tokens in a JSON answer, such as a login’s
  • credential headers (Authorization, Cookie, Set-Cookie, X-API-Key …), query parameters, and JSON and form fields named like a credential
  • a user and password in an address

It goes by names and shapes, so a secret called x with a short value is not recognised. Look at a report once before you share it, above all with --details.

The terminal is not redacted. What the cli reporter prints, and what your scripts log, appears as it is in the job’s log; GitHub and GitLab mask only the secrets in their own store.

Exit code Meaning
0 Everything passed
1 A request or a test failed
2 It could not start: a path that does not exist, an unknown option, no requests to run

In CI

The app writes the workflow for you: a collection’s menu → Run in CI…, for GitHub Actions and GitLab CI — see Run in CI, which also has the DialCatz action. By hand, on GitHub Actions:

name: API tests
on: [push]
permissions:
  contents: read
jobs:
  api:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 22 }
      - run: npx --yes dialcatz@1 run ./api-workspace --spec openapi.yaml --retries 1 -r cli -r html=report.html
        env:
          baseUrl: https://staging.example.com
          clientSecret: ${{ secrets.API_CLIENT_SECRET }}

baseUrl and clientSecret are environment variables here, so {{baseUrl}} and {{clientSecret}} in the workspace get their values without a word of them in the repository. dialcatz@1 is the latest 1.x: fixes come by themselves, a breaking change does not. The step fails when a request or a test fails, and the run’s page gets its summary. On GitLab CI, write -r junit=results.xml and name that file under artifacts: reports: junit.

Limits

  • One path per run, and one command: run.
  • The CLI reads nothing from the app: no environment values, no kept OAuth tokens, no client certificates from Settings. Everything comes from the path and the options.
  • Variables a script sets last for the run; nothing is written back to the files.
  • The authorization code grant is not available; a device code sign-in needs a person at the terminal.
  • --spec checks HTTP responses, not WebSocket or gRPC ones.

Last updated 2026-11-25