KosmoKrator

data

Payload CMS CLI for Cron Jobs

Use the Payload CMS CLI for cron jobs with headless JSON commands, schema discovery, credentials, and permission controls.

7 functions 6 read 1 write API token auth

Payload CMS CLI for Cron Jobs

Schedule repeatable integration workflows from cron while keeping credentials in KosmoKrator config.

Use the headless CLI from cron when an operation should run without an interactive agent session. The Payload CMS CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.

Command Shape

# Payload CMS CLI for Cron Jobs
kosmokrator integrations:configure payload-cms --set api_token="$PAYLOAD_CMS_API_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call payload-cms.payload_cms_list_collections '{}' --json

Discovery Before Execution

Agents and scripts can inspect Payload CMS docs and schemas before choosing a function.

kosmo integrations:docs payload-cms --json
kosmo integrations:docs payload-cms.payload_cms_list_collections --json
kosmo integrations:schema payload-cms.payload_cms_list_collections --json
kosmo integrations:search "Payload CMS" --json
kosmo integrations:list --json

Useful Payload CMS CLI Functions

FunctionTypeParametersDescription
payload-cms.payload_cms_list_collections Read none List all collections defined in the Payload CMS instance. Returns each collection's slug, labels, and field configuration.
payload-cms.payload_cms_get_collection Read slug Get detailed information about a specific collection by its slug. Returns field definitions, labels, default sort, and other configuration.
payload-cms.payload_cms_list_documents Read collection, limit, page, sort, where List documents in a Payload CMS collection. Supports pagination (limit, page), sorting, and filtering via the where parameter. Returns document IDs, timestamps, and field values.
payload-cms.payload_cms_get_document Read collection, document_id Get detailed information about a specific document by its ID within a collection. Returns all field values, timestamps, and metadata.
payload-cms.payload_cms_create_document Write collection, data Create a new document in a Payload CMS collection. Provide the collection slug and a JSON object of field values. The document is created as a draft by default (if versions are enabled on the collection).
payload-cms.payload_cms_list_users Read limit, page List users in the Payload CMS instance. Supports pagination with limit and page parameters. Returns user IDs, emails, names, and roles.
payload-cms.payload_cms_get_current_user Read none Get the profile of the currently authenticated Payload CMS user. Returns email, name, roles, and account metadata.

Automation Notes

Related Payload CMS CLI Pages