Skip to content

storyblok (CLI)

The storyblok CLI enables developers to manage spaces via the Management API with tools for migrations, components, and schema type generation.

  • Node.js LTS (version 22.x or higher is recommended)

Install the CLI globally by running the following command:

Terminal window
npm install -g storyblok@latest
Terminal window
storyblok [command] [subcommand] [options]

A complete example illustrating the package’s functionalities: pulling components from a space and storing them locally in separate files, enabling developers to edit the schemas.

Terminal window
storyblok components pull --space 12345 --separate-files

This command will fetch all components and their dependencies (folders, tags, whitelists) from the space 12345, generating the following folder structure on your root:

<project_root>
.storyblok/
└── components/
└── 12345/
├── COMPONENT_NAME.json # Single component
├── groups.json # Component groups
├── COMPONENT_NAME.presets.json # Component presets
└── tags.json # Component tags

From this point the user can modify the schemas locally, add them to version control and push them to a space.

CommandDescription
loginAuthenticate via email or token. Credentials stored in ~/.storyblok/credentials.json.
createScaffolds a new project using Storyblok with the preferred technology stack.
userRetrieve the current authenticated user details.
languages pullFetch the languages configured for the space’s Internationalization.
components pullFetch available components and their dependencies (Folders, Tags, Whitelists) from a space.
components pushPush local components to a space.
datasources pullFetch available datasources and their entries.
datasources pushPush local datasources to a space.
datasources deleteDelete a datasource.
migrations generateCreate a migration file for a specific component in a space.
migrations runExecute migrations for stories in a space.
migrations rollbackRevert migrations previously applied to stories within a space.
types generateGenerate TypeScript declaration files (.d.ts) based on Storyblok component schemas.
signupOpen the Storyblok signup page in the browser to create a new user account.
logoutLog out of a Storyblok account and remove stored credentials.
FlagDescriptionDefault
-v, --verboseEnable verbose output for debugging and error reporting.false
-s, --spaceTarget’s space ID. Available only for space operations.
-p, --pathPath to store and read resources from. Available only for operations that generate local artifacts..storyblok