Command-line options

The options of an exported flow script and of the suite runner, clem-suite.js. Both print this with --help.

How to export and where these scripts come from: Export and CI.

An exported flow

node <flow>.js [options]
OptionWhat it does
--report <file.html>also write an HTML report (collapsible responses)
--junit <file.xml>also write JUnit XML for CI (one test case per step)
--summary <file.json>also write a JSON summary (status, steps, checks, failures)
--jsonprint raw run events as JSON lines instead of text
--verboseprint response headers and bodies
--env <name>use one of the project's environments (default: the one selected when the flow was exported); --env none uses none
--environments <file>read the environments from this file (default: the <project>.environments.json written next to this script by the export, else the copy inside this script)
--secrets <file>read secret values from this KEY=value file (default: the <project>.secrets.env next to this script, when there is one)
--data <file>run the flow once per row of this CSV or JSON file, the columns as variables (default: the flow's data file, when it has one; relative to the <flow>.files folder); --data none runs it once
--set $name=valueoverride (or add) a variable, also over the environment and the data rows; repeatable
--insecureaccept invalid / self-signed TLS certificates
--timeout <ms>per-request timeout (0 = none)
--run-timeout <ms>time limit of the whole run (0 = none; default: the flow's Run time limit). Past it the run stops and fails (exit code 1)
--http-version <v>1.1, auto (HTTP/2 when the server offers it) or 2 for every request (default: the flow's setting; a request's own wins)
--proxy <url>send requests through this proxy (http://[user:pass@]host:port); --proxy none sends them direct. Default: the HTTPS_PROXY / HTTP_PROXY / NO_PROXY environment variables, when set
--proxy-bypass <list>hosts that skip the proxy, comma-separated ("localhost, .corp"; default: NO_PROXY)
--system-caalso trust the CA certificates of this computer's certificate store (Windows store, macOS keychains, the Linux CA bundle), as the app does
--ca <file>also trust this CA certificate (PEM, may hold several, or DER); repeatable. NODE_EXTRA_CA_CERTS works too
--cert <file>client certificate (mTLS), PEM; with --key <file>, its key
--pfx <file>client certificate and key as one PFX / P12 file instead
--passphrase <text>passphrase of the key or PFX (better: the CLEM_CERT_PASSPHRASE environment variable, which stays out of the shell history)
--cert-host <host>offer the client certificate to this host only (api.example.com, *.example.com, host:port); default: every server that asks
--files-dir <dir>where upload paths resolve (default: <flow>.files next to this script, or <project>.files for a project export)
--out-dir <dir>where saved responses and saveFile() go (default: ./clem-output/<flow>-<date and time>, created only when used)
--save-binaryalso save every binary response (PDFs, images...) there
--no-colordisable colors
--colorforce colors (e.g. when the output is piped into a viewer)
-h, --helpshow this help

Secrets: their values are never exported. Each one the flow uses is read from an environment variable, else from the secrets file: CLEM_<name> (e.g. CLEM_apiKey for $apiKey), or CLEM_<name>__<environment> for one environment only. --set also works. The run stops before it starts (exit code 2) when a value is missing.

Exit code: 0 when the flow passed, 1 when it failed or was stopped, 2 on bad usage.

clem-suite.js

node clem-suite.js [flows or folders...] [options]

Runs exported CLEM flows one after another (or several at a time with --parallel) and writes one combined report. Without flow arguments it runs every exported flow script in its own folder. Folders run every exported flow script inside them, in name order.

OptionWhat it does
--parallel <n>run up to n flows at a time (1-32), each in its own process; without it (or with 1) they run one after another (sequentially). Above 1, each flow's lines print when it ends, and the report keeps name order. Only for flows that don't depend on each other
--report <file.html>write the combined HTML report (one expandable line per flow)
--junit <file.xml>write JUnit XML for CI (a test suite per flow, a test case per step)
--summary <file.json>write a JSON summary (status, steps, checks, failures per flow)
--title <text>title of the reports (default "CLEM suite")
--tag <tags>run only the flows with one of these tags (comma-separated; repeatable)
--exclude-tag <tags>skip the flows with any of these tags (comma-separated; repeatable)
--bailstop after the first flow that does not pass (with --parallel: start no new flow; the running ones finish)
--verboseprint every flow's full log (responses included)
--env <name>use this environment in every flow (--env none: no environment)
--environments <file>read the environments from this file in every flow
--secrets <file>read secret values from this KEY=value file in every flow (environment variables such as CLEM_apiKey reach every flow anyway)
--data <file>run every flow once per row of this CSV or JSON file (--data none: every flow runs once, ignoring its own data file)
--set $name=valueoverride (or add) a variable in every flow; repeatable
--insecureaccept invalid / self-signed TLS certificates
--timeout <ms>per-request timeout (0 = none)
--run-timeout <ms>time limit of each flow's run (0 = none; default: each flow's Run time limit); a flow past it stops and fails
--http-version <v>1.1, auto or 2 for every request of every flow
--proxy <url>send every flow's requests through this proxy (--proxy none: direct; default: the HTTPS_PROXY / HTTP_PROXY / NO_PROXY variables)
--proxy-bypass <list>hosts that skip the proxy, comma-separated (default: NO_PROXY)
--system-caalso trust this computer's certificate store in every flow
--ca <file>also trust this CA certificate in every flow (repeatable)
--cert <file>client certificate (mTLS) for every flow, PEM; with --key <file>
--pfx <file>client certificate and key as a PFX / P12 file instead
--passphrase <text>its passphrase (better: CLEM_CERT_PASSPHRASE, which every flow reads)
--cert-host <host>offer the client certificate to this host only
--out-dir <dir>saved files of each flow go to <dir>/<flow script name>
--save-binaryalso save every binary response (PDFs, images...)
--no-colordisable colors
-h, --helpshow this help

Exit code: 0 when every flow passed, 1 when any failed or was stopped, 2 on bad usage.

Environment variables

VariableWhat it does
CLEM_<name>The value of the secret $name (for example CLEM_apiKey). CLEM_<name>__<environment> sets it for one environment only.
CLEM_CERT_PASSPHRASEThe passphrase of the client certificate's key or PFX file.
HTTPS_PROXY, HTTP_PROXY, NO_PROXYThe proxy to use and the hosts that skip it, unless --proxy says otherwise.
NODE_EXTRA_CA_CERTSA file of extra CA certificates to trust (Node's own variable).