cms
Contentful CLI for Headless Automation
Use the Contentful CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
12 functions 6 read 6 write Bearer token auth
Contentful CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Contentful CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Contentful CLI for Headless Automation
kosmokrator integrations:configure contentful --set access_token="$CONTENTFUL_ACCESS_TOKEN" --set space_id="$CONTENTFUL_SPACE_ID" --enable --read allow --write ask --json
kosmo integrations:call contentful.contentful_list_content_types '{"limit":1}' --json Discovery Before Execution
Agents and scripts can inspect Contentful docs and schemas before choosing a function.
kosmo integrations:docs contentful --json
kosmo integrations:docs contentful.contentful_list_content_types --json
kosmo integrations:schema contentful.contentful_list_content_types --json
kosmo integrations:search "Contentful" --json
kosmo integrations:list --json Useful Contentful CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
contentful.contentful_list_content_types | Read | limit | List all content types defined in the connected Contentful space. Returns each content type's ID, name, description, and field count. Optionally limit the number of results. |
contentful.contentful_get_content_type | Read | content_type_id | Get detailed information about a specific content type by its ID. Returns the content type name, description, display field, and full field definitions. |
contentful.contentful_create_content_type | Write | name, display_name, description, fields | Create a new content type in Contentful with a name, display name, optional description, and field definitions. Fields are provided as a JSON array of objects with id, name, and type. Common field types: Symbol, Text, Integer, Number, Boolean, Date, Location, RichText, Array, Link. |
contentful.contentful_list_entries | Read | content_type, limit, skip, order, query | List entries in the Contentful space. Optionally filter by content type, control pagination with limit and skip, order results, or search with a text query. Returns entry IDs, content types, and localized field values. |
contentful.contentful_get_entry | Read | entry_id | Get detailed information about a specific entry by its ID. Returns all localized field values, content type, version, and timestamps. |
contentful.contentful_create_entry | Write | content_type_id, fields | Create a new entry in Contentful. Specify the content type ID and provide field values as a JSON object. Fields must be localized, e.g. {"title": {"en-US": "My Title"}}. The entry is created as a draft; use the publish tool to publish it. |
contentful.contentful_update_entry | Write | entry_id, fields, version | Update an existing entry's field values. Requires the current version number for optimistic locking. Fields must be localized, e.g. {"title": {"en-US": "Updated Title"}}. The version is sent as the X-Contentful-Version header. |
contentful.contentful_publish_entry | Write | entry_id, version | Publish a draft or updated entry. Requires the current version number for optimistic locking, sent as the X-Contentful-Version header. After publishing, the entry becomes publicly visible via the Content Delivery API. |
contentful.contentful_unpublish_entry | Write | entry_id, version | Unpublish a published entry, reverting it to draft status. Requires the current version number for optimistic locking, sent as the X-Contentful-Version header. The entry will no longer be visible via the Content Delivery API. |
contentful.contentful_delete_entry | Write | entry_id | Permanently delete an entry from the Contentful space. The entry must be unpublished before it can be deleted. This action is irreversible. |
contentful.contentful_list_assets | Read | limit, skip | List assets (images, files, videos) in the Contentful space. Supports pagination with limit and skip parameters. Returns asset IDs, titles, file details, and URLs. |
contentful.contentful_get_space | Read | none | Get details about the connected Contentful space, including name, locales, organization, and space type. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.