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 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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
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.
kosmo integrations:call storyblok.storyblok_list_stories '{"page":1,"per_page":1,"search":"example_search","sort_by":"example_sort_by"}' --json 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.
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 - Parameters
- page, per_page, search, sort_by
kosmo integrations:call storyblok.storyblok_list_stories '{"page":1,"per_page":1,"search":"example_search","sort_by":"example_sort_by"}' --json 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 - Parameters
- id
kosmo integrations:call storyblok.storyblok_get_story '{"id":1}' --json 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 - Parameters
- name, slug, content, parent_id, is_startpage, tag_list
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 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 - Parameters
- id, content, name, slug, tag_list
kosmo integrations:call storyblok.storyblok_update_story '{"id":1,"content":"example_content","name":"example_name","slug":"example_slug","tag_list":"example_tag_list"}' --json 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 - Parameters
- id
kosmo integrations:call storyblok.storyblok_delete_story '{"id":1}' --json 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 - Parameters
- none
kosmo integrations:call storyblok.storyblok_list_components '{}' --json 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 - Parameters
- none
kosmo integrations:call storyblok.storyblok_get_current_user '{}' --json 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
kosmo integrations:schema storyblok.storyblok_list_stories --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema storyblok.storyblok_get_story --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The numeric ID of the story to retrieve. |
storyblok.storyblok_create_story 6 parameters
kosmo integrations:schema storyblok.storyblok_create_story --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema storyblok.storyblok_update_story --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema storyblok.storyblok_delete_story --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The numeric ID of the story to delete. |
storyblok.storyblok_list_components 0 parameters
kosmo integrations:schema storyblok.storyblok_list_components --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
storyblok.storyblok_get_current_user 0 parameters
kosmo integrations:schema storyblok.storyblok_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.