diff --git a/cli/checkly-deploy.mdx b/cli/checkly-deploy.mdx index 5c891e60..1c99a61b 100644 --- a/cli/checkly-deploy.mdx +++ b/cli/checkly-deploy.mdx @@ -594,5 +594,6 @@ The Checkly CLI evaluates Git information from your local or CI environment on a ## Related Commands +- [`checkly validate`](/cli/checkly-validate) - Validate your project without deploying it - [`checkly login`](/cli/checkly-login) - Log in to your Checkly account - [`checkly test`](/cli/checkly-test) - Test your setup before deployment diff --git a/cli/checkly-test.mdx b/cli/checkly-test.mdx index e0c044cc..dbcfcdfd 100644 --- a/cli/checkly-test.mdx +++ b/cli/checkly-test.mdx @@ -476,6 +476,7 @@ See [Cancellation](/concepts/cancellation) for the full flow. ## Related Commands +- [`checkly validate`](/cli/checkly-validate) - Validate your project without deploying it - [`checkly pw-test`](/cli/checkly-pw-test) - Run Playwright tests in the Checkly cloud - [`checkly trigger`](/cli/checkly-trigger) - Run deployed checks on-demand - [`checkly deploy`](/cli/checkly-deploy) - Deploy your application diff --git a/cli/checkly-validate.mdx b/cli/checkly-validate.mdx new file mode 100644 index 00000000..ca534b5b --- /dev/null +++ b/cli/checkly-validate.mdx @@ -0,0 +1,91 @@ +--- +title: checkly validate +description: 'Validate your project without deploying it.' +sidebarTitle: 'checkly validate' +canonical: 'https://www.checklyhq.com/docs/cli/checkly-validate/' +--- + +import CliCommandPrerequisites from '/snippets/cli-command-prerequisites.mdx'; + +The `checkly validate` command parses your project and checks its configuration and resources without running any checks or changing your Checkly account. It runs the same validation that [`checkly test`](/cli/checkly-test) and [`checkly deploy`](/cli/checkly-deploy) run before they start, so you can catch errors early, for example as a quick first step in CI. It reads your account's runtimes from Checkly, so it needs a login and network access. + + + +## Usage + +```bash Terminal +npx checkly validate [options] +``` + +| Option | Required | Description | +|--------|----------|-------------| +| `--config, -c` | - | The Checkly CLI configuration file. If not passed, uses the `checkly.config.ts\|js` file in the current directory. | +| `--[no-]verify-runtime-dependencies` | - | Return an error if checks import dependencies that are not supported by the selected runtime. | + +## Command Options + + + +Specify a configuration file to use instead of the `checkly.config.ts` or `checkly.config.js` in the current directory. + +**Usage:** + +```bash Terminal +npx checkly validate --config checkly.config.ts +npx checkly validate -c="./checkly.staging.config.ts" +``` + + + + + +Return an error if checks import dependencies that are not supported by the selected runtime. Can also be set with the `CHECKLY_VERIFY_RUNTIME_DEPENDENCIES` environment variable. + +**Usage:** + +```bash Terminal +npx checkly validate --no-verify-runtime-dependencies +``` + +If you're using private locations and want to provide your own dependencies, disable the built-in dependency validation. + + + +## Output + +A valid project prints any warnings and exits with code 0: + +```bash Terminal +npx checkly validate + +Parsing your project... ✅ + +Validating project resources... ✅ + +✔ Your project is valid. +``` + +When the project has errors, the command lists each one with the resource it belongs to and exits with code 1: + +```bash Terminal +npx checkly validate + +Parsing your project... ✅ + +Validating project resources... ❌ + +✖ [ApiCheck:books-api] Invalid property value + + The value provided for property "maxResponseTime" is not valid. + + Reason: The value of "maxResponseTime" must be 30000 or lower. + + The current value is 40000. + +✖ Your project is not valid. +``` + +## Related Commands + +- [`checkly test`](/cli/checkly-test) - Run your checks in the Checkly cloud before deploying +- [`checkly deploy`](/cli/checkly-deploy) - Deploy your project to your Checkly account diff --git a/docs.json b/docs.json index 5fe20d4d..0580f5bc 100644 --- a/docs.json +++ b/docs.json @@ -653,6 +653,7 @@ "cli/checkly-test", "cli/checkly-test-sessions", "cli/checkly-trigger", + "cli/checkly-validate", "cli/checkly-whoami" ] } diff --git a/sitemap.xml b/sitemap.xml index 726aec5e..8b1e7dc7 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -876,6 +876,9 @@ https://www.checklyhq.com/docs/cli/checkly-trigger/ + + https://www.checklyhq.com/docs/cli/checkly-validate/ + https://www.checklyhq.com/docs/cli/checkly-whoami/