Use the WordPress CLI from KosmoKrator to call WordPress tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.
WordPress can be configured headlessly with `kosmokrator integrations:configure wordpress`.
# 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 wordpress --set url="$WORDPRESS_URL" --set username="$WORDPRESS_USERNAME" --set application_password="$WORDPRESS_APPLICATION_PASSWORD" --enable --read allow --write ask --jsonkosmokrator integrations:doctor wordpress --jsonkosmokrator integrations:status --json
Credentials
Authentication type: API keyapi_key. Configure credentials once, then use the same stored profile from
scripts, coding CLIs, Lua code mode, and the MCP gateway.
Key
Env var
Type
Required
Label
url
WORDPRESS_URL
URL url
yes
WordPress REST API URL
username
WORDPRESS_USERNAME
Text text
yes
Username
application_password
WORDPRESS_APPLICATION_PASSWORD
Secret secret
yes
Application Password
Call WordPress Headlessly
Use the generic call form when another coding CLI or script needs a stable universal interface.
Every function below can be called headlessly. The generic form is stable across all integrations;
the provider shortcut is shorter but specific to WordPress.
wordpress.wordpress_create_post
Write write
Create a new post on the WordPress site. Requires a title. Content, status, categories, and tags can be specified. Defaults to draft status for safety.
Use these parameter tables when building CLI payloads without calling integrations:schema first.
wordpress.wordpress_create_post
Create a new post on the WordPress site. Requires a title. Content, status, categories, and tags can be specified. Defaults to draft status for safety.
New post status: draft, publish, pending, private.
excerpt
string
no
New post excerpt in HTML format.
author
integer
no
New author user ID.
categories
array
no
Array of category IDs to assign (replaces existing).
tags
array
no
Array of tag IDs to assign (replaces existing).
featured_media
integer
no
Featured image (media) ID.
slug
string
no
New URL slug for the post.
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.