Utility Commands
Discover, migrations, init, and debug command reference; copy has its own page.
Utility commands
This page covers commands that do not fit the main sync/migrate/backup groups.
copy
The copy family — copy space, copy stories, copy assets, copy relink
and copy manifests — has its own page: copy. The
end-to-end workflow is in Copy a space.
discover
Components
sb-mig discover components --all
sb-mig discover components --all --write
sb-mig discover components --all --write --file all-components| Flag | Type | Effect |
|---|---|---|
--all | boolean | Discover all local and external component schema files. |
--write | boolean | Write discovered component names to a local file. |
--file | string | Output file name when --write is passed. |
Without --write, the command prints discovered component metadata. With
--write, it creates or overwrites the component list file.
Migrations
sb-mig discover migrations --allPrints discovered migration config filenames. This command is read-only.
migrations recognize
sb-mig migrations recognize --from 3.4.0
sb-mig migrations recognize --from 3.4.0 --to 4.0.0This command is specific to Backpack upgrade flows. It compares a previous
Backpack version with a target version and prints recommended migrate content
and migrate presets commands.
| Flag | Type | Effect |
|---|---|---|
--from | string | Previous package version. Required. |
--to | string | Target package version. Optional. Falls back to installed @ef-global/backpack dependency version from package.json. |
The command reads applied-backpack-migrations.json when present and reads
package.json when --to is omitted. It does not call Storyblok and does not
write files.
init project
sb-mig init project \
--spaceId 12345 \
--oauthToken xxx \
--region eu
sb-mig init project \
--spaceId 12345 \
--oauthToken xxx \
--region us \
--gtmToken GTM-XXXXinit project creates a local .env and updates the Storyblok space preview
domain.
| Flag | Type | Effect |
|---|---|---|
--spaceId | string | Storyblok space ID. Required. |
--oauthToken | string | Management API OAuth token. Required. |
--region | eu, us, or cn | Storyblok region. Required. |
--gtmToken | string | Optional Google Tag Manager token. Defaults to put-your-gtm-token-here. |
The generated .env includes region URLs, access token, OAuth token, preview
secret, space ID, translation strategy, and GTM ID. The preview domain is set to
https://localhost:3000/api/preview/preview?secret=<secret>&slug=.
debug
sb-mig debugPrints resolved Storyblok config, sb-mig version, dependency versions, the
consumer @ef-global/backpack version when available, and whether the consumer
package is ESM or CommonJS. It reads local config and package metadata only.
sb-mig