KosmoKrator

data

Storyblok CLI for AI Agents

Use the Storyblok CLI from KosmoKrator to call Storyblok tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 4 read 3 write Bearer token auth

Storyblok CLI Setup

Storyblok can be configured headlessly with `kosmokrator integrations:configure storyblok`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure storyblok --set access_token="$STORYBLOK_ACCESS_TOKEN" --set space_id="$STORYBLOK_SPACE_ID" --enable --read allow --write ask --json
kosmokrator integrations:doctor storyblok --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token STORYBLOK_ACCESS_TOKEN Secret secret yes Access Token
space_id STORYBLOK_SPACE_ID Text text yes Space ID
url STORYBLOK_URL URL url no API Base URL

Call Storyblok Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call storyblok.storyblok_list_stories '{
  "page": 1,
  "per_page": 1,
  "search": "example_search",
  "sort_by": "example_sort_by"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:storyblok storyblok_list_stories '{
  "page": 1,
  "per_page": 1,
  "search": "example_search",
  "sort_by": "example_sort_by"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs storyblok --json
kosmo integrations:docs storyblok.storyblok_list_stories --json
kosmo integrations:schema storyblok.storyblok_list_stories --json
kosmo integrations:search "Storyblok" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Storyblok.

storyblok.storyblok_list_stories

Read read

List stories in the configured Storyblok space. Supports pagination, search, and sorting.

Parameters
page, per_page, search, sort_by

Generic CLI call

kosmo integrations:call storyblok.storyblok_list_stories '{"page":1,"per_page":1,"search":"example_search","sort_by":"example_sort_by"}' --json

Provider shortcut

kosmo integrations:storyblok storyblok_list_stories '{"page":1,"per_page":1,"search":"example_search","sort_by":"example_sort_by"}' --json

storyblok.storyblok_get_story

Read read

Retrieve a single Storyblok story by its numeric ID, including full content.

Parameters
id

Generic CLI call

kosmo integrations:call storyblok.storyblok_get_story '{"id":1}' --json

Provider shortcut

kosmo integrations:storyblok storyblok_get_story '{"id":1}' --json

storyblok.storyblok_create_story

Write write

Create a new story in the configured Storyblok space. Requires a name, slug, and content object.

Parameters
name, slug, content, parent_id, is_startpage, tag_list

Generic CLI call

kosmo integrations:call storyblok.storyblok_create_story '{"name":"example_name","slug":"example_slug","content":"example_content","parent_id":1,"is_startpage":true,"tag_list":"example_tag_list"}' --json

Provider shortcut

kosmo integrations:storyblok storyblok_create_story '{"name":"example_name","slug":"example_slug","content":"example_content","parent_id":1,"is_startpage":true,"tag_list":"example_tag_list"}' --json

storyblok.storyblok_update_story

Write write

Update an existing Storyblok story. Provide the story ID and the fields to update (e.g., content, name, slug).

Parameters
id, content, name, slug, tag_list

Generic CLI call

kosmo integrations:call storyblok.storyblok_update_story '{"id":1,"content":"example_content","name":"example_name","slug":"example_slug","tag_list":"example_tag_list"}' --json

Provider shortcut

kosmo integrations:storyblok storyblok_update_story '{"id":1,"content":"example_content","name":"example_name","slug":"example_slug","tag_list":"example_tag_list"}' --json

storyblok.storyblok_delete_story

Write write

Delete a story from the configured Storyblok space by its numeric ID. This action is irreversible.

Parameters
id

Generic CLI call

kosmo integrations:call storyblok.storyblok_delete_story '{"id":1}' --json

Provider shortcut

kosmo integrations:storyblok storyblok_delete_story '{"id":1}' --json

storyblok.storyblok_list_components

Read read

List all component schemas defined in the configured Storyblok space. Useful for understanding available content structures.

Parameters
none

Generic CLI call

kosmo integrations:call storyblok.storyblok_list_components '{}' --json

Provider shortcut

kosmo integrations:storyblok storyblok_list_components '{}' --json

storyblok.storyblok_get_current_user

Read read

List all available Storyblok spaces for the authenticated user. Useful as a health check or to discover space IDs.

Parameters
none

Generic CLI call

kosmo integrations:call storyblok.storyblok_get_current_user '{}' --json

Provider shortcut

kosmo integrations:storyblok storyblok_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

storyblok.storyblok_list_stories

List stories in the configured Storyblok space. Supports pagination, search, and sorting.

Operation
Read read
Schema command
kosmo integrations:schema storyblok.storyblok_list_stories --json
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of stories per page (default: 25, max: 100).
search string no Search term to filter stories by name or slug.
sort_by string no Sort field (e.g., "name:asc", "created_at:desc", "updated_at:desc").

storyblok.storyblok_get_story

Retrieve a single Storyblok story by its numeric ID, including full content.

Operation
Read read
Schema command
kosmo integrations:schema storyblok.storyblok_get_story --json
ParameterTypeRequiredDescription
id integer yes The numeric ID of the story to retrieve.

storyblok.storyblok_create_story

Create a new story in the configured Storyblok space. Requires a name, slug, and content object.

Operation
Write write
Schema command
kosmo integrations:schema storyblok.storyblok_create_story --json
ParameterTypeRequiredDescription
name string yes The display name of the story.
slug string yes URL-friendly slug for the story (e.g., "my-new-page").
content object yes The story content as a JSON object. Must match a component schema in the space (e.g., {"component": "page", "title": "Hello"}).
parent_id integer no The numeric ID of the parent story (for nested stories).
is_startpage boolean no Whether this is the root/start page of the space (default: false).
tag_list array no List of tags to assign to the story.

storyblok.storyblok_update_story

Update an existing Storyblok story. Provide the story ID and the fields to update (e.g., content, name, slug).

Operation
Write write
Schema command
kosmo integrations:schema storyblok.storyblok_update_story --json
ParameterTypeRequiredDescription
id integer yes The numeric ID of the story to update.
content object no Updated story content as a JSON object.
name string no Updated display name of the story.
slug string no Updated URL slug for the story.
tag_list array no Updated list of tags.

storyblok.storyblok_delete_story

Delete a story from the configured Storyblok space by its numeric ID. This action is irreversible.

Operation
Write write
Schema command
kosmo integrations:schema storyblok.storyblok_delete_story --json
ParameterTypeRequiredDescription
id integer yes The numeric ID of the story to delete.

storyblok.storyblok_list_components

List all component schemas defined in the configured Storyblok space. Useful for understanding available content structures.

Operation
Read read
Schema command
kosmo integrations:schema storyblok.storyblok_list_components --json
ParameterTypeRequiredDescription
No parameters.

storyblok.storyblok_get_current_user

List all available Storyblok spaces for the authenticated user. Useful as a health check or to discover space IDs.

Operation
Read read
Schema command
kosmo integrations:schema storyblok.storyblok_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.