# checkly import - Checkly Docs

> Import existing resources into your CLI-managed project.

Source: https://www.checklyhq.com/docs/cli/checkly-import/

---

- Usage
- Command Options
- Import Workflow 1. Plan Generation
- 2. Plan Application
- 3. Plan Commitment

- Subcommands checkly import plan
- checkly import apply
- checkly import commit
- checkly import cancel

- Best Practices Before Importing
- After Importing

- Related Commands

CLI Commands

# checkly import

Import existing resources into your CLI-managed project.

Available since CLI v5.4.0.

Learn more about importing existing Checkly resources in [the “Importing Existing Resources” guide](https://www.checklyhq.com/docs/cli/importing).

The `checkly import plan` command imports existing resources from your Checkly account into your CLI-managed project. This allows you to bring existing checks, alert channels, and other resources under code management using a structured three-phase workflow.

You can use `npx checkly import` as a shorthand for `npx checkly import plan`.

Prerequisites

Before using `checkly import`, ensure you have:

- An initialized Checkly CLI project

- A Checkly account with existing resources to import

- Valid Checkly account authentication (run `npx checkly login` if needed)

## ​ Usage

Import all resources from your account into the current project.
Terminal

```
npx checkly import plan [resources] [options]
```

**Examples:**
Terminal

```
# Import a specific resource by its ID
npx checkly import plan check:2ce8...
```

**Available resource types to import**:

- `check` - Individual monitoring checks

- `check-group` - Collections of related checks

- `alert-channel` - Notification channels

- `maintenance-window` - Scheduled maintenance periods

- `private-location` - Custom monitoring locations

- `dashboard` - Public status dashboards

- `status-page` - Status page configurations

- `status-page-service` - Status page service definitions

`npx checkly import plan` starts an interactive process that generates an import plan, applies it to create Check files, and commits the changes to mark resources as managed by your CLI project.
Option Required Description

`--config, -c` - The Checkly CLI configuration file. If not passed, uses the `checkly.config.ts js` file in the current directory.

`--root` - Root folder in which to write generated code files. Default: `__checks__`.

`--preview` - Preview generated code without creating an import plan.

## ​ Command Options

​

string

Specify a particular configuration file to use instead of the default `checkly.config.ts` or `checkly.config.js`. **Usage:** Terminal

```
npx checkly import plan --config=
npx checkly import plan -c=
```

**Examples:** Terminal

```
$ npx checkly import plan --config="./checkly.staging.config.ts"
```

​

string

Set the root folder in which to write generated code files. The default is `__checks__`. **Usage:** Terminal

```
npx checkly import plan --root=
```

**Examples:** Terminal

```
$ npx checkly import plan --root="./src/checks"
```

​

boolean

default: "false"

Generate a code preview without creating an import plan or linking resources to your project. **Usage:** Terminal

```
npx checkly import plan --preview
```

## ​ Import Workflow

The import process follows a three-phase workflow for safe resource migration:

### ​ 1. Plan Generation

Analyze your account, generate an import plan and create code files for your resources.
Terminal

```
npx checkly import plan
```

### ​ 2. Plan Application

Apply the generated plan and link the imported resources to your CLI project, but keeps the mapping in a pending state.
Terminal

```
npx checkly import apply
```

### ​ 3. Plan Commitment

Commit the applied changes and mark resources as CLI-managed.
Terminal

```
npx checkly import commit
```

## ​ Subcommands

### ​ `checkly import plan`

Generate code and create an import plan for resources in your account. Use `--preview` to inspect generated code without creating a plan.
Terminal

```
npx checkly import plan [resources] [options]
```

### ​ `checkly import apply`

Apply a previously generated import plan to create the actual code files in your project structure.
Terminal

```
npx checkly import apply
```

### ​ `checkly import commit`

Commit an applied import plan to finalize the import and mark resources as managed by your CLI project.
Terminal

```
npx checkly import commit
```

### ​ `checkly import cancel`

Cancel a generated plan that hasn’t been committed to discard any pending import operations.
Terminal

```
npx checkly import cancel
```

## ​ Best Practices

### ​ Before Importing

- **Rely on version control and git** to track changes

- **Review your account** resources to understand what will be imported

- **Plan directory structure** using `--root` if needed

- **Import specific resources** using `resource-type:id` syntax

### ​ After Importing

- **Review generated code** for accuracy and style consistency

- **Test imported checks** using `checkly test`

- **Commit to version control** to track changes

- **Deploy to verify** everything works as expected

## ​ Related Commands

- [`checkly deploy`](https://www.checklyhq.com/docs/cli/checkly-deploy) - Deploy imported resources

- [`checkly test`](https://www.checklyhq.com/docs/cli/checkly-test) - Test imported checks locally

Was this page helpful?

[Suggest edits](https://github.com/checkly/docs/edit/main/cli/checkly-import.mdx)[Raise issue](https://github.com/checkly/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/checkly-import)

[checkly env Previous](https://www.checklyhq.com/docs/cli/checkly-env)[checkly incidents Next](https://www.checklyhq.com/docs/cli/checkly-incidents)

[x](https://x.com/checklyhq)[github](https://github.com/checkly)[linkedin](https://linkedin.com/company/checkly)

[Powered by This documentation is built and hosted on Mintlify, a developer documentation platform](https://www.mintlify.com/?utm_campaign=poweredBy&utm_medium=referral&utm_source=checkly-422f444a)
