Before using the CLI, you’ll need to authenticate with your Checkly account.
The Checkly CLI follows a simple workflow that enables you to test and deploy your monitoring checks. First run 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

The test command allows you to run your checks locally before deploying them to Checkly’s infrastructure.

Basic Testing

Terminal
npx checkly test
This command will:
  • 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:
# Match parts of the check name via regular expression
# This will run checks names "Home page check suite" or "API check suite"
npx checkly test --grep=".*check suite"

Testing Options

npx checkly test --location "us-east-1"

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
npx checkly deploy
This command will:
  • 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

npx checkly deploy --preview

Deployment Process

The deployment process includes:
  1. Validation: CLI validates your check configurations
  2. Creation/Update: Checks are created or updated in your account
  3. Scheduling: Monitoring schedules are configured
  4. Activation: Checks become active and start monitoring

Workflow Best Practices

  1. Start Local: Always test changes locally first
  2. Incremental Testing: Test individual checks during development
  3. Version Control: Commit your check configurations to Git
  4. Review Changes: Use --preview to review before deployment
  5. Monitor Results: Check results after deployment
This comprehensive workflow ensures you can develop, test, and deploy monitoring checks with confidence, maintaining the reliability and performance of your applications.