Skip to content

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.

  • 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.
Terminal window
storyblok components push [arguments] [flags]
Argument Type Description
Component name string Optional. The technical name of a single component to push. If not provided, all components will be pushed.
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>.

--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.

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

Terminal window
# 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

Was this page helpful?

What went wrong?

This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window).Terms of Service (opens in a new window) apply.