A CLI and Docker tool that simplifies running Contentful migrations with a single command. Current stable version is 1.3.0. It wraps the official contentful-migration package, adding a runner that tracks executed migrations and supports TypeScript via tsx. Provides environment variable configuration for Content Management Token, Space ID, and Environment ID. Designed for CI/CD integration (e.g., CircleCI) as an alternative to manual migration orchestration.
npm install contentful-migration-toolNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs dependencies, sets environment variables, creates a migration file, and runs migrations
Upgrade Node.js to version 18 or later.
Install tsx as a devDependency: npm install --save-dev tsx, then run with npx tsx ./node_modules/.bin/contentful-migration-tool run ./migrations
Install contentful-migration as a devDependency: npm install --save-dev contentful-migration
Ensure all three environment variables are set before running the command.
Mount your migrations folder to /app/migrations using -v $(pwd)/migrations:/app/migrations
Run npm install --save-dev contentful-migration@latest
Ensure the migrations directory exists and contains .js or .ts files. Run mkdir -p migrations.
Verify that CONTENT_MANAGEMENT_TOKEN, SPACE_ID, and ENVIRONMENT_ID are correctly set.
Use CommonJS syntax (module.exports) or run with tsx: npx tsx ./node_modules/.bin/contentful-migration-tool run ./migrations