---
title: components push
description: Pushes component schemas, component groups, component presets, component tags, component whitelists, and datasources (excluding datasource entries) from a local directory to a Storyblok space.
url: https://www.storyblok.com/docs/tooling/cli/components-push
---

# components push

Pushes component schemas, component groups, component presets, component tags, component whitelists, and datasources (excluding datasource entries) from a local directory to a Storyblok space.

## Prerequisites

-   The command expects schemas that have previously been pulled from a space using `components pull`.
-   For components with fields that depend on datasources, first pull the datasources from the origin space and push them to the target space using `datasources pull` and `datasources push`.
-   Any flags used with `components pull` prior (such as `--suffix` or `--separate-files`) need to be applied with the same values when pushing to ensure the files are found correctly.

## Usage

```bash
storyblok components push [arguments] [flags]
```

## Arguments

| Argument | Type | Description |
| --- | --- | --- |
| Component name | string | _Optional._ The technical name of a single component to push. If not provided, all components will be pushed. |

## Flags

| Flag | Type | Description |
| --- | --- | --- |
| `--space` | integer | _Required._ The ID of the Storyblok space to push components to. |
| `--from`, `-f` | integer | _Optional._ The ID of the source space from which the components were originally pulled. If not provided, the origin space equals the target space specified via `--space`. |
| `--filter`, `-fi` | string | _Optional._ Glob pattern to select components by name (for example, `hero*` matches all components whose name starts with `hero`). |
| `--group`, `-gr` | string | _Optional._ Select components assigned to a component group, by name (for example, `Checkout`) or by a slash-separated path of nested group names (for example, `Checkout/Payment`) to disambiguate. Repeatable; includes descendant groups. |
| `--tag`, `-tg` | string | _Optional._ Select components carrying a tag. Repeatable and comma-separated. |
| `--separate-files`, `-sf` | boolean | _Optional._ Read components from individual files, rather than a consolidated `components.json` file. |
| `--suffix`, `-su` | string | _Optional._ Specify a custom suffix for component files. |
| `--path`, `-p` | string | _Optional._ Specify a custom path for component files. Defaults to `.storyblok/components/<space-id>`. |

> [!TIP]
> To sync components between spaces, `pull` them from the origin space and then `push` them with `--space` set to the target space and `--from` set to the origin space.

## Selective push

`--filter`, `--group`, and `--tag` mirror the selectors on `components pull` and choose which locally stored components to push, rather than pushing the whole file. They combine the same way: multiple values for one selector with OR, different selectors with AND. A pushed component always carries its dependencies (assigned groups with ancestors, assigned tags, presets, and whitelisted groups and tags), but not the sibling components referenced through a component whitelist.

> [!NOTE]
> Behavior change: previously, `components push --filter` also pushed the sibling components referenced through a component whitelist. It no longer does. A component whitelist references its siblings by name, so the reference resolves on its own once a component of that name exists in the target space, and the siblings are not required for a valid push. To push those components too, include them in your selector.

## Examples

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

```bash
# Push all components to a space
storyblok components push --from 654321
# Push a single component to a space
storyblok components push hero-section --from 654321
# Push all components to a space, reading each from a separate file with a custom suffix
storyblok components push --from 654321 --separate-files --suffix dev
# Push all components to a space, filtering by component name
storyblok components push --filter "hero-*"
# Push only components in the Checkout group (and its nested groups)
storyblok components push --group Checkout
# Push only components carrying the beta tag
storyblok components push --tag beta
```

## Pagination

-   [Previous: components pull](/docs/tooling/cli/components-pull)
-   [Next: create](/docs/tooling/cli/create)
