Installation
Download the binary for your platform, unzip it, and run it directly. The binary is self-contained with no additional dependencies.
After downloading, unzip and make the binary executable:
browserstack-binary from any directory, move it onto your PATH. On macOS and Linux:
browserstack-binary.exe into a folder that is on your Path (or add its folder to the Path environment variable via System Properties → Environment Variables).
Some operating systems block execution of binaries downloaded from the internet by default. Run
chmod +x browserstack-binary if you see a permission error.All examples in this guide assume the binary is on your PATH. If you skip the step above, run it with a path prefix (./browserstack-binary) from the folder where it lives.browserstack-binary as the executable name. The actual filename after unzipping is platform-dependent (e.g. binary-macos-arm64 on macOS arm64) - rename it to match.
Invocation
Authentication
Cloud operations - fetching a collection by cloud ID, listing cloud projects, collections, and environments - require BrowserStack credentials set as environment variables:
Both must be set together. Local filesystem runs, Postman JSON files, and URL-fetch targets do not require credentials.
Commands
collection run
Run a collection or request. The target type is auto-detected - no explicit type flag needed.
Target detection
The CLI resolves the target in this order:
If the target cannot be resolved, the CLI exits with code
1 and a descriptive error message.
Execution flags
Reporter flags
Missing export directories are created automatically. If a directory cannot be created, the CLI exits
1 after the run completes - tests still execute.--reporter-omit-* flags affect the JSON and HTML reporters regardless of --verbose. In terminal output, they suppress the additional headers/bodies that --verbose would otherwise show.
Global flags
Exit codes
project list
List all projects the authenticated user is a member of.
Requires
BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY.
collection list
List collections in a project.
Requires
BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY.
environment list
List environments in a project (cloud or local).
Pass a local project path as the positional argument to list environments from the filesystem without credentials.
environment view
Show variable details for a specific environment.
Pass a local environment file path as the positional argument to inspect it without credentials.
Terminal output
The defaultcli reporter streams results in real time. Each request prints as it completes:
console.log() output from scripts appears between the request line and assertions, wrapped in dash-pipe delimiters:

