Skip to content

Command line

The courier command runs your .http files from a terminal or a CI job. It uses the same engine, environments, references and scripts as the app, so a request that passes in Courier passes on the command line too.

To install it, see Install the command-line tool.

Command What it does
courier run Send requests and run their tests
courier list List requests in sidebar order, with their @names
courier envs List environments and how many variables each has
courier export Export a folder as a Postman collection, OpenAPI or HTML docs
courier sync Compare an OpenAPI spec with a folder’s requests
courier mock Serve an OpenAPI file’s examples on 127.0.0.1

Run courier <command> --help for every option.

Terminal window
courier run # every request in the workspace, in sidebar order
courier run "02 Auth" --env dev # one folder, with an environment
courier run 'api/**/*.http' --var token=abc # a glob, with a variable override
courier run checks --bail --parallel 4 # stop at the first failure, 4 at a time
courier list # requests and their names
courier envs # environments

The workspace is the nearest folder, from the paths you give or the current folder, that has an http-client.env.json. Use --root <dir> to set it yourself.

Option What it does
--root <dir> The workspace folder
--no-color Never use colours. Also off when output isn’t a terminal or NO_COLOR is set
-V, --version Print the version