A CLI tool to automatically generate a starting point for Contentful schema migrations between two spaces or environments. It compares content type definitions from export files or directly from Contentful spaces via the Management API, producing TypeScript or JavaScript migration files compatible with the contentful-migration tool. Version 0.10.3 is the latest stable release. Originally built by Watermark Church to simplify Contentful schema changes. Key differentiator: automates migration scaffolding by diffing actual Contentful schemas, reducing manual effort. Outputs TypeScript by default, which requires additional steps to run (see warnings). Release cadence is low, with infrequent updates.
npm install contentful-schema-diffNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs the CLI globally and generates a migration from production to dev using a management token.
Use --js flag to output JavaScript directly, or compile TypeScript files before running with contentful-migration.
Double-check that --from is the original space/environment and --to is the target space/environment.
Always provide a Contentful management token if you are comparing spaces or environments without pre-exported JSON files.
Check available options with --help. Correct flag names: --from, --to, --token, --content-type, --out, --js, --ts, --one-file, --no-format, --help.
Reinstall the package globally: npm install -g contentful-schema-diff
Use the --js flag to output JavaScript files, or compile the TypeScript files with tsc before running the migration.