{"id":15605296,"url":"https://github.com/atidatech/contentful-cli-export","last_synced_at":"2025-04-27T11:25:27.570Z","repository":{"id":170715747,"uuid":"634933458","full_name":"AtidaTech/contentful-cli-export","owner":"AtidaTech","description":"Contentful CLI Export Tool","archived":false,"fork":false,"pushed_at":"2024-08-27T09:39:29.000Z","size":551,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-25T00:26:43.360Z","etag":null,"topics":["backup","cli","contentful","contentful-cli","contentful-export","javascript","nodejs","npm"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/contentful-cli-export","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AtidaTech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-01T15:26:11.000Z","updated_at":"2024-08-27T09:37:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6ac76cc-f5c2-44be-a0e0-d7392f6c51f7","html_url":"https://github.com/AtidaTech/contentful-cli-export","commit_stats":{"total_commits":27,"total_committers":3,"mean_commits":9.0,"dds":"0.37037037037037035","last_synced_commit":"3c7a9cf62c60a5a4ef8496d91dda2bafe40f81ee"},"previous_names":["atidatech/contentful-cli-export"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtidaTech%2Fcontentful-cli-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtidaTech%2Fcontentful-cli-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtidaTech%2Fcontentful-cli-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtidaTech%2Fcontentful-cli-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtidaTech","download_url":"https://codeload.github.com/AtidaTech/contentful-cli-export/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242450813,"owners_count":20130258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","cli","contentful","contentful-cli","contentful-export","javascript","nodejs","npm"],"created_at":"2024-10-03T04:03:56.628Z","updated_at":"2025-03-07T19:31:11.246Z","avatar_url":"https://github.com/AtidaTech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/github/license/AtidaTech/contentful-cli-export)](https://opensource.org/licenses/MIT)\n[![npm](https://img.shields.io/npm/v/contentful-cli-export)](https://npmjs.com/package/contentful-cli-export)\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/AtidaTech/contentful-cli-export)\n![Downloads](https://img.shields.io/npm/dw/contentful-cli-export)\n![Forks](https://img.shields.io/github/forks/AtidaTech/contentful-cli-export)\n[![Bun.sh](https://img.shields.io/badge/bun.sh-compatible-orange)](https://bun.sh)\n\n# Contentful Export Tool\n\nThis tool simplifies exporting data from Contentful to a local json file. It's easier to use than the actual Contentful\nCLI export and can also be easily integrated into a CI/CD pipeline such as GitLab or GitHub.\n\n\u003e Note: This is NOT the official Contentful CLI Export tool. That can be found on\n[GitHub 🔗](https://github.com/contentful/contentful-cli) or [NpmJS 🔗](https://www.npmjs.com/package/contentful-cli)\n\n\u003ch3\u003eSponsored by \u003ca href=\"https://github.com/AtidaTech\"\u003e\u003cb\u003eAtida\u003c/b\u003e\n\u003cimg src=\"https://avatars.githubusercontent.com/u/127305035?s=200\u0026v=4\" width=\"14px;\" alt=\"Atida\" /\u003e\u003c/a\u003e\u003c/h3\u003e\n\n\u003chr /\u003e\n\n[✨ Features](#-features) · [💡 Installation](#-installation) · [📟 Example](#-example) · [🎹 Usage](#-usage) ·\n[📅 ToDo](#-todo) · [👾 Contributors](#-contributors) · [🎩 Acknowledgments](#-acknowledgements)·\n[📚 Collection](#-other-scripts-in-the-same-collection)  · [📄 License](#-license)\n\n\u003chr /\u003e\n\n## ✨ Features\n\n- **Ease of Use:** Compared to the actual Contentful CLI, this tool requires less manual configuration and is more\nstraightforward to use.\n- **CI/CD Pipeline Integration:** It is designed to be used as part of a CI/CD pipeline, like GitLab or GitHub.\nDifferently from the official Contentful CLI, it doesn't require a global installation, making it portable and easy\nto run in various environments.\n- **Command Line Parameters:** All necessary parameters can be passed via command line arguments, making it flexible\nfor different use cases. These include management-token, space-id and environment-id, making it even more suitable\nfor being integrated into a release pipeline.\n- **ZIP Compression:** This tool provides an option to compress the result into a ZIP file. This is particularly\nuseful when exporting large amounts of data or assets, helping to save storage space.\n- **Consistent Naming:** The naming of the output files (.json, .zip, and .log) are consistent and predictable,\nmaking it easier to manage the exported data (current date + space-id + environment-id).\n\n## 💡 Installation\n\nTo use this cli script, you must have [Node.js 🔗](https://nodejs.org/) and [npm 🔗](http://npmjs.org) installed.\n\nTo install it, simply run:\n\n```shell\nnpm install contentful-cli-export --save\n```\n\nOr, if using [yarn 🔗](https://yarnpkg.com/lang/en/):\n\n```shell\nyarn add contentful-cli-export\n```\n\nSimilarly, if you are using [Bun 🔗](https://bun.sh), just run:\n\n```shell\nbun add contentful-cli-release\n```\n\n### Requirements\n\n* `node` \u003e= 18.20.0\n* `npm` \u003e= 10.5.0\n* `contentful-management` \u003e= 11.31.7\n* `contentful-export` \u003e= 7.19.146\n* [contentful-lib-helpers](https://www.npmjs.com/package/contentful-lib-helpers) \u003e= 0.4.0\n\n### Set-up\n\n* To better use the Contentful CLI Export, it is recommended to put the following values in your `.env`/`.env.local`\nfile:\n\n    ```shell\n    CMS_MANAGEMENT_TOKEN=\u003cmanagement-token\u003e\n    CMS_SPACE_ID=\u003cspace-id\u003e\n    CMS_MAX_ALLOWED_LIMIT=100\n    CMS_EXPORT_DIR=export/\n    ```\n\n    However, these values could also be passed as parameters during execution.\n\n* You will need to create the `CMS_EXPORT_DIR` folder, that will contain all the exports. This folder should stay\npreferably in the root of your project. If no folder is specified, a folder `export/` will be created automatically\nif missing.\n\n## 📟 Example\n\nThe basic command should contain the `from` environment we want to export from:\n\n```shell\nnpx contentful-cli-export --from \"\u003cenvironment-id\u003e\"\n```\n\nA more complex export command could be\n\n```shell\nnpx contentful-cli-export --from \"\u003cenvironment-id\u003e\" --space-id\"\u003cspace-id\u003e\" --management-token \"\u003cmanagement-token\u003e\" --compress\n```\n\nThis will export data from the specified environment-id, space-id, and management token, and compress the result into\na ZIP file.\n\n## 🎹 Usage\n\nThis script can be used from the command line and accepts various arguments for customization:\n\n* `--from` or `--environment-id` [MANDATORY]: The environment id from which data will be exported.\n* `--space-id`: The Contentful space id.\n* `--management-token` or `--mt`: The Contentful Management Token.\n* `--only-published`: To include only published data.\n* `--download-assets`: To include assets in the exported data.\n* `--verbose`: Display the progress in new lines, instead of animated UI (useful in CI).\n* `--compress`: To compress the result into a ZIP file.\n* `--export-dir`: To specify a custom directory for the exported data (default is subdirectory `CMS_EXPORT_DIR` or\n`export/` in your project root). The script will exit if this custom folder doesn't exist.\n* `--max-allowed-limit`: Number of entries to fetch at each iteration. Max: `1000` - Recommended: `100` (lower values\nfire more API calls, but avoid 'Response too big' error).\n\n## 📅 Todo\n\n* Add compatibility with official Contentful Export env/settings.\n* Improve Logging (+ Colors).\n* Add Tests.\n\n## 👾 Contributors\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/fciacchi\"\u003e\u003cimg src=\"https://images.weserv.nl/?url=avatars.githubusercontent.com/u/58506?v=4\u0026h=100\u0026w=100\u0026fit=cover\u0026mask=circle\u0026maxage=7d\" width=\"100px;\" alt=\"Fabrizio Ciacchi\" /\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e@fciacchi\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/psyvic\"\u003e\u003cimg src=\"https://images.weserv.nl/?url=avatars.githubusercontent.com/u/29251597?v=4\u0026h=100\u0026w=100\u0026fit=cover\u0026mask=circle\u0026maxage=7d\" width=\"100px;\" alt=\"Victor Hugo Aizpuruo\" /\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e@psyvic\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/aalduz\"\u003e\u003cimg src=\"https://images.weserv.nl/?url=avatars.githubusercontent.com/u/11409770?v=4\u0026h=100\u0026w=100\u0026fit=cover\u0026mask=circle\u0026maxage=7d\" width=\"100px;\" alt=\"Aldo Fernández\" /\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e@aalduz\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/leslyto\"\u003e\u003cimg src=\"https://images.weserv.nl/?url=avatars.githubusercontent.com/u/4264812?v=4\u0026h=100\u0026w=100\u0026fit=cover\u0026mask=circle\u0026maxage=7d\" width=\"100px;\" alt=\"Stefan Stoev\" /\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e@leslyto\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Contributions\nFeel free to open issues or pull requests in our GitHub Repository if you have suggestions or improvements to propose.\n\n## 🎩 Acknowledgements\n\nI would like to express my gratitude to the following parties:\n\n- [Atida 🔗](https://www.atida.com/), the company that has allowed these scripts to be open sourced. Atida is an e-commerce platform that\nsells beauty and medical products. Their support for open source is greatly appreciated. A special thank to\n\u003ca href=\"https://github.com/shoopi\"\u003e\u003cimg src=\"https://images.weserv.nl/?url=avatars.githubusercontent.com/u/1385372?v=4\u0026h=16\u0026w=16\u0026fit=cover\u0026mask=circle\u0026maxage=7d\" width=\"16px;\" alt=\"Shaya Pourmirza\" /\u003e Shaya Pourmirza\u003c/a\u003e\nthat has been a great promoter and supporter of this initiative inside the company.\n- [Contentful 🔗](https://www.contentful.com/), for creating their excellent content management platform and the JavaScript CMA SDK that this\nlibrary is built on. Without their work, this project would not be possible.\n\nThank you to everyone involved!\n\n## 📚 Other Scripts in the same collection\n\nWe produce a bunch of interesting packages for Contentful. You might want to check them out:\n\n* **Contentful Lib Helpers** ([GitHub](https://github.com/AtidaTech/contentful-lib-helpers/) and [NpmJS](https://www.npmjs.com/package/contentful-lib-helpers)): Utility Library for Contentful Management API.\n* **Contentful CLI Export** ([GitHub](https://github.com/AtidaTech/contentful-cli-export/) and [NpmJS](https://www.npmjs.com/package/contentful-cli-export)): Simplifies backup of your Contentful Environment.\n* **Contentful CLI Migrations** ([GitHub](https://github.com/AtidaTech/contentful-cli-migrations/) and [NpmJS](https://www.npmjs.com/package/contentful-cli-migrations)): Tool to automate and scale Contentful Migrations.\n* **Contentful CLI Release** ([GitHub](https://github.com/AtidaTech/contentful-cli-release/) and [NpmJS](https://www.npmjs.com/package/contentful-cli-release)): Release utilities to deploy Contentful in a CI/CD.\n\n[//]: # (* **Contentful CLI Sync** \u0026#40;[GitHub]\u0026#40;https://github.com/AtidaTech/contentful-cli-sync/\u0026#41; and )\n[//]: # ([NpmJS]\u0026#40;https://www.npmjs.com/package/contentful-cli-sync\u0026#41;\u0026#41;: Contentful tool to sync data )\n[//]: # (across Spaces and Environments.)\n\n## 📄 License\nThis project is licensed under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatidatech%2Fcontentful-cli-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatidatech%2Fcontentful-cli-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatidatech%2Fcontentful-cli-export/lists"}