---
title: datasources pull
description: Downloads datasources and their entries from a Storyblok space, recursively creates a folder structure if it doesn't exist, and saves them to a local directory.
url: https://www.storyblok.com/docs/tooling/cli/datasources-pull
---

# datasources pull

Downloads datasources and their entries from a Storyblok space, recursively creates a folder structure if it doesn’t exist, and saves them to a local directory.

The command saves to the following folder structure and recursively creates it if it doesn’t exist yet.

```plaintext
.storyblok/
└── datasources/
    └── <space-id>/
        ├── <datasource-name>.json
```

## Usage

```bash
storyblok datasources pull [flags]
```

## Flags

| Flag | Type | Description |
| --- | --- | --- |
| `--space` | integer | _Required._ The ID of the Storyblok space to pull datasources from. |
| `--filename`, `-f` | string | _Optional._ Specify a custom filename. Defaults to `datasources.json`. Ignored when `--separate-files` is used. |
| `--separate-files`, `-sf` | boolean | _Optional._ Save each datasource to a separate file. |
| `--suffix`, `-su` | string | _Optional._ Specify a custom suffix for datasource files. |
| `--path`, `-p` | string | _Optional._ Specify a custom path for datasource files. Defaults to `.storyblok/datasources/<space-id>`. |

## Examples

The following examples assume that a `space` has been defined in a configuration file.

```bash
# Pull all datasources from a space
storyblok datasources pull
# Pull all datasources from a space, saving each to a separate file with a custom suffix
storyblok datasources pull --separate-files --suffix dev
# Pull all datasources from a space, saving with a custom filename
storyblok datasources pull --filename my-datasources
```

## Pagination

-   [Previous: datasources delete](/docs/tooling/cli/datasources-delete)
-   [Next: datasources push](/docs/tooling/cli/datasources-push)
