This example project shows how you can use the Checkly CLI in a monitoring as code (MaC) workflow.
- Write API Checks and Playwright-powered Browser Checks or fully native Playwright Check Suites.
- Test -> Deploy: now you have your app monitored around the clock. All from your code base.
npm create checkly@latest -- --template boilerplate-project
This project has the basic boilerplate files needed to get you started.
.
├── README.md
├── __checks__
│ ├── api.check.ts
│ ├── heartbeat.check.ts
│ ├── homepage.spec.ts
│ └── url.check.ts
├── tests
│ └── webshop-interactions.spec.ts
├── checkly.config.ts
├── playwright.config.ts
├── package.json
└── package-lock.json
-
Running
npx checkly pw-testwill use theplaywright.config.tsfile and run the test suite in Checkly. -
Running
npx checkly testwill look for.check.tsfiles and.spec.tsin__checks__directories and execute them in a dry run. -
Running
npx checkly test --recordwill run all checks in a test session for you to preview in the UI. -
Running
npx checkly deploywill deploy your checks to Checkly, attach alert channels, and run them on a 10m schedule in the regionus-east-1andeu-west-1
Run the core CLI commands with npx checkly <command>
| Command | Action |
|---|---|
npx checkly test |
Dry run all the checks in your project |
npx checkly pw-test |
Run playwright tests in your project |
npx checkly deploy |
Deploy your checks to the Checkly cloud |
npx checkly login |
Log in to your Checkly account |
npx checkly --help |
Show help for each command. |
Check the docs for the full CLI reference.
Run npm install to install all required dependencies.
@playwright/test will give you full code completion and run .spec.js files for local debugging.
If you're using MultiStep or Browser Checks, make sure to install the Playwright npm package version that matches your Checkly runtime.
npm install --save-dev @playwright/[email protected]Check the Checkly CLI docs, the main Checkly docs or join our Slack community.