
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
contentful-cli-export
Advanced tools
This tool simplifies exporting data from Contentful to a local json file. It's easier to use than the actual Contentful CLI export and can also be easily integrated into a CI/CD pipeline such as GitLab or GitHub.
Note: This is NOT the official Contentful CLI Export tool. That can be found on GitHub 🔗 or NpmJS 🔗
✨ Features · 💡 Installation · 📟 Example · 🎹 Usage · 📅 ToDo · 👾 Contributors · 🎩 Acknowledgments· 📚 Collection · 📄 License
To use this cli script, you must have Node.js 🔗 and npm 🔗 installed.
To install it, simply run:
npm install contentful-cli-export --save
Or, if using yarn 🔗:
yarn add contentful-cli-export
Similarly, if you are using Bun 🔗, just run:
bun add contentful-cli-release
node >= 18.20.0npm >= 10.5.0contentful-management >= 11.31.7contentful-export >= 7.19.146To better use the Contentful CLI Export, it is recommended to put the following values in your .env/.env.local
file:
CMS_MANAGEMENT_TOKEN=<management-token>
CMS_SPACE_ID=<space-id>
CMS_MAX_ALLOWED_LIMIT=100
CMS_EXPORT_DIR=export/
However, these values could also be passed as parameters during execution.
You will need to create the CMS_EXPORT_DIR folder, that will contain all the exports. This folder should stay
preferably in the root of your project. If no folder is specified, a folder export/ will be created automatically
if missing.
The basic command should contain the from environment we want to export from:
npx contentful-cli-export --from "<environment-id>"
A more complex export command could be
npx contentful-cli-export --from "<environment-id>" --space-id"<space-id>" --management-token "<management-token>" --compress
This will export data from the specified environment-id, space-id, and management token, and compress the result into a ZIP file.
This script can be used from the command line and accepts various arguments for customization:
--from or --environment-id [MANDATORY]: The environment id from which data will be exported.--space-id: The Contentful space id.--management-token or --mt: The Contentful Management Token.--only-published: To include only published data.--download-assets: To include assets in the exported data.--verbose: Display the progress in new lines, instead of animated UI (useful in CI).--compress: To compress the result into a ZIP file.--export-dir: To specify a custom directory for the exported data (default is subdirectory CMS_EXPORT_DIR or
export/ in your project root). The script will exit if this custom folder doesn't exist.--max-allowed-limit: Number of entries to fetch at each iteration. Max: 1000 - Recommended: 100 (lower values
fire more API calls, but avoid 'Response too big' error).@fciacchi | @psyvic | @aalduz | @leslyto |
Feel free to open issues or pull requests in our GitHub Repository if you have suggestions or improvements to propose.
I would like to express my gratitude to the following parties:
Thank you to everyone involved!
We produce a bunch of interesting packages for Contentful. You might want to check them out:
This project is licensed under the MIT License
FAQs
Contentful CLI Export Environment
We found that contentful-cli-export demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.