Before using the CLI, you’ll need to authenticate with your Checkly account.
npx checkly test
to test your checks locally, then run npx checkly deploy
to deploy them to Checkly’s infrastructure.
Step 1: Testing Checks Locally
Thetest
command allows you to run your checks locally before deploying them to Checkly’s infrastructure.
Basic Testing
Terminal
- Execute all checks defined in your project
- Run them in your local environment
- Display real-time results and logs
- Show pass/fail status for each check
Testing Specific Checks
You can test individual checks or groups:Testing Options
Local Testing Benefits
- Fast Feedback: Get immediate results without waiting for scheduled runs
- Development Friendly: Perfect for debugging and development workflows
- CI/CD Integration: Can be used in automated testing pipelines to verify preview deployments
Step 2: Deploying to Checkly
Once you’ve tested your checks locally and are satisfied with the results, deploy them to Checkly’s global infrastructure to run as scheduled checks.Basic Deployment
Terminal
- Parse and validate your Checkly configurations
- Create or update checks in your Checkly account
- Set up the monitoring schedule based on your configuration
- Deploy to all specified locations
Deployment Options
Deployment Process
The deployment process includes:- Validation: CLI validates your check configurations
- Creation/Update: Checks are created or updated in your account
- Scheduling: Monitoring schedules are configured
- Activation: Checks become active and start monitoring
Workflow Best Practices
- Start Local: Always test changes locally first
- Incremental Testing: Test individual checks during development
- Version Control: Commit your check configurations to Git
- Review Changes: Use
--preview
to review before deployment - Monitor Results: Check results after deployment