Registry / devops / storyblok

storyblok

JSON →
library0.1.2jsnpmunverified

The Storyblok CLI (Command Line Interface) is a powerful development tool designed to enhance the developer experience for projects integrating with the Storyblok Headless CMS. It provides a robust set of features for managing Storyblok spaces directly from the terminal, including generating TypeScript type definitions for components to ensure type safety in frontend applications. The current stable version is 4.16.9, released very recently, indicating an active development and release cadence, often as part of a monorepo that includes various Storyblok SDKs. Key differentiators include its comprehensive component management capabilities (pulling, pushing schemas, groups, presets, tags), a flexible migration system for content updates, secure authentication across regions, and advanced filtering options. It focuses on improving workflow efficiency with features like organized file structures, customizable paths, and a dry run mode for migrations.

npm install storyblok
INSTALL
IMPORT
SIG · STORYBLOK
S
storyblok
devopsjavascriptv0.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

storyblok
storyblok <command> [options]
import { storyblok } from 'storyblok'
The primary way to interact with this package is via its CLI. After global installation (`npm install -g storyblok`), the `storyblok` command is available in the terminal.
npx storyblok
npx storyblok <command> [options]
require('storyblok')().run()
Using `npx` allows running the Storyblok CLI without a global installation, ensuring you use the latest available version or a specified one for one-off tasks or CI/CD pipelines.
Generated Component Types
import { MyComponentType } from './.storyblok/components'
import { MyComponentType } from 'storyblok'
The Storyblok CLI generates TypeScript type definitions for your Storyblok components into a configurable local path (e.g., `.storyblok/components`). These types are then imported into your frontend project, not directly from the `storyblok` npm package itself.

This quickstart demonstrates how to install the Storyblok CLI globally, log in, pull component schemas, generate TypeScript types, and run a basic content migration with a dry run.

npm install -g storyblok storyblok login # Follow the prompts to enter your personal access token # Pull all component schemas from your space storyblok pull-components --space=<YOUR_SPACE_ID> --path=./src/storyblok/components # Generate TypeScript types for your components storyblok generate-types --path=./src/storyblok/types.d.ts # Run a simple migration (example: rename a field) # First, create a migration file, e.g., 'storyblok/migrations/001-rename-field.js' // storyblok/migrations/001-rename-field.js module.exports = { up: async (api) => { console.log('Running migration: Rename old_field to new_field'); // Example: Find a component and rename a field // await api.put('spaces/YOUR_SPACE_ID/components/COMPONENT_ID', { component: { schema: { new_field: { type: 'text' } } } }); }, down: async (api) => {}, }; storyblok migrate --space=<YOUR_SPACE_ID> --path=./storyblok/migrations --dry-run storyblok migrate --space=<YOUR_SPACE_ID> --path=./storyblok/migrations
storyblok --version
Debug
Known issues
breakingNode.js 18.0.0 or higher is required. Older versions may lead to installation failures or runtime errors.
fix
Upgrade your Node.js environment to version 18.0.0 or later using a tool like nvm or by downloading the latest LTS from nodejs.org.
affects: <=4.x
gotchaA Storyblok Personal Access Token is mandatory for authentication. Without it, most CLI commands interacting with your space will fail.
fix
Generate a Personal Access Token from your Storyblok account settings (https://app.storyblok.com/#/me/account?tab=token) and use `storyblok login` to authenticate before running commands.
affects: >=1.0.0
gotchaBe cautious when using commands like `storyblok push-components` or `storyblok migrate` on production spaces. Always use `--dry-run` first for migrations, and consider version control for component schemas.
fix
For destructive operations, always use `--dry-run` to preview changes and test on staging environments before applying to production. Implement a robust CI/CD pipeline that includes schema and content backups.
affects: >=1.0.0
gotchaPath resolution for component and migration files can be tricky. Ensure the `--path` option is correctly specified relative to your current working directory or as an absolute path.
fix
Since v4.16.9, path resolution has been improved, but always double-check your `--path` argument. Use absolute paths for clarity or ensure the relative path is correct from where you execute the CLI command.
affects: <4.16.9
Errors
Common errors & fixes
command not found: storyblok
The Storyblok CLI package has not been installed globally or is not in your system's PATH.
fix
Install the CLI globally using `npm install -g storyblok` or execute commands using `npx storyblok <command>`.
Unauthorized: Please login first.
The CLI requires authentication to interact with your Storyblok space, and you have not logged in or your session has expired.
fix
Run `storyblok login` and provide your Storyblok Personal Access Token to authenticate your CLI session.
Error: Minimum Node.js version 18.0.0 is required.
Your current Node.js version is older than the minimum requirement for the Storyblok CLI.
fix
Update Node.js to version 18.0.0 or higher. Use `nvm install 18 && nvm use 18` or download the latest LTS version from nodejs.org.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
42 hits · last 30 days
node
40
OpenAI (training)
1
Resources
storyblok — npm install storyblok · libregistry