KosmoKrator

other

Strapi CLI for AI Agents

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

7 functions 4 read 3 write API token auth

Strapi CLI Setup

Strapi can be configured headlessly with `kosmokrator integrations:configure strapi`.

# 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 strapi --set api_token="$STRAPI_API_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor strapi --json
kosmokrator integrations:status --json

Credentials

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

KeyEnv varTypeRequiredLabel
api_token STRAPI_API_TOKEN Secret secret yes API Token
url STRAPI_URL URL url no Strapi URL

Call Strapi Headlessly

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

kosmo integrations:call strapi.strapi_list_entries '{
  "content_type": "example_content_type",
  "page": 1,
  "page_size": 1,
  "sort": "example_sort",
  "populate": "example_populate"
}' --json

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

kosmo integrations:strapi strapi_list_entries '{
  "content_type": "example_content_type",
  "page": 1,
  "page_size": 1,
  "sort": "example_sort",
  "populate": "example_populate"
}' --json

Agent Discovery Commands

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

kosmo integrations:docs strapi --json
kosmo integrations:docs strapi.strapi_list_entries --json
kosmo integrations:schema strapi.strapi_list_entries --json
kosmo integrations:search "Strapi" --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 Strapi.

strapi.strapi_list_entries

Read read

List entries for a content type in Strapi. Supports pagination, sorting, and field population (relations, media, components).

Parameters
content_type, page, page_size, sort, populate

Generic CLI call

kosmo integrations:call strapi.strapi_list_entries '{"content_type":"example_content_type","page":1,"page_size":1,"sort":"example_sort","populate":"example_populate"}' --json

Provider shortcut

kosmo integrations:strapi strapi_list_entries '{"content_type":"example_content_type","page":1,"page_size":1,"sort":"example_sort","populate":"example_populate"}' --json

strapi.strapi_get_entry

Read read

Get a single entry from Strapi by content type and ID. Supports population of relations and media.

Parameters
content_type, id, populate

Generic CLI call

kosmo integrations:call strapi.strapi_get_entry '{"content_type":"example_content_type","id":1,"populate":"example_populate"}' --json

Provider shortcut

kosmo integrations:strapi strapi_get_entry '{"content_type":"example_content_type","id":1,"populate":"example_populate"}' --json

strapi.strapi_create_entry

Write write

Create a new entry in Strapi for a given content type. The data is automatically wrapped in the required "data" envelope.

Parameters
content_type, data

Generic CLI call

kosmo integrations:call strapi.strapi_create_entry '{"content_type":"example_content_type","data":"example_data"}' --json

Provider shortcut

kosmo integrations:strapi strapi_create_entry '{"content_type":"example_content_type","data":"example_data"}' --json

strapi.strapi_update_entry

Write write

Update an existing entry in Strapi by content type and ID. The data is automatically wrapped in the required "data" envelope.

Parameters
content_type, id, data

Generic CLI call

kosmo integrations:call strapi.strapi_update_entry '{"content_type":"example_content_type","id":1,"data":"example_data"}' --json

Provider shortcut

kosmo integrations:strapi strapi_update_entry '{"content_type":"example_content_type","id":1,"data":"example_data"}' --json

strapi.strapi_delete_entry

Write write

Delete an entry from Strapi by content type and ID. This action is permanent.

Parameters
content_type, id

Generic CLI call

kosmo integrations:call strapi.strapi_delete_entry '{"content_type":"example_content_type","id":1}' --json

Provider shortcut

kosmo integrations:strapi strapi_delete_entry '{"content_type":"example_content_type","id":1}' --json

strapi.strapi_list_content_types

Read read

List all content types defined in the Strapi Content-Type Builder. Returns API IDs, display names, and schema information.

Parameters
none

Generic CLI call

kosmo integrations:call strapi.strapi_list_content_types '{}' --json

Provider shortcut

kosmo integrations:strapi strapi_list_content_types '{}' --json

strapi.strapi_get_current_user

Read read

Get the currently authenticated Strapi user. Useful for verifying the API token and checking permissions.

Parameters
none

Generic CLI call

kosmo integrations:call strapi.strapi_get_current_user '{}' --json

Provider shortcut

kosmo integrations:strapi strapi_get_current_user '{}' --json

Function Schemas

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

strapi.strapi_list_entries

List entries for a content type in Strapi. Supports pagination, sorting, and field population (relations, media, components).

Operation
Read read
Schema command
kosmo integrations:schema strapi.strapi_list_entries --json
ParameterTypeRequiredDescription
content_type string yes The API ID of the content type (e.g., "article", "page", "product").
page integer no Page number for pagination (default: 1).
page_size integer no Number of entries per page (default: 25).
sort string no Sort field and direction (e.g., "createdAt:desc", "title:asc").
populate string no Relations to populate. Use "*" for all, or a specific field name (e.g., "author", "image").

strapi.strapi_get_entry

Get a single entry from Strapi by content type and ID. Supports population of relations and media.

Operation
Read read
Schema command
kosmo integrations:schema strapi.strapi_get_entry --json
ParameterTypeRequiredDescription
content_type string yes The API ID of the content type (e.g., "article", "page", "product").
id integer yes The entry ID.
populate string no Relations to populate. Use "*" for all, or a specific field name (e.g., "author", "image").

strapi.strapi_create_entry

Create a new entry in Strapi for a given content type. The data is automatically wrapped in the required "data" envelope.

Operation
Write write
Schema command
kosmo integrations:schema strapi.strapi_create_entry --json
ParameterTypeRequiredDescription
content_type string yes The API ID of the content type (e.g., "article", "page", "product").
data object yes The entry data as a JSON object. Fields depend on the content type (e.g., {"title": "Hello", "body": "World"}).

strapi.strapi_update_entry

Update an existing entry in Strapi by content type and ID. The data is automatically wrapped in the required "data" envelope.

Operation
Write write
Schema command
kosmo integrations:schema strapi.strapi_update_entry --json
ParameterTypeRequiredDescription
content_type string yes The API ID of the content type (e.g., "article", "page", "product").
id integer yes The entry ID to update.
data object yes The fields to update as a JSON object (e.g., {"title": "Updated Title"}).

strapi.strapi_delete_entry

Delete an entry from Strapi by content type and ID. This action is permanent.

Operation
Write write
Schema command
kosmo integrations:schema strapi.strapi_delete_entry --json
ParameterTypeRequiredDescription
content_type string yes The API ID of the content type (e.g., "article", "page", "product").
id integer yes The entry ID to delete.

strapi.strapi_list_content_types

List all content types defined in the Strapi Content-Type Builder. Returns API IDs, display names, and schema information.

Operation
Read read
Schema command
kosmo integrations:schema strapi.strapi_list_content_types --json
ParameterTypeRequiredDescription
No parameters.

strapi.strapi_get_current_user

Get the currently authenticated Strapi user. Useful for verifying the API token and checking permissions.

Operation
Read read
Schema command
kosmo integrations:schema strapi.strapi_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.