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.

Storyblok CLI Setup

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

Install, configure, and verify
# 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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

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

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

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

Discovery

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

Discovery commands
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

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

storyblok.storyblok_list_stories

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

Read read
Parameters
page, per_page, search, sort_by
Generic call
kosmo integrations:call storyblok.storyblok_list_stories '{"page":1,"per_page":1,"search":"example_search","sort_by":"example_sort_by"}' --json
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

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

Read read
Parameters
id
Generic call
kosmo integrations:call storyblok.storyblok_get_story '{"id":1}' --json
Shortcut
kosmo integrations:storyblok storyblok_get_story '{"id":1}' --json

storyblok.storyblok_create_story

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

Write write
Parameters
name, slug, content, parent_id, is_startpage, tag_list
Generic 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
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

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

Write write
Parameters
id, content, name, slug, tag_list
Generic 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
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

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

Write write
Parameters
id
Generic call
kosmo integrations:call storyblok.storyblok_delete_story '{"id":1}' --json
Shortcut
kosmo integrations:storyblok storyblok_delete_story '{"id":1}' --json

storyblok.storyblok_list_components

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

Read read
Parameters
none
Generic call
kosmo integrations:call storyblok.storyblok_list_components '{}' --json
Shortcut
kosmo integrations:storyblok storyblok_list_components '{}' --json

storyblok.storyblok_get_current_user

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

Read read
Parameters
none
Generic call
kosmo integrations:call storyblok.storyblok_get_current_user '{}' --json
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 4 parameters
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 1 parameters
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 6 parameters
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 5 parameters
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 1 parameters
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 0 parameters
Schema command
kosmo integrations:schema storyblok.storyblok_list_components --json
ParameterTypeRequiredDescription
No parameters.
storyblok.storyblok_get_current_user 0 parameters
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.