data
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.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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_token | STRAPI_API_TOKEN | Secret secret | yes | API Token |
url | STRAPI_URL | URL url | no | Strapi URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call strapi.strapi_list_entries '{"content_type":"example_content_type","page":1,"page_size":1,"sort":"example_sort","populate":"example_populate"}' --json kosmo integrations:strapi strapi_list_entries '{"content_type":"example_content_type","page":1,"page_size":1,"sort":"example_sort","populate":"example_populate"}' --json Discovery
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 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.
strapi.strapi_list_entries
List entries for a content type in Strapi. Supports pagination, sorting, and field population (relations, media, components).
read - Parameters
- content_type, page, page_size, sort, populate
kosmo integrations:call strapi.strapi_list_entries '{"content_type":"example_content_type","page":1,"page_size":1,"sort":"example_sort","populate":"example_populate"}' --json 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
Get a single entry from Strapi by content type and ID. Supports population of relations and media.
read - Parameters
- content_type, id, populate
kosmo integrations:call strapi.strapi_get_entry '{"content_type":"example_content_type","id":1,"populate":"example_populate"}' --json kosmo integrations:strapi strapi_get_entry '{"content_type":"example_content_type","id":1,"populate":"example_populate"}' --json 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.
write - Parameters
- content_type, data
kosmo integrations:call strapi.strapi_create_entry '{"content_type":"example_content_type","data":"example_data"}' --json kosmo integrations:strapi strapi_create_entry '{"content_type":"example_content_type","data":"example_data"}' --json 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.
write - Parameters
- content_type, id, data
kosmo integrations:call strapi.strapi_update_entry '{"content_type":"example_content_type","id":1,"data":"example_data"}' --json kosmo integrations:strapi strapi_update_entry '{"content_type":"example_content_type","id":1,"data":"example_data"}' --json strapi.strapi_delete_entry
Delete an entry from Strapi by content type and ID. This action is permanent.
write - Parameters
- content_type, id
kosmo integrations:call strapi.strapi_delete_entry '{"content_type":"example_content_type","id":1}' --json kosmo integrations:strapi strapi_delete_entry '{"content_type":"example_content_type","id":1}' --json strapi.strapi_list_content_types
List all content types defined in the Strapi Content-Type Builder. Returns API IDs, display names, and schema information.
read - Parameters
- none
kosmo integrations:call strapi.strapi_list_content_types '{}' --json kosmo integrations:strapi strapi_list_content_types '{}' --json strapi.strapi_get_current_user
Get the currently authenticated Strapi user. Useful for verifying the API token and checking permissions.
read - Parameters
- none
kosmo integrations:call strapi.strapi_get_current_user '{}' --json 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 5 parameters
kosmo integrations:schema strapi.strapi_list_entries --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 3 parameters
kosmo integrations:schema strapi.strapi_get_entry --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 2 parameters
kosmo integrations:schema strapi.strapi_create_entry --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 3 parameters
kosmo integrations:schema strapi.strapi_update_entry --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 2 parameters
kosmo integrations:schema strapi.strapi_delete_entry --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 0 parameters
kosmo integrations:schema strapi.strapi_list_content_types --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
strapi.strapi_get_current_user 0 parameters
kosmo integrations:schema strapi.strapi_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.