{"action":"created","comment":{"url":"https://api.github.com/repos/contentful/contentful-export/pulls/comments/183746080","pull_request_review_id":114800735,"id":183746080,"diff_hunk":"@@ -10,25 +10,166 @@\n \n [Contentful](https://www.contentful.com) provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.\n \n-This is a command line tool (CLI) that help you backup your published Content Model, Content and Assets or move them to a new Contentful space. _It will support Editor Interfaces, Webhooks and Roles & Permissions in a future version._\n+This is a library that help you backup your Content Model, Content and Assets or move them to a new Contentful space. _It will support Roles & Permissions in a future version._\n \n To import your exported data, please refer to the [contentful-import](https://github.com/contentful/contentful-import) repository.\n \n-## Installation\n+## :exclamation: Usage as CLI\n+We moved the CLI version of this tool into our [Contentful CLI](https://github.com/contentful/contentful-cli). This allows our users to use and install only one single CLI tool to get the full Contentful experience.\n \n-We recommend the installation of this CLI via npm:\n+Please have a look at the [Contentful CLI export command documentation](https://github.com/contentful/contentful-cli/tree/master/docs/space/export) to learn more about how to use this as command line tool.\n+\n+\n+## :cloud: Installation\n \n ```bash\n-npm install -g contentful-export\n+npm install contentful-export\n+```\n+\n+## :hand: Usage\n+\n+\n+While this tool is intended for use as a command line tool, you can also use it as a Node library:\n+\n+```javascript\n+const contentfulExport = require('contentful-export')\n+\n+const options = {\n+  spaceId: '<space_id>',\n+  managementToken: '<content_management_api_key>',\n+  ...\n+}\n+\n+contentfulExport(options)\n+  .then((result) => {\n+    console.log('Your space data:', result)\n+  })\n+  .catch((err) => {\n+    console.log('Oh no! Some errors occurred!', err)\n+  })\n+```\n+\n+\n+\n+### Querying\n+\n+To scope your export, you are able to pass query parameters. All search parameters of our API are supported as documented in our [API documentation](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters).\n+\n+```javascript\n+const options = {\n+  spaceId: '<space_id>',\n+  managementToken: '<content_management_api_key>',\n+  queryEntries: 'content_type=<content_type_id>'\n+}\n+\n+contentfulExport(options)\n+...\n+```\n+\n+The Export tool also support multiple inline queries.\n+\n+```javascript\n+const options = {\n+  spaceId: '<space_id>',\n+  managementToken: '<content_management_api_key>',\n+  queryEntries: [\n+    'content_type=<content_type_id>',\n+    'sys.id=<entry_id>'\n+  ]\n+}\n+\n+contentfulExport(options)\n+...\n+```\n+\n+`queryAssets` uses the same syntax as `queryEntries`\n+\n+### Export an environment\n+\n+```javascript\n+const options = {\n+  spaceId: '<space_id>',\n+  managementToken: '<content_management_api_key>',\n+  environment: '<environment-id>'","path":"README.md","position":88,"original_position":88,"commit_id":"2999562aa941d7721ba7800e48e4761de119490c","original_commit_id":"2999562aa941d7721ba7800e48e4761de119490c","user":{"login":"loudmouth","id":4554909,"avatar_url":"https://avatars2.githubusercontent.com/u/4554909?v=4","gravatar_id":"","url":"https://api.github.com/users/loudmouth","html_url":"https://github.com/loudmouth","followers_url":"https://api.github.com/users/loudmouth/followers","following_url":"https://api.github.com/users/loudmouth/following{/other_user}","gists_url":"https://api.github.com/users/loudmouth/gists{/gist_id}","starred_url":"https://api.github.com/users/loudmouth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loudmouth/subscriptions","organizations_url":"https://api.github.com/users/loudmouth/orgs","repos_url":"https://api.github.com/users/loudmouth/repos","events_url":"https://api.github.com/users/loudmouth/events{/privacy}","received_events_url":"https://api.github.com/users/loudmouth/received_events","type":"User","site_admin":false},"body":"in fact, i can see in the configuration options below that it _is_ supposed to be `environmentId` 😉 ","created_at":"2018-04-24T14:13:39Z","updated_at":"2018-04-24T14:15:12Z","html_url":"https://github.com/contentful/contentful-export/pull/103#discussion_r183746080","pull_request_url":"https://api.github.com/repos/contentful/contentful-export/pulls/103","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/contentful/contentful-export/pulls/comments/183746080"},"html":{"href":"https://github.com/contentful/contentful-export/pull/103#discussion_r183746080"},"pull_request":{"href":"https://api.github.com/repos/contentful/contentful-export/pulls/103"}},"in_reply_to_id":183745585},"pull_request":{"url":"https://api.github.com/repos/contentful/contentful-export/pulls/103","id":183734869,"html_url":"https://github.com/contentful/contentful-export/pull/103","diff_url":"https://github.com/contentful/contentful-export/pull/103.diff","patch_url":"https://github.com/contentful/contentful-export/pull/103.patch","issue_url":"https://api.github.com/repos/contentful/contentful-export/issues/103","number":103,"state":"open","locked":false,"title":"Update readme to fit (re)moved CLI support","user":{"login":"axe312ger","id":1737026,"avatar_url":"https://avatars1.githubusercontent.com/u/1737026?v=4","gravatar_id":"","url":"https://api.github.com/users/axe312ger","html_url":"https://github.com/axe312ger","followers_url":"https://api.github.com/users/axe312ger/followers","following_url":"https://api.github.com/users/axe312ger/following{/other_user}","gists_url":"https://api.github.com/users/axe312ger/gists{/gist_id}","starred_url":"https://api.github.com/users/axe312ger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axe312ger/subscriptions","organizations_url":"https://api.github.com/users/axe312ger/orgs","repos_url":"https://api.github.com/users/axe312ger/repos","events_url":"https://api.github.com/users/axe312ger/events{/privacy}","received_events_url":"https://api.github.com/users/axe312ger/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-24T13:24:24Z","updated_at":"2018-04-24T14:15:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"846120e0971a677aa5b19b85dc61d2bd3534ef09","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Khaledgarbaya","id":1156093,"avatar_url":"https://avatars1.githubusercontent.com/u/1156093?v=4","gravatar_id":"","url":"https://api.github.com/users/Khaledgarbaya","html_url":"https://github.com/Khaledgarbaya","followers_url":"https://api.github.com/users/Khaledgarbaya/followers","following_url":"https://api.github.com/users/Khaledgarbaya/following{/other_user}","gists_url":"https://api.github.com/users/Khaledgarbaya/gists{/gist_id}","starred_url":"https://api.github.com/users/Khaledgarbaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Khaledgarbaya/subscriptions","organizations_url":"https://api.github.com/users/Khaledgarbaya/orgs","repos_url":"https://api.github.com/users/Khaledgarbaya/repos","events_url":"https://api.github.com/users/Khaledgarbaya/events{/privacy}","received_events_url":"https://api.github.com/users/Khaledgarbaya/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/contentful/contentful-export/pulls/103/commits","review_comments_url":"https://api.github.com/repos/contentful/contentful-export/pulls/103/comments","review_comment_url":"https://api.github.com/repos/contentful/contentful-export/pulls/comments{/number}","comments_url":"https://api.github.com/repos/contentful/contentful-export/issues/103/comments","statuses_url":"https://api.github.com/repos/contentful/contentful-export/statuses/2999562aa941d7721ba7800e48e4761de119490c","head":{"label":"contentful:feat/remove-cli-usage-readme","ref":"feat/remove-cli-usage-readme","sha":"2999562aa941d7721ba7800e48e4761de119490c","user":{"login":"contentful","id":472182,"avatar_url":"https://avatars0.githubusercontent.com/u/472182?v=4","gravatar_id":"","url":"https://api.github.com/users/contentful","html_url":"https://github.com/contentful","followers_url":"https://api.github.com/users/contentful/followers","following_url":"https://api.github.com/users/contentful/following{/other_user}","gists_url":"https://api.github.com/users/contentful/gists{/gist_id}","starred_url":"https://api.github.com/users/contentful/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contentful/subscriptions","organizations_url":"https://api.github.com/users/contentful/orgs","repos_url":"https://api.github.com/users/contentful/repos","events_url":"https://api.github.com/users/contentful/events{/privacy}","received_events_url":"https://api.github.com/users/contentful/received_events","type":"Organization","site_admin":false},"repo":{"id":61539828,"name":"contentful-export","full_name":"contentful/contentful-export","owner":{"login":"contentful","id":472182,"avatar_url":"https://avatars0.githubusercontent.com/u/472182?v=4","gravatar_id":"","url":"https://api.github.com/users/contentful","html_url":"https://github.com/contentful","followers_url":"https://api.github.com/users/contentful/followers","following_url":"https://api.github.com/users/contentful/following{/other_user}","gists_url":"https://api.github.com/users/contentful/gists{/gist_id}","starred_url":"https://api.github.com/users/contentful/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contentful/subscriptions","organizations_url":"https://api.github.com/users/contentful/orgs","repos_url":"https://api.github.com/users/contentful/repos","events_url":"https://api.github.com/users/contentful/events{/privacy}","received_events_url":"https://api.github.com/users/contentful/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/contentful/contentful-export","description":"this tool allows you to export a contentful space to a JSON dump","fork":false,"url":"https://api.github.com/repos/contentful/contentful-export","forks_url":"https://api.github.com/repos/contentful/contentful-export/forks","keys_url":"https://api.github.com/repos/contentful/contentful-export/keys{/key_id}","collaborators_url":"https://api.github.com/repos/contentful/contentful-export/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/contentful/contentful-export/teams","hooks_url":"https://api.github.com/repos/contentful/contentful-export/hooks","issue_events_url":"https://api.github.com/repos/contentful/contentful-export/issues/events{/number}","events_url":"https://api.github.com/repos/contentful/contentful-export/events","assignees_url":"https://api.github.com/repos/contentful/contentful-export/assignees{/user}","branches_url":"https://api.github.com/repos/contentful/contentful-export/branches{/branch}","tags_url":"https://api.github.com/repos/contentful/contentful-export/tags","blobs_url":"https://api.github.com/repos/contentful/contentful-export/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/contentful/contentful-export/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/contentful/contentful-export/git/refs{/sha}","trees_url":"https://api.github.com/repos/contentful/contentful-export/git/trees{/sha}","statuses_url":"https://api.github.com/repos/contentful/contentful-export/statuses/{sha}","languages_url":"https://api.github.com/repos/contentful/contentful-export/languages","stargazers_url":"https://api.github.com/repos/contentful/contentful-export/stargazers","contributors_url":"https://api.github.com/repos/contentful/contentful-export/contributors","subscribers_url":"https://api.github.com/repos/contentful/contentful-export/subscribers","subscription_url":"https://api.github.com/repos/contentful/contentful-export/subscription","commits_url":"https://api.github.com/repos/contentful/contentful-export/commits{/sha}","git_commits_url":"https://api.github.com/repos/contentful/contentful-export/git/commits{/sha}","comments_url":"https://api.github.com/repos/contentful/contentful-export/comments{/number}","issue_comment_url":"https://api.github.com/repos/contentful/contentful-export/issues/comments{/number}","contents_url":"https://api.github.com/repos/contentful/contentful-export/contents/{+path}","compare_url":"https://api.github.com/repos/contentful/contentful-export/compare/{base}...{head}","merges_url":"https://api.github.com/repos/contentful/contentful-export/merges","archive_url":"https://api.github.com/repos/contentful/contentful-export/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/contentful/contentful-export/downloads","issues_url":"https://api.github.com/repos/contentful/contentful-export/issues{/number}","pulls_url":"https://api.github.com/repos/contentful/contentful-export/pulls{/number}","milestones_url":"https://api.github.com/repos/contentful/contentful-export/milestones{/number}","notifications_url":"https://api.github.com/repos/contentful/contentful-export/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/contentful/contentful-export/labels{/name}","releases_url":"https://api.github.com/repos/contentful/contentful-export/releases{/id}","deployments_url":"https://api.github.com/repos/contentful/contentful-export/deployments","created_at":"2016-06-20T10:43:17Z","updated_at":"2018-04-20T06:38:02Z","pushed_at":"2018-04-24T14:05:31Z","git_url":"git://github.com/contentful/contentful-export.git","ssh_url":"git@github.com:contentful/contentful-export.git","clone_url":"https://github.com/contentful/contentful-export.git","svn_url":"https://github.com/contentful/contentful-export","homepage":"","size":334,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":23,"open_issues":4,"watchers":61,"default_branch":"master"}},"base":{"label":"contentful:feat/remove-cli-usage","ref":"feat/remove-cli-usage","sha":"66b1e26d72362d261e1b03b8be1c33d4f645c3ab","user":{"login":"contentful","id":472182,"avatar_url":"https://avatars0.githubusercontent.com/u/472182?v=4","gravatar_id":"","url":"https://api.github.com/users/contentful","html_url":"https://github.com/contentful","followers_url":"https://api.github.com/users/contentful/followers","following_url":"https://api.github.com/users/contentful/following{/other_user}","gists_url":"https://api.github.com/users/contentful/gists{/gist_id}","starred_url":"https://api.github.com/users/contentful/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contentful/subscriptions","organizations_url":"https://api.github.com/users/contentful/orgs","repos_url":"https://api.github.com/users/contentful/repos","events_url":"https://api.github.com/users/contentful/events{/privacy}","received_events_url":"https://api.github.com/users/contentful/received_events","type":"Organization","site_admin":false},"repo":{"id":61539828,"name":"contentful-export","full_name":"contentful/contentful-export","owner":{"login":"contentful","id":472182,"avatar_url":"https://avatars0.githubusercontent.com/u/472182?v=4","gravatar_id":"","url":"https://api.github.com/users/contentful","html_url":"https://github.com/contentful","followers_url":"https://api.github.com/users/contentful/followers","following_url":"https://api.github.com/users/contentful/following{/other_user}","gists_url":"https://api.github.com/users/contentful/gists{/gist_id}","starred_url":"https://api.github.com/users/contentful/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contentful/subscriptions","organizations_url":"https://api.github.com/users/contentful/orgs","repos_url":"https://api.github.com/users/contentful/repos","events_url":"https://api.github.com/users/contentful/events{/privacy}","received_events_url":"https://api.github.com/users/contentful/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/contentful/contentful-export","description":"this tool allows you to export a contentful space to a JSON dump","fork":false,"url":"https://api.github.com/repos/contentful/contentful-export","forks_url":"https://api.github.com/repos/contentful/contentful-export/forks","keys_url":"https://api.github.com/repos/contentful/contentful-export/keys{/key_id}","collaborators_url":"https://api.github.com/repos/contentful/contentful-export/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/contentful/contentful-export/teams","hooks_url":"https://api.github.com/repos/contentful/contentful-export/hooks","issue_events_url":"https://api.github.com/repos/contentful/contentful-export/issues/events{/number}","events_url":"https://api.github.com/repos/contentful/contentful-export/events","assignees_url":"https://api.github.com/repos/contentful/contentful-export/assignees{/user}","branches_url":"https://api.github.com/repos/contentful/contentful-export/branches{/branch}","tags_url":"https://api.github.com/repos/contentful/contentful-export/tags","blobs_url":"https://api.github.com/repos/contentful/contentful-export/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/contentful/contentful-export/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/contentful/contentful-export/git/refs{/sha}","trees_url":"https://api.github.com/repos/contentful/contentful-export/git/trees{/sha}","statuses_url":"https://api.github.com/repos/contentful/contentful-export/statuses/{sha}","languages_url":"https://api.github.com/repos/contentful/contentful-export/languages","stargazers_url":"https://api.github.com/repos/contentful/contentful-export/stargazers","contributors_url":"https://api.github.com/repos/contentful/contentful-export/contributors","subscribers_url":"https://api.github.com/repos/contentful/contentful-export/subscribers","subscription_url":"https://api.github.com/repos/contentful/contentful-export/subscription","commits_url":"https://api.github.com/repos/contentful/contentful-export/commits{/sha}","git_commits_url":"https://api.github.com/repos/contentful/contentful-export/git/commits{/sha}","comments_url":"https://api.github.com/repos/contentful/contentful-export/comments{/number}","issue_comment_url":"https://api.github.com/repos/contentful/contentful-export/issues/comments{/number}","contents_url":"https://api.github.com/repos/contentful/contentful-export/contents/{+path}","compare_url":"https://api.github.com/repos/contentful/contentful-export/compare/{base}...{head}","merges_url":"https://api.github.com/repos/contentful/contentful-export/merges","archive_url":"https://api.github.com/repos/contentful/contentful-export/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/contentful/contentful-export/downloads","issues_url":"https://api.github.com/repos/contentful/contentful-export/issues{/number}","pulls_url":"https://api.github.com/repos/contentful/contentful-export/pulls{/number}","milestones_url":"https://api.github.com/repos/contentful/contentful-export/milestones{/number}","notifications_url":"https://api.github.com/repos/contentful/contentful-export/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/contentful/contentful-export/labels{/name}","releases_url":"https://api.github.com/repos/contentful/contentful-export/releases{/id}","deployments_url":"https://api.github.com/repos/contentful/contentful-export/deployments","created_at":"2016-06-20T10:43:17Z","updated_at":"2018-04-20T06:38:02Z","pushed_at":"2018-04-24T14:05:31Z","git_url":"git://github.com/contentful/contentful-export.git","ssh_url":"git@github.com:contentful/contentful-export.git","clone_url":"https://github.com/contentful/contentful-export.git","svn_url":"https://github.com/contentful/contentful-export","homepage":"","size":334,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":23,"open_issues":4,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/contentful/contentful-export/pulls/103"},"html":{"href":"https://github.com/contentful/contentful-export/pull/103"},"issue":{"href":"https://api.github.com/repos/contentful/contentful-export/issues/103"},"comments":{"href":"https://api.github.com/repos/contentful/contentful-export/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/contentful/contentful-export/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/contentful/contentful-export/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/contentful/contentful-export/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/contentful/contentful-export/statuses/2999562aa941d7721ba7800e48e4761de119490c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"loudmouth"}}