Was this page helpful?

Merge app CLI

What is Merge app CLI?

Merge app CLI allows you to use Merge app through the Contentful CLI. You can compare content type differences between environments, export a migration script and apply it right from the Contentful CLI, without switching to the developer's UI in the web app.

Automate merging your content type changes by integrating Merge app CLI into your CI/CD pipeline.

Requirements

See Merge app requirements.

Merge content type changes with Contentful CLI

Merging content type changes between environments with Contentful CLI involves the following steps:

  1. View content type differences.
  2. Export differences as migration file.
  3. Apply differences to the target environment.

View content type differences

To view content type differences between your source and target environments, run the following command:

contentful merge show --te <target-environment-id> --se <source-environment-id>
If the Merge app isn't installed in your source and target environments, follow the prompts in the Contentful CLI to install it.
If the Merge app is not installed and you don’t have installation rights, contact your space administrator to install it for you.

Export differences as migration file

To download a content type migration script, run the following command:

contentful merge export --te <target-environment-id> --se <source-environment-id>

Apply differences to the target environment

To apply the exported migration script to your target environment, run the following command:

contentful space migration --space <space-id> --environment <target-environment-id> <path-to-migration-script>

Next steps

Not what you’re looking for? Try our FAQ.