Skip to main content
The checkly test command executes all checks in your project on the Checkly cloud infrastructure. This command provides a dry-run capability for testing your monitoring setup before deployment, with support for different environments and configurations.
Before using , ensure you have:
  • An initialized Checkly CLI project
  • At least one check or resource defined in your project
  • Valid Checkly account authentication (run npx checkly login if needed)
  • A checkly.config.ts or checkly.config.js configuration file
For additional setup information, see CLI overview.

Basic Usage

The basic command runs all checks in your project as a test run without deploying them to your account as monitors.
Terminal
OptionRequiredDescription
--config, -c-The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.
--detach, -d-Keep checks running in the cloud when you stop the CLI with Ctrl+C, instead of cancelling the run.
--env, -e-Env vars to be passed to the test run. Can be used multiple times.
--env-file-dotenv file path to be passed. For example --env-file="./.env"
--grep, -g-Only run checks where the check name matches a regular expression. Default: .*
--list-List all checks but don’t run them.
--location, -l-The location to run the checks at.
--private-location-The private location to run checks at.
--[no-]record-Record test session results in Checkly with full logs, traces and videos. Records by default since CLI v8.0.0.
--refresh-cache-Force a fresh install of dependencies and update the cached version.
--reporter, -r-One or more custom reporters for the test output. Supports comma-separated values and repeated flags.
--retries-How many times to retry a failing test run.
--tags, -t-Filter the checks to be run using a comma separated list of tags.
--test-session-name, -n-A name to use when recording results in Checkly.
--timeout-A timeout (in seconds) to wait for checks to complete.
--update-snapshots, -u-Update any snapshots using the actual result of this test run.
--verbose, -v-Always show the full logs of the checks.
--[no-]verify-runtime-dependencies-Return an error if checks import dependencies that are not supported by the selected runtime.

Command Options

--config, -c
string
The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory.Usage:
Terminal
--detach, -d
boolean
default:"false"
By default, pressing Ctrl+C during a recorded run cancels the test session. With --detach, Ctrl+C exits the CLI immediately instead, leaving the checks running in the cloud.Usage:
Terminal
--env, -e
string[]
Environment variables to be passed to the test run. Can be used multiple times.Usage:
Terminal
Examples:
Terminal
--env-file
string
Path to a dotenv file containing environment variables.Usage:
Terminal
--grep, -g
string
Only run checks where the check name matches a regular expression. Default: .*Usage:
Terminal
--location, -l
string
The location to run the checks at.Usage:
Terminal
--private-location
string
The private location to run checks at.Usage:
Terminal
Examples:
Terminal
--tags, -t
string[]
Filter the checks to be run using a comma separated list of tags. Checks will only be run if they contain all of the specified tags. Multiple --tags flags can be passed, in which case checks will be run if they match any of the --tags filters.Usage:
Terminal
Examples:
Terminal
--list
boolean
List all checks to be run but don’t run them.Usage:
Terminal
--reporter, -r
string[]
One or more custom reporters for the test output. Options: list, dot, ci, github, json.You can combine multiple reporters by passing multiple --reporter flags or using a comma-separated list. When no --reporter flag is provided, the CLI falls back to the cli.reporters array in checkly.config.ts, then defaults to list (or ci in CI environments).Usage:
Terminal
Examples:
Terminal
--[no-]record
boolean
default:"true"
Record test results in Checkly as a test session with full logs, traces and videos. Recording is enabled by default; use --no-record to disable it.
Recording defaults to enabled since CLI v8.0.0. In earlier versions, recording was opt-in via --record.
Usage:
Terminal
--refresh-cache
boolean
default:"false"
Force a fresh install of dependencies and update the cached version. Use this when you’ve changed your project’s dependencies and need Checkly to pick up the latest versions instead of using the cache from a previous run.Usage:
Terminal
--retries
number
How many times to retry a failing test run. Default: 0, max: 3Usage:
Terminal
Examples:
Terminal
--test-session-name, -n
string
A name to use when recording results in Checkly.Usage:
Terminal
--timeout
number
default:"600"
A timeout (in seconds) to wait for checks to complete.Usage:
Terminal
--update-snapshots, -u
boolean
Update any snapshots using the actual result of this test run.Usage:
Terminal
Snapshots are essential for visual regression testing in Browser Checks.
--verbose, -v
boolean
Always show the full logs of the checks.Usage:
Terminal
--verify-runtime-dependencies
boolean
Return an error if checks import dependencies that are not supported by the selected runtime. Default: trueUsage:
Terminal
Runtime-dependent checks run in a specific runtime with a pre-defined set of dependencies. If you’re using private locations and want to provide your own dependencies, disable the built-in dependency validation.
You can provide custom dependencies in Playwright Check Suites because they don’t rely on a specific runtime.

Examples

Dry run all your project checks and monitors:
Terminal
Dry run checks that have product and api in the file name:
Terminal
Run a test session in Checkly with git branch info, full logging, videos and traces:
Terminal
Dry run all checks against a specific location:
Terminal
Specify environment variables to dry run checks with a specific URL and a password. These variables are available on process.env:
Terminal

Cancelling a run

Available in CLI v8.0.0+.
checkly test records a test session by default, so pressing Ctrl+C cancels it. Cancellation applies only to Playwright Check Suite runs inside the session; other check types finish normally. Runs started with --no-record cannot be cancelled. The CLI keeps running after the first Ctrl+C to report the cancelled results. Press Ctrl+C again to exit immediately without waiting. Pass the --detach flag to keep the checks running in the cloud instead — Ctrl+C then exits the CLI immediately without cancelling. See Cancellation for the full flow.