Checkly CLI Skills
by @vince-winkintel
Comprehensive Checkly CLI command reference and Monitoring as Code workflows. Use when user mentions Checkly CLI, monitoring as code, synthetic monitoring, A...
clawhub install checkly-cli-skillsπ About This Skill
name: checkly-cli-skills description: Comprehensive Checkly CLI command reference and Monitoring as Code workflows. Use when user mentions Checkly CLI, monitoring as code, synthetic monitoring, API checks, browser checks, Playwright testing, check deployment, or npx checkly commands. Routes to specialized sub-skills for auth, config, checks, testing, deployment, imports, constructs, and advanced patterns. Triggers on checkly, monitoring as code, synthetic monitoring, checkly cli, npx checkly. requirements: binaries: - checkly - npx binaries_optional: - playwright env_vars: - CHECKLY_API_KEY - CHECKLY_ACCOUNT_ID credential: type: api_key env_var: CHECKLY_API_KEY companion_env_var: CHECKLY_ACCOUNT_ID docs_url: https://www.checklyhq.com/docs/cli/authentication/ storage_path: ~/.config/@checkly/cli/config.json notes: | Requires Checkly account and API key (signup at checklyhq.com/signup or via 'npx checkly login'). Credentials can be set via environment variables (CHECKLY_API_KEY, CHECKLY_ACCOUNT_ID) or stored in ~/.config/@checkly/cli/config.json via 'npx checkly login'. Config stored in checkly.config.ts and auth credentials in system config. Browser checks require @playwright/test dependency.
Checkly CLI Skills
Comprehensive Checkly CLI command reference and Monitoring as Code (MaC) workflows.
Quick start
# Create new Checkly project
npm create checkly@latestTest checks locally
npx checkly testDeploy to Checkly cloud
npx checkly deploy
What is Monitoring as Code?
The Checkly CLI provides a TypeScript/JavaScript-native workflow for coding, testing, and deploying synthetic monitoring at scale. Define your monitoring checks as code, test them locally, version control them with Git, and deploy through CI/CD pipelines.
Key benefits:
Skill organization
This skill routes to specialized sub-skills by Checkly domain:
Getting Started:
checkly-auth - Authentication setup and logincheckly-config - Configuration files (checkly.config.ts) and project structureCore Workflows:
checkly-test - Local testing workflow with npx checkly testcheckly-deploy - Deployment to Checkly cloudcheckly-import - Import existing checks from Checkly to codeCheck Types:
checkly-checks - API checks, browser checks, multi-step checkscheckly-monitors - Heartbeat, TCP, DNS, URL monitorscheckly-groups - Check groups for organization and shared configAdvanced:
checkly-constructs - Constructs system and resource managementcheckly-playwright - Playwright test suites and configurationcheckly-advanced - Retry strategies, reporters, environment variables, bundlingWhen to use Checkly CLI vs Web UI
Use Checkly CLI when:
Use Web UI when:
Common workflows
New project setup
# Initialize project
npm create checkly@latest
cd my-checkly-projectAuthenticate
npx checkly loginTest locally
npx checkly testDeploy to cloud
npx checkly deploy
Daily development
# Create new API check
cat > __checks__/api-status.check.ts <<'EOF'
import { ApiCheck, AssertionBuilder } from 'checkly/constructs'new ApiCheck('api-status-check', {
name: 'API Status Check',
request: {
url: 'https://api.example.com/status',
method: 'GET',
assertions: [
AssertionBuilder.statusCode().equals(200),
AssertionBuilder.responseTime().lessThan(500),
],
},
})
EOF
Test locally
npx checkly testDeploy when ready
npx checkly deploy
Browser check with Playwright
# Create browser check
cat > __checks__/homepage.spec.ts <<'EOF'
import { test, expect } from '@playwright/test'test('homepage loads', async ({ page }) => {
const response = await page.goto('https://example.com')
expect(response?.status()).toBeLessThan(400)
await expect(page).toHaveTitle(/Example/)
await page.screenshot({ path: 'homepage.jpg' })
})
EOF
Test with Playwright locally (faster)
npx playwright test __checks__/homepage.spec.tsTest via Checkly runtime
npx checkly test __checks__/homepage.spec.tsDeploy
npx checkly deploy
Import existing checks
# Import all checks from Checkly account
npx checkly import planReview generated code
git diffCommit imported checks
git add .
git commit -m "Import existing monitoring checks"
Decision Trees
"What type of check should I create?"
What are you monitoring?
ββ REST API / HTTP endpoint
β ββ Simple availability β API Check (request + status assertion)
β ββ Complex validation β API Check (request + multiple assertions + scripts)
β ββ Just uptime/ping β URL Monitor (simpler, faster)
β
ββ Web application / User flow
β ββ Single page β Browser Check (one .spec.ts file)
β ββ Multiple steps β Browser Check or Multi-Step Check
β ββ Full test suite β Playwright Check Suite (playwright.config.ts)
β
ββ Service health / Infrastructure
ββ Periodic heartbeat β Heartbeat Monitor
ββ TCP port β TCP Monitor
ββ DNS record β DNS Monitor
ββ Simple HTTP β URL Monitor
Quick reference:
"Test locally or deploy?"
What stage are you at?
ββ Developing new check
β ββ Browser check β npx playwright test (fastest iteration)
β ββ API check β npx checkly test (includes assertions)
β
ββ Ready to validate
β ββ npx checkly test (runs in Checkly runtime, catches issues)
β
ββ Ready for production
ββ npx checkly deploy (schedule checks to run continuously)
Testing hierarchy:
1. npx playwright test - Fastest, local Playwright execution (browser checks only)
2. npx checkly test - Validates in Checkly runtime, catches compatibility issues
3. npx checkly deploy - Deploys for continuous scheduled monitoring
"File-based or construct-based checks?"
How do you want to define checks?
ββ Auto-discovery (convention over configuration)
β ββ Browser checks β *.spec.ts files matching testMatch pattern
β ββ Multi-step β *.check.ts files with MultiStepCheck construct
β ββ API checks β *.check.ts files with ApiCheck construct
β
ββ Explicit definition
ββ Programmatic β Construct instances in .check.ts files
ββ Full control β Playwright Check Suite with playwright.config.ts
Patterns:
checks.browserChecks.testMatch in checkly.config.tscheckly/constructs and instantiate"Where should configuration go?"
What are you configuring?
ββ Project-level (all checks)
β ββ checkly.config.ts β defaults, locations, frequency, runtime
β
ββ Group-level (related checks)
β ββ CheckGroup construct β shared settings for subset of checks
β
ββ Check-level (individual)
ββ Check constructor β override defaults for specific check
Configuration hierarchy (specific overrides general): 1. Check-level properties (highest priority) 2. CheckGroup properties 3. checkly.config.ts defaults 4. Checkly account defaults (lowest priority)
Project structure
Typical Checkly CLI project:
my-monitoring-project/
βββ checkly.config.ts # Project configuration
βββ __checks__/ # Check definitions
β βββ api.check.ts # API check construct
β βββ homepage.spec.ts # Browser check (auto-discovered)
β βββ login.spec.ts # Another browser check
β βββ utils/
β βββ alert-channels.ts # Shared alert channel definitions
β βββ helpers.ts # Shared helper functions
βββ playwright.config.ts # Playwright configuration (optional)
βββ package.json
βββ node_modules/
βββ checkly/ # CLI package with constructs
Installation methods
New project (recommended)
npm create checkly@latest
Creates scaffolded project with:
checkly.config.ts with sensible defaults__checks__/ directorypackage.json with checkly dependency.gitignore configuredExisting project
# Install as dev dependency
npm install --save-dev checklyCreate configuration file
npx checkly init
Global installation (not recommended)
npm install -g checkly
checkly test
Note: Use npx checkly instead for project-specific CLI version.
Related Skills
Getting started:
checkly-auth for authentication setupcheckly-config for project configurationcheckly-test for local testing workflowCreating checks:
checkly-checks for API and browser checkscheckly-monitors for simpler health checkscheckly-playwright for full test suite setupAdvanced workflows:
checkly-deploy for deployment strategiescheckly-constructs for understanding the object modelcheckly-advanced for retry strategies and reportersImport existing:
checkly-import to migrate from web UI to codeπ‘ Examples
# Create new Checkly project
npm create checkly@latestTest checks locally
npx checkly testDeploy to Checkly cloud
npx checkly deploy