# @datocms/cli-plugin-contentful

> Plugin for DatoCMS CLI to import projects from Contentful to DatoCMS

Latest version **4.2.0** (published 2026-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @datocms/cli-plugin-contentful
pnpm add @datocms/cli-plugin-contentful
yarn add @datocms/cli-plugin-contentful
bun add @datocms/cli-plugin-contentful
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 4.2.0 |
| Published | 2026-08-31 |
| First published | 2022-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.0.0 |
| Dependencies | 12 |
| Unpacked size | 87.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | DatoCMS |
| Maintainers | marcelofinamorvieira, stefanoverna, delphaber, mat_jack1, souljuse, sistrall_, datoroger |
| Keywords | contentful, datocms, import |

## Links

- npm: https://www.npmjs.com/package/@datocms/cli-plugin-contentful
- Repository: https://github.com/datocms/cli
- Homepage: https://github.com/datocms/cli#readme
- Issues: https://github.com/datocms/cli/issues
- npm.io page: https://npm.io/package/@datocms/cli-plugin-contentful

## Dependencies (12)

- [humps](https://npm.io/package/humps.md) ^2.0.1
- [listr2](https://npm.io/package/listr2.md) ^4.0.5
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [date-fns](https://npm.io/package/date-fns.md) ^2.29.3
- [enquirer](https://npm.io/package/enquirer.md) >= 2.3.0 < 3
- [@oclif/core](https://npm.io/package/@oclif/core.md) ^4
- [async-scheduler](https://npm.io/package/async-scheduler.md) ^1.4.4
- [@datocms/cli-utils](https://npm.io/package/@datocms/cli-utils.md) ^4.2.0
- [@whatwg-node/fetch](https://npm.io/package/@whatwg-node/fetch.md) ^0.10.13
- [contentful-management](https://npm.io/package/contentful-management.md) ^10.46.4
- [datocms-structured-text-utils](https://npm.io/package/datocms-structured-text-utils.md) ^5.1.7
- [datocms-contentful-to-structured-text](https://npm.io/package/datocms-contentful-to-structured-text.md) ^5.1.7

## Recent versions

- 4.2.0 (latest) — 2026-08-31
- 3.1.1 (next) — 2025-09-18
- 4.1.0 — 2026-08-25
- 4.0.25 — 2026-05-05
- 4.0.23 — 2026-04-29
- 4.0.22 — 2026-04-29
- 4.0.21 — 2026-04-28
- 4.0.15 — 2026-04-25
- 4.0.14 — 2026-04-23
- 4.0.12 — 2026-04-22
- 4.0.6 — 2026-04-21
- 4.0.4 — 2026-04-09
- 4.0.2 — 2026-04-03
- 4.0.1 — 2026-04-02
- 4.0.0 — 2026-04-01
- … 57 more at https://npm.io/package/@datocms/cli-plugin-contentful/versions

## README

# DatoCMS Contentful Import CLI

DatoCMS CLI plugin to import a Contentful project into a DatoCMS project.
Read a more detailed documentation [on the website](https://www.datocms.com/docs/import-and-export/import-space-from-contentful)

<!-- toc -->
* [DatoCMS Contentful Import CLI](#datocms-contentful-import-cli)
* [Usage](#usage)
* [Commands](#commands)
* [Test](#test)
<!-- tocstop -->

<br /><br />
<a href="https://www.datocms.com/">
<img src="https://www.datocms.com/images/full_logo.svg" height="60">
</a>
<br /><br />

# Usage

```sh-session
$ npm install -g datocms
$ datocms plugins:install @datocms/cli-plugin-contentful
$ datocms contentful:import --help
```

# Commands

<!-- commands -->
* [`@datocms/cli-plugin-contentful contentful:import`](#datocmscli-plugin-contentful-contentfulimport)

## `@datocms/cli-plugin-contentful contentful:import`

Import a Contentful project into a DatoCMS project

```
USAGE
  $ @datocms/cli-plugin-contentful contentful:import [--json] [--config-file <value>] [--profile <value>] [--api-token
    <value>] [--log-level NONE|BASIC|BODY|BODY_AND_HEADERS] [--log-mode stdout|file|directory] [--contentful-token
    <value>] [--contentful-space-id <value>] [--contentful-environment <value>] [--autoconfirm] [--ignore-errors]
    [--skip-content] [--only-content-type <value>] [--concurrency <value>]

FLAGS
  --autoconfirm                     Automatically enter an affirmative response to all confirmation prompts, enabling
                                    the command to execute without waiting for user confirmation, like forcing the
                                    destroy of existing Contentful schema models.
  --concurrency=<value>             [default: 15] Specify the maximum number of operations to be run concurrently
  --contentful-environment=<value>  The environment you want to work with
  --contentful-space-id=<value>     Your Contentful project space ID
  --contentful-token=<value>        Your Contentful project read-only API token
  --ignore-errors                   Ignore errors encountered during import
  --log-level=<option>              Level of logging to use for the profile
                                    <options: NONE|BASIC|BODY|BODY_AND_HEADERS>
  --only-content-type=<value>       Exclusively import the specified content types. Specify the content types you want
                                    to import with comma separated Contentful IDs - Example: blogPost,landingPage,author
  --skip-content                    Exclusively import the schema (models) and ignore records and assets

GLOBAL FLAGS
  --api-token=<value>    Specify a custom API key to access a DatoCMS project
  --config-file=<value>  [default: ./datocms.config.json, env: DATOCMS_CONFIG_FILE] Specify a custom config file path
  --json                 Format output as json.
  --log-mode=<option>    Where logged output should be written to
                         <options: stdout|file|directory>
  --profile=<value>      [env: DATOCMS_PROFILE] Use settings of profile in datocms.config.js

DESCRIPTION
  Import a Contentful project into a DatoCMS project
```

_See code: [lib/commands/contentful/import.js](https://github.com/datocms/cli/blob/@datocms/cli-plugin-contentful@4.2.0/packages/cli-plugin-contentful/lib/commands/contentful/import.js)_
<!-- commandsstop -->

# Test

Unfortunately Contentful management client only accepts read-write tokens, so we cannot make testing available for everybody.

To run the tests use this command:

```
npm test
```

You can get the `CONTENTFUL_TOKEN` from the password management service

---
_Source: https://npm.io/package/@datocms/cli-plugin-contentful · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
