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
Section titled “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 pullanddatasources push. - Any flags used with
components pullprior (such as--suffixor--separate-files) need to be applied with the same values when pushing to ensure the files are found correctly.
storyblok components push [arguments] [flags]Arguments
Section titled “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. |
| 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>. |
Selective push
Section titled “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.
Examples
Section titled “Examples”The following examples assume that a space has been defined in a configuration file.
# Push all components to a spacestoryblok components push --from 654321# Push a single component to a spacestoryblok components push hero-section --from 654321# Push all components to a space, reading each from a separate file with a custom suffixstoryblok components push --from 654321 --separate-files --suffix dev# Push all components to a space, filtering by component namestoryblok 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 tagstoryblok components push --tag betaWas this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window).Terms of Service (opens in a new window) apply.
Get in touch with the Storyblok community