storyblok-cli
Storyblok CLI storyblok
is the official command-line interface for interacting with Storyblok's Management API. It provides tools to:
- Fetch and push components between spaces
- Generate and run content migrations
- Generate types from your component's schemas.
Requirements
- Node.js LTS (version 22.x or higher is recommended)
Installation
Install the CLI globally by running the following command:
npm install -g storyblok@latest
Usage
storyblok [command] [subcommand] [options]
Run storyblok --help
to see available commands.
Example
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.
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:
.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.
Commands
Command | Description |
---|---|
| Authenticate via email or token. Credentials stored in |
| Retrieve the current authenticated user details. |
| Fetch the languages configured for the space's Internationalization. |
| Fetch available components and their dependencies (Folders, Tags, Whitelists) from a space. |
| Push local components to a space. |
| Create a migration file for a specific component in your Storyblok space. |
| Execute migrations on stories in your Storyblok space. |
| Reverts migrations that were previously applied to stories in your Storyblok space. |
| Generate TypeScript's declaration files (d.ts) based on your Storyblok component schemas. |
| Opens the Storyblok signup page in your browser, allowing the user to create a new account. |
| Securely log out from your Storyblok account and remove stored credentials. |
Global options
Flag | Description | Default |
---|---|---|
| Enable verbose output for debugging and error reporting. |
|
| Target's space ID. Available only for space operations. | |
| Path to store and read resources from. Available only for operations that generate local artifacts. |
|
Please refer to the project's README for detailed documentation of the API and usage of each command.
Stoyblok CLI command documentation Opens in new tab