> ## Documentation Index
> Fetch the complete documentation index at: https://checkly-422f444a-paula-tree-202-entitlements-group-troubles.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Basic Workflow

> Complete workflow for using the Checkly CLI - from testing to deployment

<Note>Before using the CLI, you'll need to [authenticate with your Checkly account](/cli/authentication).</Note>

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

```bash Terminal theme={null}
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:

<CodeGroup>
  ```bash Test by Check Name theme={null}
  # 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"
  ```

  ```bash Test by File Name theme={null}
  # Specify the entire file name
  npx checkly test api.check.ts

  # Match parts of the file name
  # This will run api.check.ts and home.check.ts
  npx checkly test api home
  ```

  ```bash Test by Tags theme={null}
  # Specify a single tag
  npx checkly test --tags api

  # Specify multiple tags
  # This will run checks tagged with "api" and "multistep"
  npx checkly test --tags "api,multistep"

  # Specify multiple tag groups
  # This will run checks tagged with "api" and "multistep" or "browser"
  npx checkly test --tags "api,multistep" --tags "browser"
  ```
</CodeGroup>

### Testing Options

<CodeGroup>
  ```bash Test in Location theme={null}
  npx checkly test --location "us-east-1"
  ```

  ```bash Verbose Output theme={null}
  npx checkly test --verbose
  ```

  ```bash Generate Report theme={null}
  npx checkly test --reporter json
  ```
</CodeGroup>

### 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

```bash Terminal theme={null}
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

<CodeGroup>
  ```bash Preview Changes theme={null}
  npx checkly deploy --preview
  ```

  ```bash Display Changes after theme={null}
  npx checkly deploy --output
  ```

  ```bash Force Deployment theme={null}
  npx checkly deploy --force
  ```
</CodeGroup>

### 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.
