productivity
WP Engine Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the WP Engine KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.wp_engine.*.
Use lua_read_doc("integrations.wp-engine") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
WP Engine workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.wp_engine.list_sites({limit = 1, page = 1}))' --json kosmo integrations:lua --eval 'print(docs.read("wp-engine"))' --json
kosmo integrations:lua --eval 'print(docs.read("wp-engine.list_sites"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local wp_engine = app.integrations.wp_engine
local result = wp_engine.list_sites({limit = 1, page = 1})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.wp_engine, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.wp_engine.default.* or app.integrations.wp_engine.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need WP Engine, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
WP Engine — Lua API Reference
list_sites
List WP Engine sites with optional pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of sites per page (default: 100) |
page | integer | no | Page number for pagination (1-indexed, default: 1) |
Examples
-- List sites
local result = app.integrations["wp-engine"].wp_engine_list_sites({
limit = 10,
page = 1
})
for _, site in ipairs(result.sites) do
print(site.id .. ": " .. site.name .. " (" .. site.status .. ")")
end
get_site
Get details for a specific WP Engine site.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The site ID |
Examples
local result = app.integrations["wp-engine"].wp_engine_get_site({ id = "12345" })
print(result.name)
print(result.status)
print(result.created_at)
list_installs
List WP Engine installs with optional pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of installs per page (default: 100) |
page | integer | no | Page number for pagination (1-indexed, default: 1) |
Examples
-- List installs
local result = app.integrations["wp-engine"].wp_engine_list_installs({
limit = 10,
page = 1
})
for _, install in ipairs(result.installs) do
print(install.id .. ": " .. install.name .. " - " .. install.environment)
end
get_install
Get details for a specific WP Engine install.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The install ID |
Examples
local result = app.integrations["wp-engine"].wp_engine_get_install({ id = "67890" })
print(result.name)
print(result.environment)
print(result.php_version)
print(result.status)
list_domains
List domains across WP Engine installs.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of domains per page (default: 100) |
page | integer | no | Page number for pagination (1-indexed, default: 1) |
Examples
local result = app.integrations["wp-engine"].wp_engine_list_domains({
limit = 50,
page = 1
})
for _, domain in ipairs(result.domains) do
print(domain.name .. " -> " .. domain.installs_id)
end
list_users
List WP Engine users with optional pagination.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of users per page (default: 100) |
page | integer | no | Page number for pagination (1-indexed, default: 1) |
Examples
local result = app.integrations["wp-engine"].wp_engine_list_users({
limit = 10,
page = 1
})
for _, user in ipairs(result.users) do
print(user.id .. ": " .. user.email .. " (" .. user.role .. ")")
end
get_current_user
Get the profile of the currently authenticated user.
Parameters
None.
Examples
local result = app.integrations["wp-engine"].wp_engine_get_current_user({})
print("Logged in as: " .. result.email .. " (" .. result.id .. ")")
Multi-Account Usage
If you have multiple WP Engine accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations["wp-engine"].wp_engine_function_name({...})
-- Explicit default (portable across setups)
app.integrations["wp-engine"].default.wp_engine_function_name({...})
-- Named accounts
app.integrations["wp-engine"].production.wp_engine_function_name({...})
app.integrations["wp-engine"].staging.wp_engine_function_name({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# WP Engine — Lua API Reference
## list_sites
List WP Engine sites with optional pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of sites per page (default: 100) |
| `page` | integer | no | Page number for pagination (1-indexed, default: 1) |
### Examples
```lua
-- List sites
local result = app.integrations["wp-engine"].wp_engine_list_sites({
limit = 10,
page = 1
})
for _, site in ipairs(result.sites) do
print(site.id .. ": " .. site.name .. " (" .. site.status .. ")")
end
```
---
## get_site
Get details for a specific WP Engine site.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The site ID |
### Examples
```lua
local result = app.integrations["wp-engine"].wp_engine_get_site({ id = "12345" })
print(result.name)
print(result.status)
print(result.created_at)
```
---
## list_installs
List WP Engine installs with optional pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of installs per page (default: 100) |
| `page` | integer | no | Page number for pagination (1-indexed, default: 1) |
### Examples
```lua
-- List installs
local result = app.integrations["wp-engine"].wp_engine_list_installs({
limit = 10,
page = 1
})
for _, install in ipairs(result.installs) do
print(install.id .. ": " .. install.name .. " - " .. install.environment)
end
```
---
## get_install
Get details for a specific WP Engine install.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The install ID |
### Examples
```lua
local result = app.integrations["wp-engine"].wp_engine_get_install({ id = "67890" })
print(result.name)
print(result.environment)
print(result.php_version)
print(result.status)
```
---
## list_domains
List domains across WP Engine installs.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of domains per page (default: 100) |
| `page` | integer | no | Page number for pagination (1-indexed, default: 1) |
### Examples
```lua
local result = app.integrations["wp-engine"].wp_engine_list_domains({
limit = 50,
page = 1
})
for _, domain in ipairs(result.domains) do
print(domain.name .. " -> " .. domain.installs_id)
end
```
---
## list_users
List WP Engine users with optional pagination.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of users per page (default: 100) |
| `page` | integer | no | Page number for pagination (1-indexed, default: 1) |
### Examples
```lua
local result = app.integrations["wp-engine"].wp_engine_list_users({
limit = 10,
page = 1
})
for _, user in ipairs(result.users) do
print(user.id .. ": " .. user.email .. " (" .. user.role .. ")")
end
```
---
## get_current_user
Get the profile of the currently authenticated user.
### Parameters
None.
### Examples
```lua
local result = app.integrations["wp-engine"].wp_engine_get_current_user({})
print("Logged in as: " .. result.email .. " (" .. result.id .. ")")
```
---
## Multi-Account Usage
If you have multiple WP Engine accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations["wp-engine"].wp_engine_function_name({...})
-- Explicit default (portable across setups)
app.integrations["wp-engine"].default.wp_engine_function_name({...})
-- Named accounts
app.integrations["wp-engine"].production.wp_engine_function_name({...})
app.integrations["wp-engine"].staging.wp_engine_function_name({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.wp_engine.list_sites({limit = 1, page = 1})
print(result) Functions
list_sites Read
List WP Engine sites. Supports pagination with limit and page parameters.
- Lua path
app.integrations.wp_engine.list_sites- Full name
wp-engine.wp_engine_list_sites
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of sites per page (default: 100). |
page | integer | no | Page number for pagination (1-indexed, default: 1). |
get_site Read
Get details for a specific WP Engine site by ID.
- Lua path
app.integrations.wp_engine.get_site- Full name
wp-engine.wp_engine_get_site
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The site ID. |
list_installs Read
List WP Engine installs. Supports pagination with limit and page parameters.
- Lua path
app.integrations.wp_engine.list_installs- Full name
wp-engine.wp_engine_list_installs
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of installs per page (default: 100). |
page | integer | no | Page number for pagination (1-indexed, default: 1). |
get_install Read
Get details for a specific WP Engine install by ID.
- Lua path
app.integrations.wp_engine.get_install- Full name
wp-engine.wp_engine_get_install
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The install ID. |
list_domains Read
List domains across WP Engine installs. Supports pagination with limit and page parameters.
- Lua path
app.integrations.wp_engine.list_domains- Full name
wp-engine.wp_engine_list_domains
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of domains per page (default: 100). |
page | integer | no | Page number for pagination (1-indexed, default: 1). |
list_users Read
List WP Engine users. Supports pagination with limit and page parameters.
- Lua path
app.integrations.wp_engine.list_users- Full name
wp-engine.wp_engine_list_users
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of users per page (default: 100). |
page | integer | no | Page number for pagination (1-indexed, default: 1). |
get_current_user Read
Get the profile of the currently authenticated WP Engine user. Useful for verifying credentials and displaying account information.
- Lua path
app.integrations.wp_engine.get_current_user- Full name
wp-engine.wp_engine_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||